Make WordPress Core


Ignore:
Timestamp:
01/30/2015 07:17:51 PM (8 years ago)
Author:
boonebgorges
Message:

Introduce 'show_in_quick_edit' parameter for register_taxonomy().

Setting 'show_in_quick_edit' to false when registering a custom taxonomy will
hide the taxonomy when editing posts using Quick Edit.

The new 'quick_edit_show_taxonomy' filter allows this behavior to be filtered
on a finer scale, as when you want a given taxonomy to be hidden for one post
type but not for others.

Props hlashbrooke.
Fixes #26948.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/taxonomy.php

    r31287 r31307  
    283283 * - show_tagcloud - Whether to list the taxonomy in the Tag Cloud Widget.
    284284 *     * If not set, the default is inherited from show_ui.
     285 * - show_in_quick_edit - Whether to show the taxonomy in the quick/bulk edit panel.
     286 *     * It not set, the default is inherited from show_ui.
    285287 * - show_admin_column - Whether to display a column for the taxonomy on its post type listing screens.
    286288 *     * Defaults to false.
     
    309311 *
    310312 * @since 2.3.0
     313 * @since 4.2.0 Introduced 'show_in_quick_edit' parameter.
    311314 * @uses $wp_taxonomies Inserts new taxonomy object into the list
    312315 * @uses $wp Adds query vars
     
    332335        'show_in_nav_menus'     => null,
    333336        'show_tagcloud'         => null,
     337        'show_in_quick_edit'    => null,
    334338        'show_admin_column'     => false,
    335339        'meta_box_cb'           => null,
     
    389393    if ( null === $args['show_tagcloud'] )
    390394        $args['show_tagcloud'] = $args['show_ui'];
     395
     396    // If not set, default to the setting for show_ui.
     397    if ( null === $args['show_in_quick_edit'] ) {
     398        $args['show_in_quick_edit'] = $args['show_ui'];
     399    }
    391400
    392401    $default_caps = array(
Note: See TracChangeset for help on using the changeset viewer.