Make WordPress Core


Ignore:
Timestamp:
08/26/2013 10:34:56 PM (12 years ago)
Author:
ocean90
Message:

Introduce show_in_menu for register_taxonomy.

Accepts boolean: true to show, false to hide. If not set, the default is inherited from show_ui.

fixes #20930.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/menu.php

    r25100 r25133  
    5454    $i = 15;
    5555    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) )
    5757            continue;
    5858
     
    6666    $submenu['upload.php'][10] = array( _x('Add New', 'file'), 'upload_files', 'media-new.php');
    6767    foreach ( get_taxonomies_for_attachments( 'objects' ) as $tax ) {
    68         if ( ! $tax->show_ui )
     68        if ( ! $tax->show_ui || ! $tax->show_in_menu )
    6969            continue;
    7070
     
    8585    $i = 15;
    8686    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) )
    8888            continue;
    8989
     
    127127    $i = 15;
    128128    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) )
    130130            continue;
    131131
Note: See TracChangeset for help on using the changeset viewer.