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.

git-svn-id: https://develop.svn.wordpress.org/trunk@31307 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges
2015-01-30 19:17:51 +00:00
parent 2fb8562a97
commit 057c428346
3 changed files with 45 additions and 1 deletions
+19
View File
@@ -162,6 +162,25 @@ class Tests_Taxonomy extends WP_UnitTestCase {
$this->assertInstanceOf( 'WP_Error', register_taxonomy( 'abcdefghijklmnopqrstuvwxyz0123456789', 'post', array() ) );
}
/**
* @ticket 26948
*/
public function test_register_taxonomy_show_in_quick_edit_should_default_to_value_of_show_ui() {
register_taxonomy( 'wptests_tax_1', 'post', array(
'show_ui' => true,
) );
register_taxonomy( 'wptests_tax_2', 'post', array(
'show_ui' => false,
) );
$tax_1 = get_taxonomy( 'wptests_tax_1' );
$this->assertTrue( $tax_1->show_in_quick_edit );
$tax_2 = get_taxonomy( 'wptests_tax_2' );
$this->assertFalse( $tax_2->show_in_quick_edit );
}
/**
* @ticket 11058
*/