wc_get_coupon_type

Get a coupon type's name.

Description

(string) wc_get_coupon_type( (string) $type = '' ); 

Returns (string)

Parameters (1)

0. $type — Optional. (string) => ''
(default: '')

Usage

  1. if ( !function_exists( 'wc_get_coupon_type' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-coupon-functions.php'; 
  3.  
  4. // (default: '') 
  5. $type = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wc_get_coupon_type($type); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-coupon-functions.php  
  1. function wc_get_coupon_type( $type = '' ) { 
  2. $types = wc_get_coupon_types(); 
  3. return isset( $types[ $type ] ) ? $types[ $type ] : '';