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. Built from https://develop.svn.wordpress.org/trunk@31307 git-svn-id: http://core.svn.wordpress.org/trunk@31288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -282,6 +282,8 @@ function is_taxonomy_hierarchical($taxonomy) {
|
||||
* * If not set, the default is inherited from public.
|
||||
* - show_tagcloud - Whether to list the taxonomy in the Tag Cloud Widget.
|
||||
* * If not set, the default is inherited from show_ui.
|
||||
* - show_in_quick_edit - Whether to show the taxonomy in the quick/bulk edit panel.
|
||||
* * It not set, the default is inherited from show_ui.
|
||||
* - show_admin_column - Whether to display a column for the taxonomy on its post type listing screens.
|
||||
* * Defaults to false.
|
||||
* - meta_box_cb - Provide a callback function for the meta box display.
|
||||
@@ -308,6 +310,7 @@ function is_taxonomy_hierarchical($taxonomy) {
|
||||
* - _builtin - true if this taxonomy is a native or "built-in" taxonomy. THIS IS FOR INTERNAL USE ONLY!
|
||||
*
|
||||
* @since 2.3.0
|
||||
* @since 4.2.0 Introduced 'show_in_quick_edit' parameter.
|
||||
* @uses $wp_taxonomies Inserts new taxonomy object into the list
|
||||
* @uses $wp Adds query vars
|
||||
*
|
||||
@@ -331,6 +334,7 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
|
||||
'show_in_menu' => null,
|
||||
'show_in_nav_menus' => null,
|
||||
'show_tagcloud' => null,
|
||||
'show_in_quick_edit' => null,
|
||||
'show_admin_column' => false,
|
||||
'meta_box_cb' => null,
|
||||
'capabilities' => array(),
|
||||
@@ -389,6 +393,11 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
|
||||
if ( null === $args['show_tagcloud'] )
|
||||
$args['show_tagcloud'] = $args['show_ui'];
|
||||
|
||||
// If not set, default to the setting for show_ui.
|
||||
if ( null === $args['show_in_quick_edit'] ) {
|
||||
$args['show_in_quick_edit'] = $args['show_ui'];
|
||||
}
|
||||
|
||||
$default_caps = array(
|
||||
'manage_terms' => 'manage_categories',
|
||||
'edit_terms' => 'manage_categories',
|
||||
|
||||
Reference in New Issue
Block a user