Skip to content

Instantly share code, notes, and snippets.

@lmartins
Created November 27, 2014 20:02
Show Gist options
  • Save lmartins/9a4b479d5d1dfa751f8b to your computer and use it in GitHub Desktop.
Save lmartins/9a4b479d5d1dfa751f8b to your computer and use it in GitHub Desktop.
Hides the preview button on lists and edit screens for custom post types
/**
* Esconder as opções de pré-visualização no front-end para Banners
* @return [type] [description]
*/
function posttype_admin_css() {
global $post_type;
$post_types = array(
/* set post types */
'banners',
);
if(in_array($post_type, $post_types))
echo '<style type="text/css">span.view, #post-preview, #view-post-btn{display: none;}</style>';
}
add_action( 'admin_head-post-new.php', 'posttype_admin_css' );
add_action( 'admin_head-post.php', 'posttype_admin_css' );
add_action( 'admin_head-edit.php', 'posttype_admin_css' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment