Forked from paaljoachim/hide-meta-boxes-single-post-page-screen.php
Created
October 14, 2018 08:33
-
-
Save mehrshaddarzi/33cce4cd1c7ffdf2200ccb15e7375de6 to your computer and use it in GitHub Desktop.
Default Hide MetaBox in wordpress
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
//https://wordpress.stackexchange.com/questions/15376/how-to-set-default-screen-options | |
add_filter( 'hidden_meta_boxes', 'custom_hidden_meta_boxes' ); | |
function custom_hidden_meta_boxes( $hidden ) { | |
// Hide meta boxes on the single Post screen | |
// Left column | |
$hidden[] = 'postexcerpt'; // Post Excerpts | |
$hidden[] = 'trackbacksdiv'; // Send Trackbacks | |
$hidden[] = 'postcustom'; // Custom Fields | |
$hidden[] = 'commentstatusdiv'; // Discussion | |
$hidden[] = 'commentsdiv'; // Comments - Add comment | |
$hidden[] = 'slugdiv'; // Slug | |
$hidden[] = 'authordiv'; // Author | |
// Right column | |
$hidden[] = 'submitdiv'; // Publish | |
$hidden[] = 'formatdiv'; // Format (for themes that use Post Format) | |
$hidden[] = 'categorydiv'; // Categories | |
$hidden[] = 'tagsdiv-post_tag'; // Tags | |
$hidden[] = 'postimagediv'; // Featured Image | |
// Hide meta boxes on the single Page screen | |
// Left Column | |
$hidden[] = 'revisionsdiv'; // Revisions | |
$hidden[] = 'postcustom'; // Custom Fields | |
$hidden[] = 'commentstatusdiv'; // Discussion | |
$hidden[] = 'commentsdiv'; // Comments - Add comment | |
$hidden[] = 'slugdiv'; // Slug | |
$hidden[] = 'authordiv'; // Author | |
// Right column | |
$hidden[] = 'submitdiv'; // Publish | |
$hidden[] = 'pageparentdiv'; // Page Attributes | |
$hidden[] = 'postimagediv'; // Featured Image | |
return $hidden; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment