Create a gist now

Instantly share code, notes, and snippets.

Wordpress Nav menus administration. Open all metaboxes by default.
/**
* Show by default posts,tags and post-format meta-boxes on wp-admin/nav-menus.php
* @param array $meta_boxes
* @return array
* @author Stergatu Lena <stergatu@cti.gr>
* @version 1, 25/9/2014
*/
function ls_initial_nav_menu_meta_boxes( $meta_boxes ) {
if ( ! (in_array( 'add-post', $meta_boxes )) ) {
$meta_boxes[] = 'add-post';
}
if ( ! (in_array( 'add-post_tag', $meta_boxes )) ) {
$meta_boxes[] = 'add-post_tag';
}
if ( ! (in_array( 'add-post_format', $meta_boxes )) ) {
$meta_boxes[] = 'add-post_format';
}
return $meta_boxes;
}
add_filter( 'initial_nav_menu_meta_boxes', 'ls_initial_nav_menu_meta_boxes' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment