current_user_can not working
-
I have three custom roles. Each custom role has it’s own custom permission or ‘Capability’. I’m trying to show/hide menu items in header.php based on their role. I’m using similar code from your suggestion above, but it’s not working. The End User role has the role_enduser permissions and the Partner role has role_partner permissions. Users have to be logged in to see this page. I can confirm that the users have the correct roles and each role has the correct permissions in the admin. Can you help?
<? php if ( current_user_can( 'role_enduser' ) ) { ?> I'm an End User <? php } else if ( current_user_can( 'role_partner' ) ) { ?> I'm a Partner <? php } ?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘current_user_can not working’ is closed to new replies.