WordPress.org

Make WordPress Core

Ticket #22526: 22526.2.diff

File 22526.2.diff, 892 bytes (added by kovshenin, 4 years ago)
  • src/wp-includes/taxonomy.php

     
    25942594        $wpdb->update( $wpdb->term_taxonomy, compact( 'term_id', 'taxonomy', 'description', 'parent' ), array( 'term_taxonomy_id' => $tt_id ) );
    25952595        do_action( 'edited_term_taxonomy', $tt_id, $taxonomy );
    25962596
     2597        // Clean the relationship caches for all object types using this term
     2598        $objects = $wpdb->get_col( $wpdb->prepare( "SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $tt_id ) );
     2599        $tax_object = get_taxonomy( $taxonomy );
     2600        foreach ( $tax_object->object_type as $object_type )
     2601                clean_object_term_cache( $objects, $object_type );
     2602
    25972603        do_action("edit_term", $term_id, $tt_id, $taxonomy);
    25982604        do_action("edit_$taxonomy", $term_id, $tt_id);
    25992605