Use show_in_nav_menus for attachments. Also add it to register_taxonomy for consistency and have it default to public, not show_ui, like post types. see #13621.

git-svn-id: http://svn.automattic.com/wordpress/trunk@15056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-05-29 16:46:46 +00:00
parent 98d82faab5
commit 332c2773e0
3 changed files with 11 additions and 4 deletions

View File

@ -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(

View File

@ -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(

View File

@ -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'];