Last active
September 5, 2015 07:14
-
-
Save mikestratton/4a95a8b88f78713397b7 to your computer and use it in GitHub Desktop.
Two Wordpress Menu Views: (Public and Logged in Users view different menus.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_wp_nav_menu_args( $args = '' ) { | |
if( is_user_logged_in() ) { | |
$args['menu'] = 'menu-private'; | |
} else { | |
$args['menu'] = 'menu-public'; | |
} | |
return $args; | |
} | |
add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' ); | |
?> | |
// Code can be customized to support Wordpress' | |
// internal user permissions. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment