woocommerce_product_title
Get the product's title. For variations this is the parent product name.
Использование
add_filter( 'woocommerce_product_title', 'wp_kama_woocommerce_product_title_filter', 10, 2 );
/**
* Function for `woocommerce_product_title` filter-hook.
*
* @param $parent_data_title
* @param $that
*
* @return
*/
function wp_kama_woocommerce_product_title_filter( $parent_data_title, $that ){
// filter...
return $parent_data_title;
}
- $parent_data_title
- -
- $that
- -
Где вызывается хук
woocommerce_product_title
woocommerce_product_title
woocommerce/includes/class-wc-product-variation.php 97
return apply_filters( 'woocommerce_product_title', $this->parent_data['title'], $this );
woocommerce/includes/abstracts/abstract-wc-product.php 1927
return apply_filters( 'woocommerce_product_title', $this->get_name(), $this );