• Resolved Alexandra

    (@avsalexandra)


    How hide for shop manager on page /wp-admin/ top dashbord button “UpdraftPlus”

    function remove_add_menu_item_from_admin_bar() {
    if (current_user_can(‘shop_manager’)) {
    global $wp_admin_bar;
    $wp_admin_bar->remove_node(‘updraft_admin_node’);
    }
    }
    add_action(‘admin_bar_menu’, ‘remove_add_menu_item_from_admin_bar’, 100);

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support nrobertsudp

    (@nrobertsudp)

    Hi Alexandra,

    Apologies, I haven’t had time to test fully yet but this may be what you’re looking for.
    Please check out the guide linked below Step 2: Disable the node (alternate method)
    https://digwp.com/2016/06/remove-toolbar-items/

    I tested the function using another ‘current_user_can’ option and it worked for me.
    Let me know how you get on with this and I will look for alternatives if necessary.

    Best regards,

    Nick

    Thread Starter Alexandra

    (@avsalexandra)

    code does not work:

    function shapeSpace_remove_toolbar_node($wp_admin_bar) {
    $wp_admin_bar->remove_node(‘updraft_admin_node’);
    }
    add_action(‘admin_bar_menu’, ‘shapeSpace_remove_toolbar_node’, 999);

    Plugin Support nrobertsudp

    (@nrobertsudp)

    Hi Alexandra,

    That code is the first method, I specifically suggested Step 2: Disable the node (alternate method).
    The first method did not work for me either. Please base your code on the second method described.
    The second method uses the hook ‘wp_before_admin_bar_render’, not the ‘admin_bar_menu’ option.

    Best regards,

    Nick

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.