woocommerce_product_default_attributes
Устарел с версии 3.0.0. Больше не поддерживается и может быть удален. Рекомендуется заменить этот хук на аналог.
Deprecated: 3.0.0
If set, get the default attributes for a variable product.
Использование
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
- -
Список изменений
Устарела с | 3.0.0 |
Где вызывается хук
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 );