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™

Access API scripting variable from script

s2Member Plugin. A Membership plugin for WordPress®.

Access API scripting variable from script

Postby blewis » November 27th, 2011, 2:26 pm

Ok, so I did a bit of searching, but some of the API stuff is not totally clear to me. I wrote a custom php script and I need to access the API call "current_user_can("access_s2member_level1")" to check to see if the user can actually do what this script does (it's limited to level 1 members).

Obviously calling current_user_can("access_s2member_level1") directly in the file does nothing but throw an error. Is there a simple way to pull that information into my script so I can do this one simple conditional?

Thanks,
Bryan
User avatar
blewis
Registered User
Registered User
 
Posts: 19
Joined: June 25, 2011

Re: Access API scripting variable from script

Postby Cristián Lávaque » November 27th, 2011, 7:37 pm

Hi Bryan. Maybe this tip helps you with that: viewtopic.php?f=4&t=3145&p=9683#p9683 :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Access API scripting variable from script

Postby blewis » November 27th, 2011, 8:02 pm

Thanks. That is just what I needed. Worked like a charm.
User avatar
blewis
Registered User
Registered User
 
Posts: 19
Joined: June 25, 2011

Re: Access API scripting variable from script

Postby Cristián Lávaque » November 28th, 2011, 11:04 pm

Great. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 1 guest

cron