latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Logged in or not logged in

Home Forums Community Forum Logged in or not logged in

This topic contains 3 replies, has 2 voices. Last updated by  Cristián Lávaque 4 years, 2 months ago.

Topic Author Topic
Posted: Monday Oct 15th, 2012 at 11:52 am #28444
cassel
Username: cassel

I am using some conditionals for ccaps, and so far, i always used something along the line of this:

[s2If is_user_logged_in() AND current_user_can(access_s2member_ccap_music)]

Now, i need to check for an OR condition and i get a message that i cannot have an AND and OR in the same conditional in a shortcode. I am wondering if i really need to have the is_user_logged_in() in the shortcode as i assume one cannot “have access” to a ccap if they are not logged in in the first place. Isn`t that redondant? Can i skip the logged_in part so i can have something like :

[s2If current_user_can(access_s2member_ccap_music) OR current_user_can(access_s2member_ccap_tutorial) ]

That would be simpler than having to use php if i can just use the shortcode (especially since the php vanishes if the wp page opens in the visual editor!)

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Tuesday Oct 16th, 2012 at 8:54 am #28520

Yes, that’s correct. Someone with the ccap would also be logged in. :)

Posted: Tuesday Oct 16th, 2012 at 10:53 am #28563
cassel
Username: cassel

Great! That will allow me to use one shortcode with the OR instead of having to rely on php! Thanks.

Posted: Wednesday Oct 17th, 2012 at 8:00 am #28664

Cool. :)

Viewing 3 replies - 1 through 3 (of 3 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.