• Resolved miikewordpress

    (@miikewordpress)


    Hi,

    First of all, thanks for the great plugin!

    I have 2 issues that I would like to ask for some help.

    1. I cannot hide below menu items under WooCommerce menu.
    ———
    Reports
    Settings
    ———
    Settings menu is especially sensitive for some users to have access.
    I found their slugs which are
    wc-reports and wc-settings
    I added these two on the right hand side field under Menu Options and did check the boxes. But they won’t hide. These sub menu items don’t have classes or ID either.

    2. Completely deactivating a menu. I found that when I check menu option boxes, when I try to access that menu using URL there will be an error “Cheatin’ uh? Sorry, you are not allowed to access this site.”.

    But there are some menus that I disabled with custom option such as
    vc-welcome slug for WPBakery Page Builder.
    The WPBakery menu is hidden but I can actually access it using URL /wp-admin/admin.php?page=vc-welcome.
    Is there any way to completely prohibit going to that menu using URL?

    Thank you very much,

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Frank Bueltge

    (@bueltge)

    for 1.
    Have you find the right slugs? If the users with the role, there you will hide, is active, logged in, then you should use the debug helper function of Adminmize to find the slug inside the console of the browser.
    If this is different to the settings page as Admin, please add this as custom option.

    for 2.
    hard, not easier via a plugin that should run for all, different users. With custom code, yes, but with Adminimize is it hard.

    Thread Starter miikewordpress

    (@miikewordpress)

    Thanks for your answer!

    1) I found that the slugs are the same for every role.

    The code looks like this.
    <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>WooCommerce</li><li class="wp-first-item current"><a href='edit.php?post_type=shop_order' class="wp-first-item current" aria-current="page">Orders <span class="awaiting-mod update-plugins count-5"><span class="processing-count">5</span></span></a></li><li><a href='admin.php?page=network-orders'>Network Orders</a></li><li><a href='admin.php?page=wc-order-export'>Export Orders</a></li><li><a href='admin.php?page=wc-product-subtitle-settings'>WooCommerce Product Subtitle</a></li><li><a href='admin.php?page=wpo_wclabels_options_page'>Address Labels</a></li><li><a href='admin.php?page=wc-reports'>Reports</a></li><li><a href='admin.php?page=wc-settings'>Settings</a></li><li><a href='admin.php?page=wc-status'>Status</a></li><li><a href='admin.php?page=wc-addons'>Extensions </a></li></ul></li>

    So the menus that I wanted to disable were wc-reports and wc-settings
    but I could not achieve this by adding them to the custom options.

    Do you have any suggestions?

    Thank you!

    Plugin Author Frank Bueltge

    (@bueltge)

    You must add the Slug, like wc-reports, and a Name for the item to the custom option, not more. Each item in each line of the textarea of the custom option.
    See also the examples of the Wiki page – https://github.com/bueltge/Adminimize/wiki

    In your context:

    * Left field: WC Reports Menu Item
    * Right field: wc-reports

    Thread Starter miikewordpress

    (@miikewordpress)

    Yes, I did use those exact slugs as I mentioned in the original post.

    Left Right
    WC Reports wc-reports
    WC Settings wc-settings

    But they don’t work.
    Does it work with your WooCommerce installation if you have one?

    Plugin Author Frank Bueltge

    (@bueltge)

    So, Now I have it tested again, it works without custom rules. In my example I removed the Reports, Settings Menu items on the Shop Manager role. This role have my shop user, there have no Admin settings in the WP context, default roles.

    see also this screenshot of settings and result.
    https://diigo.com/0b9j3h

    Thread Starter miikewordpress

    (@miikewordpress)

    Hello Frank,

    I tried with Shop Manager role then it worked. I was using a custom role that was created by Members plugin in the past. Maybe that role was a bit buggy.
    I’m really sorry for the trouble and thank you very much for your kind answers!

    Plugin Author Frank Bueltge

    (@bueltge)

    No sorry, not problem. It should also work with custom roles, maybe you should create a new one, and test it again.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Not hiding WooCommerce menu items’ is closed to new replies.