0

I want to give admin access to a freelancer. One plugin named controlled admin access done most of the part for me, expect it don't have option to select or deselect subtools.

1 Answer 1

0

You may use the hook admin_menu() and function remove_submenu_page()

The solution assumed the following conditions

  • run it in theme functions.php, you may put somewhere else with different tweaking, but the following is proved to work in functions.php
  • you know how to test the user access level by yourself, because the following solution is focus on removing the submenu only
function q364011_remove_tools_menu() {
    // you may add your access rights checking logic here with conditions and then do the following

    remove_submenu_page( 'tools.php', 'export.php' );
    remove_submenu_page( 'tools.php', 'import.php' );
}
add_action( 'admin_menu', 'q364011_remove_tools_menu' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.