Return a WP_Error if an empty name is provided when registering a taxonomy.

Fixes #31135
Props tyxla, MikeHansenMe


git-svn-id: https://develop.svn.wordpress.org/trunk@31449 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn
2015-02-13 16:26:37 +00:00
parent 83d5751a33
commit 22fc19e06d
2 changed files with 12 additions and 3 deletions

View File

@@ -153,6 +153,15 @@ class Tests_Taxonomy extends WP_UnitTestCase {
unset($GLOBALS['wp_taxonomies'][$tax]);
}
/**
* @ticket 31135
*
* @expectedIncorrectUsage register_taxonomy
*/
function test_register_short_taxonomy() {
$this->assertInstanceOf( 'WP_Error', register_taxonomy( '', 'post', array() ) );
}
/**
* @ticket 21593
*