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

commented Mar 22, 2017

Thank you for this!

@widmankarlsson

This comment has been minimized.

Copy link

commented Jul 29, 2017

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

@mikewing94

This comment has been minimized.

Copy link

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!

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.