Title: more usage examples?
Last modified: September 1, 2016

---

# more usage examples?

 *  [jeffnye](https://wordpress.org/support/users/jeffnye/)
 * (@jeffnye)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/more-usage-examples/)
 * Hi – Wondering if there are any more usage examples anywhere?
 * Like how to add other roles to this example besides administrator? (like making
   it conditional for administrators and editors)
 * in_array(‘administrator’, $GLOBALS[‘current_user’]->roles)
 * Thanks!
 * [https://wordpress.org/plugins/nav-menu-roles/](https://wordpress.org/plugins/nav-menu-roles/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [HelgaTheViking](https://wordpress.org/support/users/helgatheviking/)
 * (@helgatheviking)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/more-usage-examples/#post-7486619)
 * 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](https://wordpress.org/support/users/jeffnye/)
 * (@jeffnye)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/more-usage-examples/#post-7486688)
 * 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](https://wordpress.org/support/users/helgatheviking/)
 * (@helgatheviking)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/more-usage-examples/#post-7486722)
 * 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](https://github.com/helgatheviking/nav-menu-roles-woocommerce-memberships)
 * It shows an example of custom roles and WooCommerce Memberships-specific conditions.
 *  Thread Starter [jeffnye](https://wordpress.org/support/users/jeffnye/)
 * (@jeffnye)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/more-usage-examples/#post-7486859)
 * 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](https://wordpress.org/support/users/helgatheviking/)
 * (@helgatheviking)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/more-usage-examples/#post-7486864)
 * 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.

 * ![](https://ps.w.org/nav-menu-roles/assets/icon-256x256.png?rev=2336319)
 * [Nav Menu Roles](https://wordpress.org/plugins/nav-menu-roles/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nav-menu-roles/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nav-menu-roles/)
 * [Active Topics](https://wordpress.org/support/plugin/nav-menu-roles/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nav-menu-roles/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nav-menu-roles/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [HelgaTheViking](https://wordpress.org/support/users/helgatheviking/)
 * Last activity: [9 years, 12 months ago](https://wordpress.org/support/topic/more-usage-examples/#post-7486864)
 * Status: not resolved