WC_Product_Variable::get_variation_default_attribute()
If set, get the default attributes for a variable product.
Method of the class: WC_Product_Variable{}
No Hooks.
Return
String
.
Usage
$WC_Product_Variable = new WC_Product_Variable(); $WC_Product_Variable->get_variation_default_attribute( $attribute_name );
- $attribute_name(string) (required)
- Attribute name.
WC_Product_Variable::get_variation_default_attribute() WC Product Variable::get variation default attribute code WC 9.4.2
public function get_variation_default_attribute( $attribute_name ) { $defaults = $this->get_default_attributes(); $attribute_name = sanitize_title( $attribute_name ); return isset( $defaults[ $attribute_name ] ) ? $defaults[ $attribute_name ] : ''; }