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
- Processing data and redirecting with query string
- How do I make a redirect in PHP?
- How to set and use global variables? Or why not to use them at all
- How to deprecate a function used in a plugin?
- How to manually fix the WordPress gallery code using PHP in functions.php?
- Adding first / last CSS classes to menus
- How to make a image-size selected by default in Media upload – WP v3.5
- What is This esc_html_e() i wordpress php?
- Error Warning: Declaration of description_walker::start_el after PHP upgrade [duplicate]
- How to Add Image to WordPress RSS-Feed with no Plug-in?
- Function to return true if current page has child pages
- How do I change/modify the_post_thumbnail(); html output?
- Enforcing password complexity
- PHP code in page template vs functions
- Apply class to every paragraph that holds image?
- Remove “Insert from URL” link in Media upload – WP 3.5
- static variable loop not working in WordPress
- Cleaning up WordPress to improve performance?
- Proper use of Output Buffer
- Menu Items Disappearing
- List of all theme customizer control types?