Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Turn off some screen options; turn ON others
<?php
add_filter( 'default_hidden_meta_boxes', 'scl_toggle_meta_boxes', 10, 2 );
function scl_toggle_meta_boxes( $hidden, $screen ) {
$hide_these = array(
'people_typediv',
'facility_typediv',
'genesis-theme-settings-version',
'genesis-theme-settings-feeds',
'genesis_inpost_scripts_box',
'commentstatusdiv',
'slugdiv',
'authordiv',
'postcustom',
'trackbacksdiv',
'sharing_meta'
);
if ( $screen->base == 'nav-menus' ) {
$show_these = array(
'add-post-type-course',
'add-post-type-people',
'add-post-type-publication',
'add-post-type-facility',
'add-post-type-research',
'add-people_type',
'add-organization',
'add-subject_area',
'add-facility_type',
'add-service',
'add-student_type',
'add-publication_type',
'add-committee',
'add-groups',
'hptal-metabox', // Post Type Archive Links box
);
$hidden = array_diff( $hidden, $show_these );
}
return array_merge( $hidden, $hide_these );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.