Advertisement
lorro

WooCommerce - Show terms slugs instead of names

Feb 1st, 2021
829
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.29 KB | None | 0 0
  1. <?php
  2. // WooCommerce - In Product Data, Attributes tab
  3. // show term slugs instead of term names
  4. add_filter( 'woocommerce_product_attribute_term_name', 'custom_product_attribute_term_name', 10, 2 );
  5. function custom_product_attribute_term_name( $term_name, $term ) {
  6.   return $term->slug;
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement