Community Support Forums — WordPress® ( Users Helping Users ) — 2011-07-02T02:50:22-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=10352 2011-07-02T02:50:22-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10352&p=22088#p22088 <![CDATA[Re: Admin Custom Capabilities]]>
Have a nice Holiday

Sam

Statistics: Posted by drbyte — July 2nd, 2011, 2:50 am


]]>
2011-07-02T02:33:47-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10352&p=22085#p22085 <![CDATA[Re: Admin Custom Capabilities]]> current_user_can check will work with the incremental access.

In your code above, a Level 2 user would only be true for the current_user_is("s2member_level2") condition, while he'd be true for these current_user_can ones:

current_user_can('access_s2member_level2')
current_user_can('access_s2member_level1')
current_user_can('access_s2member_level0')


Does that help?

Statistics: Posted by Cristián Lávaque — July 2nd, 2011, 2:33 am


]]>
2011-07-02T02:18:15-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10352&p=22082#p22082 <![CDATA[Re: Admin Custom Capabilities]]>
Code:
<?php if (current_user_is("s2member_level4")){ ?>
<?php } else if (current_user_is("s2member_level3")){ ?>
<?php } else if (current_user_is("s2member_level2")){ ?>
<?php } else if (current_user_is("s2member_level1")){ ?>
<?php } else if (current_user_is("s2member_level0")){ ?>
<?php } else { ?>
<?php } ?>


What would be the correct statement with the current_user_can Cris?

I can't seem to put it together....

Thanks

Statistics: Posted by drbyte — July 2nd, 2011, 2:18 am


]]>
2011-07-02T02:13:31-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10352&p=22081#p22081 <![CDATA[Re: Admin Custom Capabilities]]> Statistics: Posted by Cristián Lávaque — July 2nd, 2011, 2:13 am


]]>
2011-07-02T01:56:50-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10352&p=22079#p22079 <![CDATA[Re: Admin Custom Capabilities]]>
This works

Code:
[s2If current_user_can(access_s2member_level1)]
    Some content for Members who are logged in with an s2Member Level >= 1.
[/s2If]

[s2If !current_user_can(access_s2member_level1)]
    Some public content.
[/s2If]


This does not work

Code:
<?php if (current_user_can("access_s2member_level1")){ ?>
    Some content for Members who are logged in with an s2Member Level >= 1.
<?php } else { ?>
    Some public content.
<?php } ?>

Statistics: Posted by drbyte — July 2nd, 2011, 1:56 am


]]>
2011-07-02T01:53:32-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10352&p=22078#p22078 <![CDATA[Re: Admin Custom Capabilities]]>
yes I did test it on a demo site. Nothing shows up when admin is logged in. Interesting!

Sam

Statistics: Posted by drbyte — July 2nd, 2011, 1:53 am


]]>
2011-07-02T01:42:21-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10352&p=22074#p22074 <![CDATA[Re: Admin Custom Capabilities]]>
Could you test with a clean installation of WordPress and s2Member to check how this works for you there?

Statistics: Posted by Cristián Lávaque — July 2nd, 2011, 1:42 am


]]>
2011-07-01T23:11:37-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10352&p=22069#p22069 <![CDATA[Re: Admin Custom Capabilities]]>
The admin can't view any level using this:

Code:
<?php if (current_user_can("access_s2member_level1")){ ?>
    Some content for Members who are logged in with an s2Member Level >= 1.
<?php } else { ?>
    Some public content.
<?php } ?>


Now if it's set to this, no problem

Code:
<?php if(is_user_logged_in()){ ?>
    Content for anyone that is logged in, regardless of their Membership Level.
<?php } else { ?>
    Some public content.
<?php } ?>


If you change it using current_user_can still no admin access to different levels beside level 0

I know I am missing something in here...

* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 & 3.
* A Member with Level 3 access, will also be able to access Levels 0, 1 & 2.
* A Member with Level 2 access, will also be able to access Levels 0 & 1.
* A Member with Level 1 access, will also be able to access Level 0.
* A Subscriber with Level 0 access, will ONLY be able to access Level 0.
* A public Visitor will have NO access to protected content.

Now, Level 4 role is basically higher than the administrator role when viewing restricted contents because the admin is not a level.

Would you please show how can we rewrite the code above for them to have access to different levels. Or if you have steps of doing so will be great. Thank you Cris

Would something like this work

Code:
global $current_user;
get_currentuserinfo();
If($current_user->user_login != ‘admin‘)

Statistics: Posted by drbyte — July 1st, 2011, 11:11 pm


]]>
2011-07-01T20:16:44-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10352&p=22054#p22054 <![CDATA[Re: Admin Custom Capabilities]]>
Admin is not other levels, you have to use current_user_can to check the capability instead of the role.

I hope that helps. :)

Statistics: Posted by Cristián Lávaque — July 1st, 2011, 8:16 pm


]]>
2011-07-01T08:07:25-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10352&p=22028#p22028 <![CDATA[Admin Custom Capabilities]]>
Not sure why the admin Custom Capabilities not responding....I tried all of them without any luck...ccaps, levels ..nothing works. They have the latest WP, S2m Free

admin not showing current_user_is for all 4 levels. When WP going to allow S.Admin for single WP Installation?!!

Thanks

Sam

Have a super nice 4th Guys...Stay Safe

Statistics: Posted by drbyte — July 1st, 2011, 8:07 am


]]>