Resources

My Agape try

Your Agape try


Support Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




Check role in template

UserPost

12:22 pm
May 22, 2011


DarioDN

Member

posts 3

1

I'm editing my blog theme, creating a new template. I would insert in this a control function to check if the logged user is member of a particular group defined in RoleScoper. If true he can view the page.

I have to define it in template file NOT in Page/Post panel.

How can I do?

Tnx

6:38 am
May 23, 2011


Kevin

Admin

posts 2503

2

Here's how to determine group membership for the currently logged user:

global $current_user;

if ( isset( $current_user->groups[$particular_group_id] ) ) {
   // html output for group member
}

About the Agapetry forum

Currently Online:

16 Guests

Maximum Online: 150

Forums:

Groups: 2

Forums: 7

Topics: 1245

Posts: 5653

Members:

There are 1255 members

There are 1 guests


Kevin has made 2503 posts

Top Posters:

metal450 - 178

Ragnar - 108

YikYak - 70

whiteorb - 49

Daisy - 35

Administrator: Kevin | Moderators: Kevin