wordpress - Woocommerce shop manager role, hide woocommerce menu -


i using wordpress theme supports woocommerce, when adding user shop manager role don't want show woocommerce menu.

just need products menu only.

please help.

what need

you can use wordpress's 'remove_menus()' function this.

store managers have capability: 'manage_woocommerce'

you can see allowed see woocommerce admin menu here: '/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-menus.php'

look for: $main_page = add_menu_page( __( 'woocommerce', 'woocommerce' ), __( 'woocommerce', 'woocommerce' ), 'manage_woocommerce', 'woocommerce' , array( $this, 'settings_page' ), null, '55.5' );

so theory. stop admin menu item displaying administrator, add functions.php file or plugin:

add_action( 'admin_menu', 'remove_menus' ); function remove_menus(){      // if current user not admin     if ( !current_user_can('manage_options') ) {          remove_menu_page( 'woocommerce' ); // woocommerce admin menu slug      } } 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -