Page 1 of 1

User Custom Capabilities problem...

PostPosted: August 17th, 2011, 9:04 pm
by Jwrbloom
In the User's profile, it allows the Admin to set Custom Capabilities. I'm trying to input the following capability:

current_user_can("access_s2member_level2")


The data field is stripping the (" and "), as well as letting a Level 2 User see Level 4 material.


I'm using the latest update of WP and S2. Thanks.

Re: User Custom Capabilities problem...

PostPosted: August 17th, 2011, 9:23 pm
by Jwrbloom
Let me restate that. Just with the Custom Capability, it doesn't work.

Re: User Custom Capabilities problem...

PostPosted: August 17th, 2011, 9:25 pm
by Jwrbloom
I should also say I'm trying to set the Custom Capability directly in the Dashboard, not as a result of subscribing.

Re: User Custom Capabilities problem...

PostPosted: August 17th, 2011, 9:44 pm
by Bruce C
Custom capabilities don't work that way.

The code "access_s2member_level" is for conditionals. Custom capabilities are usually one-word. Like "videos".

Then, you use the current_user_can function like this:

Code: Select all
[s2If current_user_can(access_s2member_ccaps_videos)]
//post your videos here
[/s2If]
[s2If !current_user_can(access_s2member_ccaps_videos)]
// do nothing
[/s2If]


Or through Add Post/Post on the Wordpress Dashboard.

Re: User Custom Capabilities problem...

PostPosted: August 17th, 2011, 9:46 pm
by Bruce C
You can read more about this under

Dashboard -> s2Member -> API/Scripting -> Custom Capabilities(Packages)

and under

Dashboard -> s2Member -> API/Scripting -> Simple/Shortcode Conditionals

Re: User Custom Capabilities problem...

PostPosted: August 18th, 2011, 6:38 am
by Jwrbloom
Yeah, as I read those sections more I figured that out. I thought I could insert them in a User's profile. Then I saw the outstanding advice given there by S2, the plugin that allows the Admin to modify what each role does. Super, super, super.

I really love WordPress now...all over again. : )
I'm a sucker for easy role definition.

Re: User Custom Capabilities problem...

PostPosted: August 18th, 2011, 10:23 am
by Bruce C
:)