You have to hook into the wp_nav_menu_items filter to get the correct link with the nonce, as described here . An example of how to do that can be seen here https://gist.github.com/theukedge/6565746#file-gistfile1-php
Related Posts:
- Mega Menu Walker
- Displaying Logged-In User Name in WordPress Menu
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- Detecting classes, adding widgets, and adding divs in with a Nav Walker
- Add login hyperlink to secondary navigation menu
- Nav-Menu not showing up
- Redirect User when they click Menu Option
- Custom Navigation Bar JSON Syntax Error in JSON at Position 0
- start_lvl Ignored in Custom walker_nav_menu
- Hide main div if wp_nav_menu is empty
- PHP – redirect https to http and www to non-www
- Check if a menu is empty?
- How to remove a metabox from menu editor page?
- How to redirect users to custom lostpassword page?
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- How to add active class to custom menu using while loop and wp_list_pages
- WordPress menu deletes when trying to add a hook
- Second Navigation inside header
- Change links automatically to affiliate links
- How can I add a custom class to only nav sub-menu > li > a items in WordPress?
- items_wrap not working
- Style wp_page_menu() items
- Have CSS Class Added with `is_page()` WP function
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Run a filter when a walker runs
- Change Navigation Bar based on logged in or not
- Multiple WordPress Menus that will only display all pages
- Menu — How to add “current-menu-grand-ancestor” css class
- Menu Limitations
- Automatically adding new post categories to menu
- Add data attribute to each li in menu
- Custom Walker_Nav_Menu issue with variables on PHP 7.3
- Unique icons next to each WordPress menu item
- Child page menu in sidebar
- Title Case WordPress Menu Items
- WordPress Quick Question . How to Get Parent Link in Submenu in My Code
- How to change menu order item
- Add item to top of menu using a filter in functions.php
- Moving code from theme header to functions.php
- Register a menu – Error Header
- How to style one item from main navigation?
- WordPress redirect redirecting too many times or not at all
- Add value to new attribute inside WordPress menu items
- Menu Custom Data Attributes
- Get the name of menu item with wp_nav_menu
- How to modify mobile nav menu text in theme
- How to add aria role and schema markup to custom walker container
- How can I use custom menus with a Bootstrap WordPress theme?
- Custom navigation menu with awsAccordion
- Why can’t I add a custom image in my navigation?
- Remove submenu item from list
- Dynamic Menu drops pages?
- Remove the Tag from wp_nav_menu
- Menu not styling. New menus functionality giving me a headache
- WP insert post Redirect after function has executed
- How to define a rule in functions.php that ONLY disables the default wp functionality that undesirably changes ‘&’ to ‘#038;’?
- how to changes mobile menu toggle breakpoint in WordPress
- How to display already created menus via php?
- Providin exception to WordPress wp_nav_menu Custom CSS Classes
- I want to show cart items number if any or nothing, simple CART text
- How to set Nav as a default menu in wordpress
- How to put 2 php codes in functions.php without site crashing
- Menu not updating for logged in users after redirect
- Add element after navigation element title don’t works like I expect
- Need help with AJAX login to call php in functions.php to handle redirects based on user cap (role)
- Add parent menu item in sub-menu in custom nav_walker
- How to create a sub-page of sub-page?
- Fatal error when using array_diff() function inside of wp_update_nav_menu hook?
- Pulling a variable into the wp_nav_menu function
- redirect 301 with special character like WIX site “#!”
- How I can add div to menu?
- Add the “.current-menu-item” class to tag?
- WordPress adding in site URL to header links
- Nav Menu Display
- Link to external page has wordpress blog-url inside
- Open WordPress Page from selected option dropdown
- How to add different menu items on different menus?
- Nav menù doesn’t display selected pages
- How to correct schedule my event weekly with wp_schedule_event()
- Execute a shortcode when clicking on a image
- How can I add a class to a single menu item?
- Recent post display using shortcode
- How can I use wp_insert_comment to write a comment when a post is edited?
- Can’t extend some core classes
- How do you add customer capability after Woocommerce purchase?
- How to put a variable in a instance in the widget
- Show categories then when clicked on a category list all sub category and when clicked show all posts in that sub category
- Run a code only on theme activation only during first activation
- Shortcode from a function not working
- wp nav menu: show submenu below li item
- Styling an “active” link outside of WordPress default menu
- WordPress permalink issue
- Reject all malicious URL requests functions.php
- Notice: Undefined variable
- How to override WooCommerce Order Item Meta with data from Cart?
- Active class not working on custom menu link using add_menu_page
- How do I change the Go To Categories link in the term_updated_messages
- WooCommerce – Show ‘Sales’ badge on variable products where only some variations have sales price [closed]
- Create custom API endpoint to change custom header image