WC_Product::set_default_attributes
Set default attributes. These will be saved as strings and should map to attribute values.
Method of the class: WC_Product{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Product = new WC_Product(); $WC_Product->set_default_attributes( $default_attributes );
- $default_attributes(array) (required)
- List of default attributes.
Changelog
| Since 3.0.0 | Introduced. |
WC_Product::set_default_attributes() WC Product::set default attributes code WC 10.6.2
public function set_default_attributes( $default_attributes ) {
$this->set_prop( 'default_attributes', array_map( 'strval', array_filter( (array) $default_attributes, 'wc_array_filter_default_attributes' ) ) );
}