Skip to content

Instantly share code, notes, and snippets.

@j2machado
Created November 17, 2023 14:19
Show Gist options
  • Select an option

  • Save j2machado/9f686f55d0102b2c2b8342f056d8ae2a to your computer and use it in GitHub Desktop.

Select an option

Save j2machado/9f686f55d0102b2c2b8342f056d8ae2a to your computer and use it in GitHub Desktop.
<?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