Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tamarazuk/32dd99e66aad8eabc7aa to your computer and use it in GitHub Desktop.
Save tamarazuk/32dd99e66aad8eabc7aa to your computer and use it in GitHub Desktop.
<?php
/**
* This adds the new unit to the WooCommerce admin
*/
function add_woocommerce_dimension_unit_league( $settings ) {
foreach ( $settings as &$setting ) {
if ( 'woocommerce_dimension_unit' == $setting['id'] ) {
$setting['options']['league'] = __( 'League' ); // new unit
}
}
return $settings;
}
add_filter( 'woocommerce_product_settings', 'add_woocommerce_dimension_unit_league' );
@gnanavelshenll
Copy link

Its not working for me. can you explain the code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment