Customizing access based on user roles
-
I have several different user roles that I created using Simple Membership. Now, I want each user role to have a different nav bar. (menu)
I have two separate nav bars, one called LoggedIn and one called Default.
Ideally, I’d use the following code in functions.php:function my_wp_nav_menu_args( $args = '' ) { if( is_user_logged_in() ) { $args['menu'] = 'LoggedIn'; } else { $args['menu'] = 'Default'; } return $args; } add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );
And that works great, for differentiating between users who are logged in and users that are not.
However, I would like to add another level of differentiation, based on Simple Membership user roles. (Or aliases).
So, is there a way for me to access Simple Membership’sget('alias')
function from within functions.php? So that I can add more nav bars and conditions?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Customizing access based on user roles’ is closed to new replies.