wc_get_attribute_type_label

Get attribute type label.

Description

(string) wc_get_attribute_type_label( (string) $type ); 

Returns (string)

Parameters (1)

0. $type (string)
Attribute type slug.

Usage

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

Defined (1)

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

/includes/wc-attribute-functions.php  
  1. function wc_get_attribute_type_label( $type ) { 
  2. $types = wc_get_attribute_types(); 
  3.  
  4. return isset( $types[ $type ] ) ? $types[ $type ] : ucfirst( $type );