From eb68614e2ebe036a0570aefde8c42d5fe7f6c266 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 11 Nov 2022 12:39:13 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@54810 git-svn-id: http://core.svn.wordpress.org/trunk@54362 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index be19a14148..5b70968185 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -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. */ function unregister_taxonomy( $taxonomy ) { + global $wp_taxonomies; + if ( ! taxonomy_exists( $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.' ) ); } - global $wp_taxonomies; - $taxonomy_object->remove_rewrite_rules(); $taxonomy_object->remove_hooks(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 2350c21884..910961706d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-alpha-54804'; +$wp_version = '6.2-alpha-54810'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.