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.

More custom capabilities in one if status

Home Forums Community Forum More custom capabilities in one if status

This topic contains 1 reply, has 2 voices. Last updated by  Jason (Lead Developer) 3 years, 11 months ago.

Topic Author Topic
Posted: Tuesday Jan 29th, 2013 at 2:48 pm #39923

I want to use more then one custom capability in a if status. The code I am using at the moment is:

Content..

It works fine but I want to add another custom capability (y) with a or status. So the viewer needs capability X or Y to view the content but not both.. On the forum someone stated the || is a or status but it doenst work in my case if I put the code in like this:

Content..

Can someone help me to solve this elkse my posts will be very huge and time consuming to edit since I have alot of capabilities on the same level.

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Thursday Jan 31st, 2013 at 8:56 am #40125
Staff Member

Thanks for your inquiry. ~ We appreciate your patience :-)

Example of a PHP conditional with OR logic.

<?php
if(current_user_can('access_s2member_ccap_music') || current_user_can('access_s2member_ccap_videos'))
	{
		// Yes, they can access one or both of these.
	}
?>
Viewing 1 replies (of 1 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.