Created
May 6, 2016 15:21
-
-
Save walterebert/bac07e4e6370698f1eff4be9ab332e19 to your computer and use it in GitHub Desktop.
WordPress snippet: Hide posts from admin
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 | |
add_action( | |
'admin_menu', | |
function() { | |
/* Hide posts admin menu */ | |
remove_menu_page( 'edit.php' ); | |
} | |
); | |
add_action( 'wp_before_admin_bar_render', function() { | |
global $wp_admin_bar; | |
if ( $wp_admin_bar ) { | |
/* Hide new post from admin bar */ | |
$wp_admin_bar->remove_menu( 'new-post' ); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment