woocommerce_product_default_attributes filter-hookWC 1.0

Deprecated from version 3.0.0. It is no longer supported and can be removed in future releases. It is recommended to replace this hook with the same one.

Deprecated: 3.0.0

If set, get the default attributes for a variable product.

Usage

add_filter( 'woocommerce_product_default_attributes', 'wp_kama_woocommerce_product_default_attributes_filter', 10, 2 );

/**
 * Function for `woocommerce_product_default_attributes` filter-hook.
 * 
 * @param  $default_attributes 
 * @param  $that               
 *
 * @return 
 */
function wp_kama_woocommerce_product_default_attributes_filter( $default_attributes, $that ){

	// filter...
	return $default_attributes;
}
$default_attributes
-
$that
-

Changelog

Deprecated since 3.0.0

Where the hook is called

WC_Abstract_Legacy_Product::get_variation_default_attributes()
woocommerce_product_default_attributes
woocommerce/includes/legacy/abstract-wc-legacy-product.php 165
return apply_filters( 'woocommerce_product_default_attributes', $this->get_default_attributes(), $this );

Where the hook is used in WooCommerce

Usage not found.