mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-05 23:27:04 +00:00
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:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user