Skip to content

Instantly share code, notes, and snippets.

@chrisvanpatten
Last active September 13, 2020 13:49
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisvanpatten/5078b6cae34a780078fb to your computer and use it in GitHub Desktop.
Save chrisvanpatten/5078b6cae34a780078fb to your computer and use it in GitHub Desktop.
<?php
/**
* vpm_default_hidden_meta_boxes
*/
function vpm_default_hidden_meta_boxes( $hidden, $screen ) {
// Grab the current post type
$post_type = $screen->post_type;
// If we're on a 'post'...
if ( $post_type == 'post' ) {
// Define which meta boxes we wish to hide
$hidden = array(
'authordiv',
'revisionsdiv',
);
// Pass our new defaults onto WordPress
return $hidden;
}
// If we are not on a 'post', pass the
// original defaults, as defined by WordPress
return $hidden;
}
add_action( 'default_hidden_meta_boxes', 'vpm_default_hidden_meta_boxes', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment