taxonomy_is_product_attribute

Returns true when the passed taxonomy name is a product attribute.

Description

taxonomy_is_product_attribute( (string) $name ); 

Parameters (1)

0. $name (string)
Of the attribute

Usage

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

Defined (1)

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

/includes/wc-conditional-functions.php  
  1. function taxonomy_is_product_attribute( $name ) { 
  2. global $wc_product_attributes; 
  3.  
  4. return taxonomy_exists( $name ) && array_key_exists( $name, (array) $wc_product_attributes );