Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author HelgaTheViking

    (@helgatheviking)

    I’m sorry, I don’t understand your question. What is your use case? The example for creating a “custom” role in the FAQ can cover almost every complex use case. Please note that if something is conditionally visible for an editor, it will also be visible for an admin as an admin has the same capabilities as an editor.

    Thread Starter jeffnye

    (@jeffnye)

    Thanks.

    I understand that some roles may include others. But if I want to target a menu as visible only to two different user roles that do not encompass the other, how do I do that?

    I know this is more than you want to answer, but maybe you can point us in the right direction…

    For example, how do I make the menu visible to:

    – “subscribers” and users with role called “teachers”
    – all users logged in on Wednesday
    – all users with role called “teachers” on Wednesday
    – all users with access to a certain course (if the site sells courses, say with LearnDash plugin)
    – all users who have purchased product X with WooCommerce

    You see the lay user doesn’t know how to join two conditions, or add multiple roles in one statement.

    In general, the only examples I see of what to put in the “Visibility” field are the three in the “Description” tab of the plugin. You mention that any crazy PHP or WordPress functions can be used, but it would be great if there were a few more simple examples that folk who are not as knowledgeable on PHP or WordPress functions can use.

    I’d imagine that you have seen some interesting uses and could give a few more examples, or provide a link to reference some ideas…

    Plugin Author HelgaTheViking

    (@helgatheviking)

    Multiple roles can just be added via the current UI… by checking the related checkboxes (shown under “Logged In”). You don’t need anything custom for that.

    NMR allows you to write your own custom roles and conditions, but it’s up to you to write the advanced logic. I can’t get in to writing custom code for every user who needs it. I am open to freelance work however.

    Here’s an example of some work I did to bridge NMR with WooCommerce Memberships

    It shows an example of custom roles and WooCommerce Memberships-specific conditions.

    Thread Starter jeffnye

    (@jeffnye)

    Thanks.

    I realized that the options to select different roles don’t appear until after you click on “Logged In Users”. So until you know that, you don’t know how to choose which user.

    I also realized I am used to another similar plugin, “Menu Items Visibility Control”. I may have been confusing the two.

    With regard to the WOoCommerce example you gave, is that ready to be a plugin? I’m not familiar with plugin development or GitHub, so it’s not obvious to me what to do with your example or if I’m supposed to be able to use it, though I understand you can be hired for special requests.

    Thanks!

    Plugin Author HelgaTheViking

    (@helgatheviking)

    I’m open to suggestions as to how to make that more clear.

    Yes, the bridge plugin is a fully formed plugin. Any plugins from git can be downloaded by clicking the green “clone or download” button and then clicking “download ZIP”. Then you have the zip file same as if you downloaded a plugin from WordPress.org. However, it’s just an example and isn’t going to be much good to you unless you are also using WooCommerce Memberships and need to restrict menu items based on their custom membership levels.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘more usage examples?’ is closed to new replies.