• After we updated to UM 2.0.11, we found that the UM shortcodes that restrict content viewability by user role no longer work. (However, UM content restriction on pages and in menus does seem to work.) For example, the text in the <div> below is no longer shown to our users who have the role “educator”:

    [um_show_content roles='educator']
    Hello educator!
    [/um_show_content]

    I’ve tested with new roles, new users, new code… nothing works. The documentation I found on the UM site is unhelpful. I’ve already emailed UM about this, but given how many people I see in this forum with other issues regarding the update, I worry it will be a while until I hear from them — so I’m hoping someone here can help. Thanks!

    -Daniel

    • This topic was modified 6 years, 7 months ago by Daniel Lerch.
    • This topic was modified 6 years, 7 months ago by Daniel Lerch.
Viewing 6 replies - 1 through 6 (of 6 total)
  • This sounds similar to my issue which I posted a couple of days ago.

    No help so far.

    I’ll let you know if someone finds a solution.

    Thread Starter Daniel Lerch

    (@daniellerch)

    Update:
    1.) I forgot to mention that these shortcodes don’t seem to work in widgets either.
    2.) I think the answer to my problem lies in this documentation on the new User Roles logic and organization — https://docs.ultimatemember.com/article/1328-new-roles-logic — but I’m sorry to say, it is so poorly written that I can’t really understand much of it. I hope UM can get it ‘translated’ and rewritten by someone who has a better command of English.

    • This reply was modified 6 years, 7 months ago by Daniel Lerch.
    Thread Starter Daniel Lerch

    (@daniellerch)

    I found the solution! It is surprisingly, maddeningly simple: It appears that in the shortcodes, UM now recognizes the “Role ID”, but not the “Role Title” — so this needs to be changed in your shortcodes.

    In my case, I had a custom role called “Educator”, and previously I used this shortcode:

    [um_show_content roles='educator']

    In troubleshooting the problem today I noticed that in Ultimate Member > User Roles the Role ID for this role is “um_educator”. (I do not know if this was added on with the update or if it’s always been like this; I never had to deal with the Role ID before.) So I tried changing the shortcode to this, thinking how ridiculous it would be if that was the problem:

    [um_show_content roles='um_educator']

    It worked!

    Weirdly, in the Menus, under “Ultimate Member Menu Settings”, if you restrict the menu to Logged In users, the options it shows you are of the Role Titles (e.g., “educator”), not Role IDs (e.g., “um_educator”). If I come across any other weirdness I’ll post it here.

    Parting thoughts:
    1.) Why on earth did UM make this major change without announcing it somehow?
    2.) Why on earth is this change not reflected in the current documentation? (https://docs.ultimatemember.com/collection/263-20-documentation)

    Our website (where we sell registrations to an online course we offer) was partially unusable for nearly a week until I figured this issue out on my own — again, no thanks to UM Support. I’d hoped to use UM for content control as we expand the site, but after this experience…no thanks.

    Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Thread Starter Daniel Lerch

    (@daniellerch)

    Thank you for finally creating that documentation. Please don’t make such a big, disruptive change without notice or documentation in the future; this really had a big impact on our site, and took up probably six hours of my time in troubleshooting and creating a temporary workaround. Not cool.

    Here’s some incorrect documentation that still exists on the UM site regarding content restriction:

    https://docs.ultimatemember.com/article/226-restrict-content-on-a-page-post-to-specific-users-community-role

    This is still incorrect – it would be great for UM to change this documentation to reflect the appropriate use of shortcodes here:
    https://docs.ultimatemember.com/article/1334-umshowcontent-shortcode

    This would have saved me a lot of time.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘shortcodes to restrict content by user role no longer work’ is closed to new replies.