display links to specific user roles
-
I have created two new roles with basically the same access as subscribers except they can both read private pages. I want to display a list of links in a php widget that is different depending on what role the logged in user is.
I’m not real hot with PHP code, but could I do something like:
get role_name
if role_name is AAAA then (display code)
if role_name is BBBB then (display code)
else
(display default code)I have some code that almost does what I want, but it is based on what privledges a role has instead of what the actual role is. Since both new roles have the same privledges, I can’t differentiate. Here’s that particular code:
[code]
<?php
if ( current_user_can( 'read_private_pages' ) ) { ?>
Page for Role AAAA<?php } else { ?>
Page for Role BBBB
<?php } ?><?php } ?>
[/code]Any thoughts? Thanks!
- The topic ‘display links to specific user roles’ is closed to new replies.