Last active
August 29, 2015 14:26
-
-
Save bepatrickdavid/1ac11f9ed6f4fc655845 to your computer and use it in GitHub Desktop.
WP: Nascondere menu admin a un certo ruolo hidden menu admin for user role
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
add_action( 'admin_init', 'my_remove_menu_pages' ); | |
function my_remove_menu_pages() { | |
global $user_ID; | |
if ( current_user_can( 'editor' ) ) { | |
remove_menu_page( 'edit.php' ); | |
remove_menu_page( 'edit-comments.php' ); | |
remove_menu_page( 'edit.php?post_type=home_services' ); | |
remove_menu_page( 'edit.php?post_type=modulistiche' ); | |
remove_menu_page( 'edit.php?post_type=applicazioni' ); | |
remove_menu_page( 'tools.php' ); | |
remove_menu_page( 'edit.php?post_type=istruzioni' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment