wc_product_enable_dimensions_display
Filter to customize the display of dimensions for a product in its product page.
Usage
add_filter( 'wc_product_enable_dimensions_display', 'wp_kama_wc_product_enable_dimensions_display_filter' );
/**
* Function for `wc_product_enable_dimensions_display` filter-hook.
*
* @param bool $enable_dimensions_display True to enable dimensions display for the product.
*
* @return bool
*/
function wp_kama_wc_product_enable_dimensions_display_filter( $enable_dimensions_display ){
// filter...
return $enable_dimensions_display;
}
- $enable_dimensions_display(true|false)
- True to enable dimensions display for the product.
Changelog
| Since 2.0.14 | Introduced. |
Where the hook is called
wc_product_enable_dimensions_display
wc_product_enable_dimensions_display
woocommerce/includes/wc-template-functions.php 2095
if ( $product->has_attributes() || apply_filters( 'wc_product_enable_dimensions_display', $product->has_weight() || $product->has_dimensions() ) ) {
woocommerce/includes/legacy/abstract-wc-legacy-product.php 636
return apply_filters( 'wc_product_enable_dimensions_display', true ) && ( $this->has_dimensions() || $this->has_weight() || $this->child_has_weight() || $this->child_has_dimensions() );
woocommerce/includes/wc-template-functions.php 3854
$display_dimensions = apply_filters( 'wc_product_enable_dimensions_display', $product->has_weight() || $product->has_dimensions() );