Is there any documentation on JS trigger for the Gutenberg “Navigation” block?
Is there any documentation on JS trigger for the Gutenberg “Navigation” block?
Is there any documentation on JS trigger for the Gutenberg “Navigation” block?
WordPress menu disappears in category pages
Custom loop menu is not working
Is there a way to eliminate flyout menus when adding a post?
That’s not the filter to use, instead use the wp_nav_menu_objects filter documented at: https://developer.wordpress.org/reference/hooks/wp_nav_menu_objects/ The docs contain a helpful code example provided by a contributor at the bottom, which I’ve modified slightly: function wpse_unset_menu_items( $menu_objects, $args ) { // remove this if you want it on all menus not just a specific menu aka primary_menu: … Read more
In my opinion your approach of registering multiple menus for different footer sections and social links is a good practice in WP theme development because it provides more flexibility and clarity to users in managing their site content and also allows easier customization and maintenance in the long run.
You can easily add any HTML element to all menu items that have children by extending the Walker_Nav_Menu core class. The code below will add <i> icon element just after menu item </a> tag but you can of course change that if you need them inside or somewhere else by changing the $item_output variable. function … Read more
It’s easy to get the type of the menu item. Just call the setting’s value() method, which in the case of a nav menu item, would return an array with items like type (sample value: post_type or taxonomy) and object (sample value: post, page or category). So in your case, just check whether the type‘s … Read more
Update Solution was easy I’m stupid I just tweaked the menu creation and directly assigned the parent-menu-id: if (!empty($term->parent) && $term->parent != 0) { $parent_menu_item_id = get_parent_menu_item_id_by_name($term->parent, $menu_id); if ($parent_menu_item_id) { $menu_item_id = wp_update_nav_menu_item($menu_id, 0, array( ‘menu-item-title’ => $term_name, ‘menu-item-object-id’ => intval($term_id), ‘menu-item-object’ => ‘product_cat’, ‘menu-item-type’ => ‘taxonomy’, ‘url’ => get_term_link($term), ‘menu-item-parent-id’ => $parent_menu_item_id, ‘menu-item-status’ … Read more
If it’s a menu item in a classic menu, then yes, you could use useEntityProp to get and set the menu item’s post meta, except that the post type is actually nav_menu_item and that you would need to manually add custom fields support to that post type. const navMenuItemId = 123; const [ meta, setMeta … Read more