WordPress.org

Forums

Custom Content Shortcode
[resolved] Request: If Role - extend if login to support user role? (3 posts)

  1. Agent8
    Member
    Posted 8 months ago #

    Hi,

    Great plugin. I'm using the if login function to great effect. But it would be even more useful if it were possible to target different user roles.

    As at the moment I have two different site member roles and want to serve them up different content.

    Thanks,
    Nick.

    https://wordpress.org/plugins/custom-content-shortcode/

  2. Eliot Akira
    Member
    Plugin Author

    Posted 8 months ago #

    Hello,

    Thank you for the feedback. Sure, targeting user roles sounds useful - I'll look into adding that feature. I'm a bit busy until next week, so the next update might take some days.

    I'll let you know on this thread when I get it implemented.

  3. Eliot Akira
    Member
    Plugin Author

    Posted 8 months ago #

    In the latest update, I added role and capable parameters to the [is] shortcode. Please refer to the documentation under Settings -> Custom Content -> User, for details on the new parameters.

    To check if a user has a role:

    [is role="editor"]
        You are an editor.
    [/is]

    For ease of use, I added a listing of available user roles and capabilities in the Content Overview page, under Dashboard -> Content.

    Let me know if that works for your purpose!

Reply

You must log in to post.

About this Plugin

About this Topic