PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

User Custom Capabilities problem...

s2Member Plugin. A Membership plugin for WordPress®.

User Custom Capabilities problem...

Postby Jwrbloom » August 17th, 2011, 9:04 pm

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.
User avatar
Jwrbloom
Registered User
Registered User
 
Posts: 55
Joined: May 23, 2010

Re: User Custom Capabilities problem...

Postby Jwrbloom » August 17th, 2011, 9:23 pm

Let me restate that. Just with the Custom Capability, it doesn't work.
User avatar
Jwrbloom
Registered User
Registered User
 
Posts: 55
Joined: May 23, 2010

Re: User Custom Capabilities problem...

Postby Jwrbloom » August 17th, 2011, 9:25 pm

I should also say I'm trying to set the Custom Capability directly in the Dashboard, not as a result of subscribing.
User avatar
Jwrbloom
Registered User
Registered User
 
Posts: 55
Joined: May 23, 2010

Re: User Custom Capabilities problem...

Postby Bruce C » August 17th, 2011, 9:44 pm

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.
Last edited by Bruce C on August 18th, 2011, 10:23 am, edited 1 time in total.
~Bruce ( a.k.a. Ace )

If you're interested in a Professional Installation, or Custom Coding Job, you can send your request here.

Proud Supporter of:
The Zeitgeist Movement
and Occupy Everything
User avatar
Bruce C
Experienced User
Experienced User
 
Posts: 337
Joined: July 20, 2011

Re: User Custom Capabilities problem...

Postby Bruce C » August 17th, 2011, 9:46 pm

You can read more about this under

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

and under

Dashboard -> s2Member -> API/Scripting -> Simple/Shortcode Conditionals
~Bruce ( a.k.a. Ace )

If you're interested in a Professional Installation, or Custom Coding Job, you can send your request here.

Proud Supporter of:
The Zeitgeist Movement
and Occupy Everything
User avatar
Bruce C
Experienced User
Experienced User
 
Posts: 337
Joined: July 20, 2011

Re: User Custom Capabilities problem...

Postby Jwrbloom » August 18th, 2011, 6:38 am

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.
User avatar
Jwrbloom
Registered User
Registered User
 
Posts: 55
Joined: May 23, 2010

Re: User Custom Capabilities problem...

Postby Bruce C » August 18th, 2011, 10:23 am

:)
~Bruce ( a.k.a. Ace )

If you're interested in a Professional Installation, or Custom Coding Job, you can send your request here.

Proud Supporter of:
The Zeitgeist Movement
and Occupy Everything
User avatar
Bruce C
Experienced User
Experienced User
 
Posts: 337
Joined: July 20, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 0 guests

cron