Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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: Give NMR priority over any competing Walkers
Version: 0.1.0
Author: helgatheviking
Author URI: http://kathyisawesome.com
*/
function kia_force_nmr_filter( $walker ){
if( function_exists( 'Nav_Menu_Roles' ) ){
$walker = 'Walker_Nav_Menu_Edit_Roles';
}
return $walker;
}
add_filter( 'wp_edit_nav_menu_walker', 'kia_force_nmr_filter', 999999 );
@funnychord

This comment has been minimized.

Copy link

funnychord commented Mar 22, 2017

Thank you for this!

@widmankarlsson

This comment has been minimized.

Copy link

widmankarlsson commented Jul 29, 2017

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

@mikewing94

This comment has been minimized.

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!

@tara2

This comment has been minimized.

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
You can’t perform that action at this time.