Created
November 5, 2012 16:56
-
-
Save mannieschumpert/4018296 to your computer and use it in GitHub Desktop.
Remove "Preview" button from Custom Post type edit page
This file contains 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
// Hide "Preview" button | |
function hide_preview_button() | |
{ | |
global $current_screen; | |
if ( 'CUSTOM_POST_TYPE' == $current_screen->post_type ) { | |
echo '<style>#preview-action,.updated a{display:none;}</style>'; | |
} | |
} | |
add_action('admin_head', 'hide_preview_button'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Remove the view buttons on the custom post type list, as well as the slug (which can be clicked to access the view) from the custom post type page:
<style>#preview-action, .updated a, #edit-slug-box, #the-list .row-actions .view {display: none;}</style>