woocommerce_product_variation_title

The WooCommerce woocommerce product variation title hook.

Description

apply_filters( 'woocommerce_product_variation_title', (unknown) $rtrim, (unknown) $product, (unknown) $title_base, (unknown) $title_suffix ); 

Parameters (4)

0. $rtrim (unknown) => rtrim( $title_base . $separator . $title_suffix, $separator )
The rtrim.
1. $product (unknown)
The product.
2. $title_base (unknown)
The title base.
3. $title_suffix (unknown)
The title suffix.

Usage

To run the hook, copy the example below.
  1. $rtrim = apply_filters( 'woocommerce_product_variation_title', $rtrim, $product, $title_base, $title_suffix ); 
  2.  
  3. if ( !empty( $rtrim ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_product_variation_title callback 
  2. function filter_woocommerce_product_variation_title( $rtrim, $product, $title_base, $title_suffix ) { 
  3. // make filter magic happen here... 
  4. return $rtrim
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_product_variation_title', 'filter_woocommerce_product_variation_title', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_product_variation_title', 'filter_woocommerce_product_variation_title', 10, 4 ); 

Defined (1)

The filter is defined in the following location(s).

/includes/data-stores/class-wc-product-variation-data-store-cpt.php  
  1. return apply_filters( 'woocommerce_product_variation_title', rtrim( $title_base . $separator . $title_suffix, $separator ), $product, $title_base, $title_suffix );