Conditional / Dynamic text insertion

Members 4 posts 2 voices

  1. I’m building a website that utilizes the Members plugin to classify users on the site.

    I need to conditionally include text in a page or post using a shortcode or something like a shortcode.

    The result would be something like this:
    If userRole = Cat, then insert text: “Chase the mouse”,
    elseif userRole=Dog, then insert text: “Chase the cat”

    What would be the best way to do that?

    Thank you in advance!

  2. You could use the [members_access] shortcode.

    Something like this:

    [members_access role="cat"]Chase the mouse.[/members_access]
    [members_access role="dog"]Chage the dog.[/members_access]
  3. Thank you!

    For some reason, I didn’t find a list of shortcodes in the docs, so this is very valuable help.