How Hide “Edit Permalink & View Post” buttons for Custom Post Type on Edit Screens


Hello Everyone!

If you want hide the view button for custom post type then you can use this code.

The following code will remove the edit permalink and view post button from your edit/add custom post type screens. In this example I have allowed for three different CPTs to be targeted but you can adjust this as needed.

<?php  
function raghu_admin_css() {
global $post_type;
if($post_type == 'news') {
echo '<style type="text/css">#edit-slug-box,#view-post-btn,
#post-preview,.updated p a{display: none;}.view{display:none;}</style>';
}
}
add_action('admin_head', 'raghu_admin_css'); 
?>

Enjoy Code!

Advertisements

Sr. Software Engineer

Posted in Wordpress
4 comments on “How Hide “Edit Permalink & View Post” buttons for Custom Post Type on Edit Screens
  1. This is a very good tip particularly to those fresh to
    the blogosphere. Brief but very accurate information… Thanks for sharing this one.

    A must read article!

  2. Stanton says:

    Hey! I know this is kinda off topic however I’d figured I’d ask. Would you be interested in trading links or maybe guest writing a blog article or vice-versa? My blog covers a lot of the same subjects as yours and I think we could greatly benefit from each other. If you are interested feel free to send me an e-mail. I look forward to hearing from you! Superb blog by the way!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: