Created
November 26, 2016 11:51
-
-
Save max-kk/5da7d152434796e33a3e8de643491283 to your computer and use it in GitHub Desktop.
Wordpress :: remove admin pages for non admin's
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function remove_menu_pages_424398() { | |
| if ( defined( 'DOING_AJAX' ) ) | |
| { | |
| return; | |
| } | |
| if ( !current_user_can( 'manage_options' ) ) { | |
| remove_menu_page('link-manager.php'); // Links | |
| remove_menu_page('edit-comments.php'); // Comments | |
| remove_menu_page('plugins.php'); // Plugins | |
| remove_menu_page('themes.php'); // Appearance | |
| remove_menu_page('users.php'); // Users | |
| remove_menu_page('tools.php'); // Tools | |
| remove_menu_page('options-general.php'); // Settings | |
| } | |
| } | |
| add_action( 'admin_init', 'remove_menu_pages_424398' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment