Last active
April 28, 2023 08:37
-
-
Save mattiasghodsian/39a8430ded67514a5e5250af748a59b5 to your computer and use it in GitHub Desktop.
[Woocommerce] Add product attribute to menu
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
| /** | |
| * 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