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.

Custom Capabilities as OR?

Home Forums Community Forum Custom Capabilities as OR?

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

Topic Author Topic
Posted: Monday Jun 11th, 2012 at 4:01 pm #16153

I want to use Custom Capabilities (CCs) to protect a WP page.

My understanding of how CCs work is that when you list them in the CCs box on a WP page,
a visiting member must have ALL of the CCs in order to view the page. So, in the image
above, the visiting user must have both the “bigfun” and “dancecard” CCs in order to
access the page.

My question: is there any way to have an “OR” situation with CCs? So, if the user
has any of the listed CCs, they get access (instead of the default of having to have ALL the CCs listed)?

Jason (sitting in for Tuhin)

List Of Topic Replies

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Tuesday Jun 12th, 2012 at 7:30 am #16231

Hi Jason.

You can do it, but not from there. You’d need to use conditionals in the body of the post/page. [hilite path]Dashboard -› s2Member® -› API / Scripting -› Simple/Shortcode Conditionals[/hilite]

I hope that helps. :)

Posted: Tuesday Jun 12th, 2012 at 12:55 pm #16270

Thanks. Yes, I’m aware of that. I was hoping that I could do it (much more elegantly) from the box in the image abvoe. Maybe instead of putting “bigfun,dancecard” I could put “bigfun|dancecard” to mean “bigfun” OR “dancecard”.

Oh well.

J

Posted: Wednesday Jun 13th, 2012 at 7:25 pm #16406

Ah, got ya. No, the box for now just does AND.

I’ll check with Jason if there’s a way to hack this.

Posted: Friday Jun 15th, 2012 at 8:12 pm #16628

Just heard back from Jason:

No, there’s no hack for this, because it has a far reaching impact on other areas of the code, including alternative views. The only way to accomplish an OR logic for ccaps, is to implement your own conditionals.

Viewing 4 replies - 1 through 4 (of 4 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.