wc_variation_attribute_name

Get the attribute name used when storing values in post meta.

Description

(string) wc_variation_attribute_name( (string) $attribute_name ); 

Returns (string)

Parameters (1)

0. $attribute_name (string)
The attribute name.

Usage

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

Defined (1)

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

/includes/wc-attribute-functions.php  
  1. function wc_variation_attribute_name( $attribute_name ) { 
  2. return 'attribute_' . sanitize_title( $attribute_name );