Problem: I would like to create a conditional that tests whether or not the current logged-in User has a specific capability.
Solution: Use the built-in WordPress function current_user_can to check for any individual capability. You must register current_user_can in Toolset > Settings > Front-end Content > Functions inside conditional evaluations, then you can do something like this:
[wpv-conditional if="(current_user_can('access_s2member_ccap_4792') eq 1)"] current user has capability access_s2member_ccap_4792 [/wpv-conditional] [wpv-conditional if="(current_user_can('access_s2member_ccap_4792') ne 1)"] current user does not have capability access_s2member_ccap_4792 [/wpv-conditional]
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
|8:00 – 12:00||8:00 – 12:00||8:00 – 12:00||8:00 – 12:00||8:00 – 12:00||-||-|
|13:00 – 17:00||13:00 – 17:00||13:00 – 17:00||13:00 – 17:00||13:00 – 17:00||-||-|
Supporter timezone: America/New_York (GMT-04:00)