diff --git a/wp-admin/includes/nav-menu.php b/wp-admin/includes/nav-menu.php index b3ea39b1c..b7c3333ce 100644 --- a/wp-admin/includes/nav-menu.php +++ b/wp-admin/includes/nav-menu.php @@ -386,7 +386,7 @@ function wp_nav_menu_post_type_meta_boxes() { * @since 3.0.0 */ function wp_nav_menu_taxonomy_meta_boxes() { - $taxonomies = get_taxonomies( array( 'show_ui' => true ), 'object' ); + $taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'object' ); if ( !$taxonomies ) return; @@ -952,9 +952,6 @@ function wp_save_nav_menu_items( $menu_id = 0, $menu_data = array() ) { */ function _wp_nav_menu_meta_box_object( $object = null ) { if ( isset( $object->name ) ) { - // don't show media meta box - if ( 'attachment' == $object->name ) - return false; if ( 'page' == $object->name ) { $object->_default_query = array( diff --git a/wp-includes/post.php b/wp-includes/post.php index f43099abd..c9cfd6c32 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -50,6 +50,7 @@ function create_initial_post_types() { 'rewrite' => false, 'query_var' => false, 'can_export' => false, + 'show_in_nav_menus' => false, ) ); register_post_type( 'revision', array( diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 73145528e..bed3f5ee8 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -45,6 +45,7 @@ function create_initial_taxonomies() { 'rewrite' => false, 'show_ui' => false, '_builtin' => true, + 'show_in_nav_menus' => false, ) ) ; register_taxonomy( 'link_category', 'link', array( @@ -232,6 +233,9 @@ function is_taxonomy_hierarchical($taxonomy) { * show_ui - If the WordPress UI admin tags UI should apply to this taxonomy; * defaults to public. * + * show_in_nav_menus - true makes this taxonomy available for selection in navigation menus. + * Defaults to public. + * * show_tagcloud - false to prevent the taxonomy being listed in the Tag Cloud Widget; * defaults to show_ui which defalts to public. * @@ -264,6 +268,7 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) { '_builtin' => false, 'labels' => array(), 'capabilities' => array(), + 'show_in_nav_menus' => null, ); $args = wp_parse_args($args, $defaults); @@ -286,6 +291,10 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) { if ( is_null($args['show_ui']) ) $args['show_ui'] = $args['public']; + // Whether to show this type in nav-menus.php. Defaults to the setting for public. + if ( null === $args['show_in_nav_menus'] ) + $args['show_in_nav_menus'] = $args['public']; + if ( is_null($args['show_tagcloud']) ) $args['show_tagcloud'] = $args['show_ui'];