Resources

My Agape try

Your Agape try


Support Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




Access restriction checking in role scoper

UserPost

10:37 am
February 7, 2011


Janis

Member

posts 2

1

Hello.

I would like to know, how can I check, if category is accessible for current user. 

I tried this solution, but in this way I can get only the restrictions for categories. And I can not check if the category is really allowed or not, because in my current configuration I have 'rs_page_reader' and 'rs_post_reader' role set for all users. So this means that I can only see to what role these categories are disabled.

I would like to ask, how can I check if the $current_user is allowed to view the category.


Thanks, Janis.

3:52 pm
February 8, 2011


Kevin

Admin

posts 2502

2

Try this:

$cat_ids = get_terms( 'category', array( 'fields' => 'ids' ) );

…then check the return array for your category of concern.


About the Agapetry forum

Currently Online:

12 Guests

Maximum Online: 150

Forums:

Groups: 2

Forums: 7

Topics: 1244

Posts: 5649

Members:

There are 1254 members

There are 1 guests


Kevin has made 2502 posts

Top Posters:

metal450 - 178

Ragnar - 108

YikYak - 70

whiteorb - 49

Daisy - 35

Administrator: Kevin | Moderators: Kevin