Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Give Nav Menu Roles priority over any competing Walkers
Plugin Name: Nav Menu Roles Toggle
Plugin URI:
Description: Give NMR priority over any competing Walkers
Version: 0.2.0
Author: helgatheviking
Author URI:
global $wp_version;
if ( version_compare( strtolower( $wp_version ), strtolower( $version ), '>=' ) ) {
remove_all_filters( 'wp_edit_nav_menu_walker' );
} else {
add_filter( 'wp_edit_nav_menu_walker', 'kia_force_nmr_filter', 999999 );
function kia_force_nmr_filter( $walker ){
if( function_exists( 'Nav_Menu_Roles' ) ){
$walker = 'Walker_Nav_Menu_Edit_Roles';
return $walker;
Copy link

funnychord commented Mar 22, 2017

Thank you for this!

Copy link

widmankarlsson commented Jul 29, 2017

Thank you! This solved my problems with our complex menu! :)

Copy link

mikewing94 commented Sep 19, 2017

Thank you! this is great for using with the LMS theme, this has been an issue for a while conflicting with this theme!

Copy link

tara2 commented Sep 20, 2019

Thank you so much for this! :)
...and for anyone who's not sure how to use this plugin (like me!) ...if you download to your computer using the top-right 'Download Zip' button on this page, then change the name of the zip file to something like 'Nav Menu Rules Toggle' ...and just upload it to your plugins page like you usually do. :)

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