Ticket #20930: 20930.2.diff
File 20930.2.diff, 3.9 KB (added by , 11 years ago) |
---|
-
src/wp-admin/menu.php
53 53 54 54 $i = 15; 55 55 foreach ( get_taxonomies( array(), 'objects' ) as $tax ) { 56 if ( ! $tax->show_ui || ! in_array('post', (array) $tax->object_type, true) )56 if ( ! $tax->show_ui || ! $tax->show_in_menu || ! in_array('post', (array) $tax->object_type, true) ) 57 57 continue; 58 58 59 59 $submenu['edit.php'][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name ); … … 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' ); … … 84 84 $submenu['edit.php?post_type=page'][10] = array( _x('Add New', 'page'), get_post_type_object( 'page' )->cap->create_posts, 'post-new.php?post_type=page' ); 85 85 $i = 15; 86 86 foreach ( get_taxonomies( array(), 'objects' ) as $tax ) { 87 if ( ! $tax->show_ui || ! in_array('page', (array) $tax->object_type, true) )87 if ( ! $tax->show_ui || ! $tax->show_in_menu || ! in_array('page', (array) $tax->object_type, true) ) 88 88 continue; 89 89 90 90 $submenu['edit.php?post_type=page'][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name . '&post_type=page' ); -
src/wp-includes/class-wp-xmlrpc-server.php
547 547 if ( in_array( 'cap', $fields ) ) 548 548 $_taxonomy['cap'] = (array) $taxonomy->cap; 549 549 550 if ( in_array( 'menu', $fields ) ) 551 $_taxonomy['show_in_menu'] = (bool) $_taxonomy->show_in_menu; 552 550 553 if ( in_array( 'object_type', $fields ) ) 551 554 $_taxonomy['object_type'] = array_unique( (array) $taxonomy->object_type ); 552 555 -
src/wp-includes/taxonomy.php
280 280 * - hierarchical - Whether the taxonomy is hierarchical (e.g. category). Defaults to false. 281 281 * - show_ui -Whether to generate a default UI for managing this taxonomy in the admin. 282 282 * * If not set, the default is inherited from public. 283 * - show_in_menu - Where to show the taxonomy in the admin menu. 284 * * If true, the taxonomy is shown as a submenu of the object type menu. 285 * * If false, no menu is shown. 286 * * show_ui must be true. 287 * * If not set, the default is inherited from show_ui. 283 288 * - show_in_nav_menus - Makes this taxonomy available for selection in navigation menus. 284 289 * * If not set, the default is inherited from public. 285 290 * - show_tagcloud - Whether to list the taxonomy in the Tag Cloud Widget. … … 324 329 'public' => true, 325 330 'hierarchical' => false, 326 331 'show_ui' => null, 332 'show_in_menu' => null, 327 333 'show_in_nav_menus' => null, 328 334 'show_tagcloud' => null, 329 335 'capabilities' => array(), … … 366 372 if ( null === $args['show_ui'] ) 367 373 $args['show_ui'] = $args['public']; 368 374 375 // If not set, default to the setting for show_ui. 376 if ( null === $args['show_in_menu' ] || ! $args['show_ui'] ) 377 $args['show_in_menu' ] = $args['show_ui']; 378 369 379 // If not set, default to the setting for public. 370 380 if ( null === $args['show_in_nav_menus'] ) 371 381 $args['show_in_nav_menus'] = $args['public'];