mirror of
git://develop.git.wordpress.org/
synced 2025-02-22 23:54:09 +01:00
Coding Standards: Declare $wp_taxonomies
global at the top of unregister_taxonomy()
.
This brings some consistency with how the global is declared in other taxonomy functions. Follow-up to [36243], [38747], [54794]. See #57058. git-svn-id: https://develop.svn.wordpress.org/trunk@54810 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
23a646a25a
commit
4a827498ea
@ -564,6 +564,8 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
|
|||||||
* @return true|WP_Error True on success, WP_Error on failure or if the taxonomy doesn't exist.
|
* @return true|WP_Error True on success, WP_Error on failure or if the taxonomy doesn't exist.
|
||||||
*/
|
*/
|
||||||
function unregister_taxonomy( $taxonomy ) {
|
function unregister_taxonomy( $taxonomy ) {
|
||||||
|
global $wp_taxonomies;
|
||||||
|
|
||||||
if ( ! taxonomy_exists( $taxonomy ) ) {
|
if ( ! taxonomy_exists( $taxonomy ) ) {
|
||||||
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
|
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
|
||||||
}
|
}
|
||||||
@ -575,8 +577,6 @@ function unregister_taxonomy( $taxonomy ) {
|
|||||||
return new WP_Error( 'invalid_taxonomy', __( 'Unregistering a built-in taxonomy is not allowed.' ) );
|
return new WP_Error( 'invalid_taxonomy', __( 'Unregistering a built-in taxonomy is not allowed.' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
global $wp_taxonomies;
|
|
||||||
|
|
||||||
$taxonomy_object->remove_rewrite_rules();
|
$taxonomy_object->remove_rewrite_rules();
|
||||||
$taxonomy_object->remove_hooks();
|
$taxonomy_object->remove_hooks();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user