mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 15:47:05 +00:00
Taxonomy: Disallow overriding the name property when registering a taxonomy.
Props wpfo for initial patch. Fixes #39308. git-svn-id: https://develop.svn.wordpress.org/trunk@40049 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -710,4 +710,15 @@ class Tests_Taxonomy extends WP_UnitTestCase {
|
||||
$this->assertFalse( taxonomy_exists( 'foo' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 39308
|
||||
*/
|
||||
public function test_taxonomy_name_property_should_not_get_overridden_by_passed_args() {
|
||||
register_taxonomy( 'foo', 'post', array( 'name' => 'bar' ) );
|
||||
|
||||
$taxonomy = get_taxonomy( 'foo' );
|
||||
unregister_taxonomy( 'foo' );
|
||||
|
||||
$this->assertSame( 'foo', $taxonomy->name );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user