Make WordPress Core


Ignore:
Timestamp:
07/28/2020 03:40:35 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Taxonomy: Rename the default_taxonomy_$taxonomy option key to default_term_$taxonomy.

This better reflects the purpose of the option.

Follow-up to [48356], [48480].

See #43517.

File:
1 edited

Legend:

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

    r48664 r48665  
    445445                $term = term_exists( $taxonomy_object->default_term['name'], $taxonomy );
    446446                if ( $term ) {
    447                         update_option( 'default_taxonomy_' . $taxonomy_object->name, $term['term_id'] );
     447                        update_option( 'default_term_' . $taxonomy_object->name, $term['term_id'] );
    448448                } else {
    449449                        $term = wp_insert_term(
    … …  
    458458                        // Update `term_id` in options.
    459459                        if ( ! is_wp_error( $term ) ) {
    460                                 update_option( 'default_taxonomy_' . $taxonomy_object->name, $term['term_id'] );
     460                                update_option( 'default_term_' . $taxonomy_object->name, $term['term_id'] );
    461461                        }
    462462                }
    … …  
    509509        // Remove custom taxonomy default term option.
    510510        if ( ! empty( $taxonomy_object->default_term ) ) {
    511                 delete_option( 'default_taxonomy_' . $taxonomy_object->name );
     511                delete_option( 'default_term_' . $taxonomy_object->name );
    512512        }
    513513
    … …  
    18351835        $taxonomy_object = get_taxonomy( $taxonomy );
    18361836        if ( ! empty( $taxonomy_object->default_term ) ) {
    1837                 $defaults['default'] = (int) get_option( 'default_taxonomy_' . $taxonomy );
     1837                $defaults['default'] = (int) get_option( 'default_term_' . $taxonomy );
    18381838                if ( $defaults['default'] === $term ) {
    18391839                        return 0;
Note: See TracChangeset for help on using the changeset viewer.