WC_Product::set_default_attributes()publicWC 3.0.0

Set default attributes. These will be saved as strings and should map to attribute values.

Method of the class: WC_Product{}

No Hooks.

Return

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() code WC 8.7.0

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' ) ) );
}