Make WordPress Core

Changeset 54810


Ignore:
Timestamp:
11/11/2022 12:37:10 PM (2 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/taxonomy.php

    r54794 r54810  
    565565 */
    566566function unregister_taxonomy( $taxonomy ) {
     567    global $wp_taxonomies;
     568
    567569    if ( ! taxonomy_exists( $taxonomy ) ) {
    568570        return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
     
    575577        return new WP_Error( 'invalid_taxonomy', __( 'Unregistering a built-in taxonomy is not allowed.' ) );
    576578    }
    577 
    578     global $wp_taxonomies;
    579579
    580580    $taxonomy_object->remove_rewrite_rules();
Note: See TracChangeset for help on using the changeset viewer.