Created
November 17, 2023 14:19
-
-
Save j2machado/9f686f55d0102b2c2b8342f056d8ae2a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * Snippet: 'Filter' the Dimensions label under the Additional Information tab on the Single Product page in WooCommerce. | |
| * Author: Obi Juan. | |
| * Author URI: https://obijuan.dev. | |
| * License: GPL v2 or later. | |
| */ | |
| add_filter( 'woocommerce_display_product_attributes', 'obi_woocommerce_custom_dimensions_label', 10, 2 ); | |
| function obi_woocommerce_custom_dimensions_label( $product_attributes, $product ) { | |
| if ( isset( $product_attributes['dimensions'] ) ) { | |
| $product_attributes['dimensions']['label'] = 'Shipping Dimensions'; //Set your custom label. | |
| } | |
| return $product_attributes; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment