[memb_has_any_role]

This Applies to

Summary

This is a conditional shortcode to control access to portions of a post or page based on the logged-in user’s WordPress role.

Shortcode Examples

Show content to the user with subscriber role.

[memb_has_any_role roles="subscriber"]
Show this to your subscribers
[/memb_has_any_role]
[memb_has_any_role roles="subscriber"]
Show this to your subscribers
[else_memb_has_any_role]
Show this content to non-subscriber users
[/memb_has_any_role]

Shortcode Parameters​

roles: A comma separated list of WordPress user roles to check the user’s roles against.

except_roles: A comma separated list of WordPress user roles that the current user must not be one of in order for the test to succeed.

not: You can use the attribute not=”not”, to reverse the results of the test.

txtfmt: A comma separated list of text processing functions to be used to post process the contact fields. (?)

capture: Capture the output of the shortcode and route it to a variable for later use. (?)

Shortcode Attributes

Conditional: Yes (?)
Nestable: Yes (?)
Accepts formatting: Yes (?)
Capturable: Yes (?)

  • Was this Helpful?
  • YesNo
“Secret

[memb_has_any_role]

This Applies To

Book a Call

Welcome to Memberium!

We are very excited for you to be part of our family. 

We would love to answer any questions that you have!

Please choose the best time for you to get in a call with us. 

For Technical Support, you can contact us at https://keap.memberium.com/support/ or Email us at support@memberium.com.