Page 1 of 1

Access API scripting variable from script

PostPosted: November 27th, 2011, 2:26 pm
by blewis
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

Re: Access API scripting variable from script

PostPosted: November 27th, 2011, 7:37 pm
by Cristián Lávaque
Hi Bryan. Maybe this tip helps you with that: viewtopic.php?f=4&t=3145&p=9683#p9683 :)

Re: Access API scripting variable from script

PostPosted: November 27th, 2011, 8:02 pm
by blewis
Thanks. That is just what I needed. Worked like a charm.

Re: Access API scripting variable from script

PostPosted: November 28th, 2011, 11:04 pm
by Cristián Lávaque
Great. :)