1

I want to remove a menu sub-item. But i cant'find the right item to delete. It is a plug caled "New User Approve". And the slug is :/wp-admin/users.php?page=new-user-approve-admin

I don't want to disable the plugin and the functions, just the sub-menu item.

I don't come further than:

 add_action( 'admin_menu', 'remove_admin_menus' ); 

add_action( 'admin_menu', 'remove_admin_submenus' );

//Remove top level admin menus function remove_admin_menus() {

}

//Remove sub level admin menus function remove_admin_submenus() { remove_submenu_page( 'users.php', 'users.php?page=new-user-approve-admin' );

}

or

function remove_submenu() { remove_submenu_page( 'users.php', 'users.php?page=new-user-approve-admin' ); 

}

add_action( 'admin_menu', 'remove_submenu', 999 );

2 Answers 2

-1

You'd want to add this code:

add_action( 'admin_menu', 'remove_admin_menus', 999 ); function remove_admin_menus() { remove_submenu_page( 'users.php', 'new-user-approve-admin' ); } 
0
0

This one will work for sure, tested it, add the code into the "functions.php" file from the main or child theme folder (or plugin, in case you are using it in a plugin):

add_action( 'admin_menu', 'custom_remove_admin_submenus', 999 ); function custom_remove_admin_submenus() { remove_submenu_page( 'users.php', 'new-user-approve-admin' ); }
1
  • This one works also! Thanks!!! I want to give you a oke also, but that is not possible. joetek was the first so... But thanks again! Commented Apr 13, 2017 at 18:15

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.