Remove Posts Post Type From Admin
Hides the Posts menu item and removes Posts from the admin bar for non-admin users on sites that do not use the blog.
PHPby SnipCraft
php
<?php
add_action( 'admin_menu', 'scseed_remove_posts_menu' );
if ( ! function_exists( 'scseed_remove_posts_menu' ) ) {
function scseed_remove_posts_menu() {
if ( current_user_can( 'administrator' ) ) {
return;
}
remove_menu_page( 'edit.php' );
}
}
add_action( 'admin_bar_menu', 'scseed_remove_posts_admin_bar', 999 );
if ( ! function_exists( 'scseed_remove_posts_admin_bar' ) ) {
function scseed_remove_posts_admin_bar( $wp_admin_bar ) {
if ( current_user_can( 'administrator' ) ) {
return;
}
$wp_admin_bar->remove_node( 'new-post' );
}
}#admin#cleanup#menu#posts