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-includes/taxonomy.php

    r25130 r25133  
    281281 * - show_ui -Whether to generate a default UI for managing this taxonomy in the admin.
    282282 *     * 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.
    283288 * - show_in_nav_menus - Makes this taxonomy available for selection in navigation menus.
    284289 *     * If not set, the default is inherited from public.
     
    325330        'hierarchical'          => false,
    326331        'show_ui'               => null,
     332        'show_in_menu'          => null,
    327333        'show_in_nav_menus'     => null,
    328334        'show_tagcloud'         => null,
     
    366372    if ( null === $args['show_ui'] )
    367373        $args['show_ui'] = $args['public'];
     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'];
    368378
    369379    // If not set, default to the setting for public.
Note: See TracChangeset for help on using the changeset viewer.