Ticket #20930: 20930.patch
File 20930.patch, 2.3 KB (added by , 12 years ago) |
---|
-
wp-includes/taxonomy.php
323 323 'query_var' => $taxonomy, 324 324 'public' => true, 325 325 'show_ui' => null, 326 'show_in_menu' => null, 326 327 'show_tagcloud' => null, 327 328 '_builtin' => false, 328 329 'labels' => array(), … … 359 360 add_permastruct( $taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite'] ); 360 361 } 361 362 362 if ( is_null($args['show_ui']) ) 363 // If not set, default to the setting for public. 364 if ( null === $args['show_ui'] ) 363 365 $args['show_ui'] = $args['public']; 364 366 367 // If not set, default to the setting for show_ui. 368 if ( null === $args['show_in_menu'] || ! $args['show_ui'] ) 369 $args['show_in_menu'] = $args['show_ui']; 370 365 371 // Whether to show this type in nav-menus.php. Defaults to the setting for public. 366 372 if ( null === $args['show_in_nav_menus'] ) 367 373 $args['show_in_nav_menus'] = $args['public']; 368 374 369 if ( is_null($args['show_tagcloud']) ) 375 // If not set, default to the setting for show_ui. 376 if ( null === $args['show_tagcloud'] ) 370 377 $args['show_tagcloud'] = $args['show_ui']; 371 378 372 379 $default_caps = array( -
wp-admin/menu.php
65 65 /* translators: add new file */ 66 66 $submenu['upload.php'][10] = array( _x('Add New', 'file'), 'upload_files', 'media-new.php'); 67 67 foreach ( get_taxonomies_for_attachments( 'objects' ) as $tax ) { 68 if ( ! $tax->show_ui )68 if ( ! $tax->show_ui || ! $tax->show_in_menu ) 69 69 continue; 70 70 71 71 $submenu['upload.php'][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name . '&post_type=attachment' ); … … 126 126 127 127 $i = 15; 128 128 foreach ( get_taxonomies( array(), 'objects' ) as $tax ) { 129 if ( ! $tax->show_ui || ! in_array($ptype, (array) $tax->object_type, true) )129 if ( ! $tax->show_ui || ! $tax->show_in_menu || ! in_array($ptype, (array) $tax->object_type, true) ) 130 130 continue; 131 131 132 132 $submenu["edit.php?post_type=$ptype"][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, "edit-tags.php?taxonomy=$tax->name&post_type=$ptype" );