Make WordPress Core

Changeset 60933


Ignore:
Timestamp:
10/15/2025 12:40:07 AM (2 months ago)
Author:
peterwilsoncc
Message:

Taxonomy: Bypass clearing taxonomy hierarchy for non-hierarchical taxonomies.

Modifies clean_taxonomy_cache() to bypass attempting to delete the {$taxonomy}_children option for non-hierarchical taxonomies, such as tags.

This removes a needless database query within delete_option() to determine if the {$taxonomy}_children option is set. It isn't.

Props: chouby, mukesh27, rollybueno, sabernhardt, shailu25, spacedmonkey, westonruter.
Fixes #64090.

Location:
trunk
Files:
1 added
1 edited

Legend:

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

    r60711 r60933  
    37333733
    37343734    // Regenerate cached hierarchy.
    3735     delete_option( "{$taxonomy}_children" );
    3736     _get_term_hierarchy( $taxonomy );
     3735    if ( is_taxonomy_hierarchical( $taxonomy ) ) {
     3736        delete_option( "{$taxonomy}_children" );
     3737        _get_term_hierarchy( $taxonomy );
     3738    }
    37373739
    37383740    /**
Note: See TracChangeset for help on using the changeset viewer.