Community Support Forums — WordPress® ( Users Helping Users ) — 2011-09-26T01:47:10-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=15180 2011-09-26T01:47:10-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15180&p=39183#p39183 <![CDATA[Re: Custom Capabilities not working?]]>

Let us know if you have more questions.

Statistics: Posted by Cristián Lávaque — September 26th, 2011, 1:47 am


]]>
2011-09-17T12:25:33-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15180&p=37373#p37373 <![CDATA[Re: Custom Capabilities not working?]]> I answered my own question.

As it turns out Admin users have access to view everything on the page regardless of custom restrictions. >.< doh!

Statistics: Posted by kiwis — September 17th, 2011, 12:25 pm


]]>
2011-09-17T11:11:24-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15180&p=37372#p37372 <![CDATA[Custom Capabilities not working?]]>
Problem:
All of the custom capabilities on the site is all of a sudden broken/not firing.

Symptoms:
Standard capabilities check is still working. ie.
Code:
<?php if (current_user_can("access_s2member_level1")){ ?>
if level 1... stuff...
<?php } ?>


Any of the custom capabilities are not working i.e. I have a user set up with level 1 and custom capabilities 10white. with the code below:
Code:
<?php if (current_user_can("access_s2member_level1")){ ?>
<?php if (current_user_can("access_s2member_ccap_10white")){ ?>
user can access 10 white labels.. display some stuff.
<?php } ?>
<?php if (current_user_can("access_s2member_ccap_01red")){ ?>
user can access 1 red labels.. display some stuff.
<?php } ?>
<?php } else { ?>
No access to page at all
<?php } ?>


When the user loads the page this is what shows:
Code:
user can access 10 white labels.. display some stuff.
user can access 1 red labels.. display some stuff.


So basically the check for s2Member level 1 passes.. but somehow both capabilities are returning true. I've even just done a simple return statement to check this and yes, both IF statements are returning true. I've checked that the test user is only set up with CC 10white. In fact, if I remove all of the user's CC, the page returns the same thing.

What could possibly be wrong? Any hints/thoughts would be great! Thanks!

Statistics: Posted by kiwis — September 17th, 2011, 11:11 am


]]>