Check user permissions before manipulating submenu (https://github.com/woocommerce/woocommerce-admin/pull/106)

This commit is contained in:
Kelly Dwan 2018-06-08 13:11:24 -04:00 committed by GitHub
parent 29136ce44c
commit aabd74b15d
1 changed files with 4 additions and 0 deletions

View File

@ -59,6 +59,10 @@ add_action( 'admin_menu', 'woo_dash_register_pages' );
*/
function woo_dash_link_structure() {
global $submenu;
// User does not have capabilites to see the submenu
if ( ! current_user_can( 'manage_woocommerce' ) ) {
return;
}
$woodash_key = null;
foreach ( $submenu['woocommerce'] as $submenu_key => $submenu_item ) {