wc_product_enable_dimensions_display
Filter to customize the display of dimensions for a product in its product page.
Использование
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.
Список изменений
С версии 2.0.14 | Введена. |
Где вызывается хук
wc_product_enable_dimensions_display
wc_product_enable_dimensions_display
woocommerce/includes/wc-template-functions.php 2124
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 3771
$display_dimensions = apply_filters( 'wc_product_enable_dimensions_display', $product->has_weight() || $product->has_dimensions() );