wc_product_enable_dimensions_display

wc_product_enable_dimensions_display

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('wc_product_enable_dimensions_display') is found 3 times:

  • /includes/legacy/abstract-wc-legacy-product.php line 636
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    * @return bool
     */
    public function enable_dimensions_display() {
        wc_deprecated_function( 'WC_Product::enable_dimensions_display', '3.0' );
        return apply_filters( 'wc_product_enable_dimensions_display', true ) && ( $this->has_dimensions() || $this->has_weight() || $this->child_has_weight() || $this->child_has_dimensions() );
    }
     
    /**
     * Returns the product rating in html format.
     *
     * @deprecated 3.0.0
  • /includes/wc-template-functions.php line 2111
    2107
    2108
    2109
    2110
    2111
    2112
    2113
    2114
    2115
    2116
    2117
    * @param bool $enable_dimensions_display True to enable dimensions display for the product.
     *
     * @since 2.0.14
     */
    if ( ( $product instanceof WC_Product ) && ( $product->has_attributes() || apply_filters( 'wc_product_enable_dimensions_display', $product->has_weight() || $product->has_dimensions() ) ) ) {
        $tabs['additional_information'] = array(
            'title'    => __( 'Additional information', 'woocommerce' ),
            'priority' => 20,
            'callback' => 'woocommerce_product_additional_information_tab',
        );
    }
  • /includes/wc-template-functions.php line 3809
    3805
    3806
    3807
    3808
    3809
    3810
    3811
    3812
    3813
    3814
    3815
    function wc_display_product_attributes( $product ) {
        $product_attributes = array();
     
        // Display weight and dimensions before attribute list.
        $display_dimensions = apply_filters( 'wc_product_enable_dimensions_display', $product->has_weight() || $product->has_dimensions() );
     
        if ( $display_dimensions && $product->has_weight() ) {
            $product_attributes['weight'] = array(
                'label' => __( 'Weight', 'woocommerce' ),
                'value' => wc_format_weight( $product->get_weight() ),
            );