Pass product into filters

This commit is contained in:
Claudiu Lodromanean 2017-02-09 14:05:40 -08:00
parent a3f9207839
commit e330ab4158
1 changed files with 3 additions and 3 deletions

View File

@ -173,9 +173,9 @@ class WC_Product_Variation_Data_Store_CPT extends WC_Product_Data_Store_CPT impl
* @return string
*/
protected function generate_product_title( $product ) {
$use_longform_title = apply_filters( 'woocommerce_product_variation_title_use_longform_style', count( $product->get_attributes() ) > 1 );
$title_base = apply_filters( 'woocommerce_product_variation_title_base', get_post_field( 'post_title', $product->get_parent_id() ) );
$separator = apply_filters( 'woocommerce_product_variation_title_separator', '–' );
$use_longform_title = apply_filters( 'woocommerce_product_variation_title_use_longform_style', count( $product->get_attributes() ) > 1, $product );
$title_base = apply_filters( 'woocommerce_product_variation_title_base', get_post_field( 'post_title', $product->get_parent_id() ), $product );
$separator = apply_filters( 'woocommerce_product_variation_title_separator', '–', $product );
return $title_base . ' ' . $separator . ' ' . wc_get_formatted_variation( $product, true, $use_longform_title );
}