Skip to content

Instantly share code, notes, and snippets.

@helgatheviking
Last active September 3, 2025 21:07
Show Gist options
  • Select an option

  • Save helgatheviking/d00f9c033a4b0aab0f69cf50d7dcd89c to your computer and use it in GitHub Desktop.

Select an option

Save helgatheviking/d00f9c033a4b0aab0f69cf50d7dcd89c to your computer and use it in GitHub Desktop.
Give Nav Menu Roles priority over any competing Walkers
<?php
/**
* Plugin Name: Nav Menu Roles Toggle
* Plugin URI: https://gist.github.com/helgatheviking/d00f9c033a4b0aab0f69cf50d7dcd89c
* Description: Disable any competing/incompatible Walkers
* Version: 0.3.0
* Author: helgatheviking
* Author URI: http://kathyisawesome.com
*/
remove_all_filters( 'wp_edit_nav_menu_walker' );
@RevealMarketing
Copy link

I tried adding the code as a plugin. I did not fix the problem.

@helgatheviking
Copy link
Author

helgatheviking commented Sep 3, 2025

@RevealMarketing looking at the snippet and I'm not sure where $version is even defined. I'll make a little tweak that might help.

Nav menu roles hasn't used a custom walker in 5 years. at this point, any theme that still is overriding the walker via wp_edit_nav_menu_walker and not including the relevant core hook wp_nav_menu_item_custom_fields is doing it wrong and needs to update.

I will say that the full site editor experience is not supported as the UI for that is too restrictive, so this toggle only has any input on the admin menus page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment