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.

Shortcode for Custom Capabilities

Home Forums Community Forum Shortcode for Custom Capabilities

This topic contains 1 reply, has 2 voices. Last updated by  Eduan 3 years, 6 months ago.

Topic Author Topic
Posted: Friday Jul 5th, 2013 at 5:55 pm #53060
Andrew Lian
Username: mlapl1

Hello – another newbie question:

I found a 2012 answer to my question in the forum but wonder if things have not changed since then. Here is my question.

Is there a shortcode (or ready-made php code) to check whether a member has *any* custom capability associated with them?

For some reason, I thought I found such a shortcode in the documentation but cannot seem to find it now.

Thank you

Andrew

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Sunday Jul 7th, 2013 at 7:37 pm #53095
Eduan
Username: Eduan
Moderator

Hello Andrew,

Currently there’s no way to check this AFAIK.

I came up with a quick work-around though. Every time you add ccaps (short for custom capabilities) to users always add the same ccap, for example in every button include a ccap ccap.

Then you just need to check if the user has that ccap in order to know if the has any ccaps at all. :)

For example:

[s2If current_user_can(access_s2member_ccap_ccap)]
    Made sure the user has the must-have ccap in order to know if he has any custom capabilities at all. :)
[/s2If]

– Eduan

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.