Skip to content

Instantly share code, notes, and snippets.

@mattiasghodsian
Last active April 28, 2023 08:37
Show Gist options
  • Select an option

  • Save mattiasghodsian/39a8430ded67514a5e5250af748a59b5 to your computer and use it in GitHub Desktop.

Select an option

Save mattiasghodsian/39a8430ded67514a5e5250af748a59b5 to your computer and use it in GitHub Desktop.
[Woocommerce] Add product attribute to menu
/**
* Title: [Woocommerce] Add product attribute to menu
* Author: Mattias Ghodsian
* Description: Add product attribute to menu
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5
**/
add_filter('woocommerce_attribute_show_in_nav_menus', 'wc_attr_in_menu', 1, 2);
function wc_attr_in_menu( $register, $name = '' ) {
if ( $name == 'pa_smakprofil' ) $register = true;
return $register;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment