Remove Edit Title, Add new, Permalink, View Post buttons from Custom Post Type Edit Screens

// Remove Edit Title, Add new, Permalink, View Post buttons from Custom Post Type Edit Screens
function posttype_admin_css() {
 if (current_user_can('author')){
    global $post_type;
     if($post_type == 'custom_post_type') {
      echo '<style type="text/css">#titlediv,.add-new-h2,#edit-slug-box,#view-post-btn,.updated p a{display: none;}</style>';
  }
 }
}
add_action('admin_head', 'posttype_admin_css');

Source: 10+ Useful WordPress Code Snippets

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.