Make WordPress Core

Ticket #30261: 30261.12.diff

File 30261.12.diff, 795 bytes (added by Chouby, 9 years ago)
  • wp-includes/taxonomy.php

     
    42624262                return $term_id;
    42634263        }
    42644264
     4265        // Check if the term has not already been split by a plugin hooked to 'split_shared_term'
     4266        $check_term_id = $wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = %d", $term_taxonomy_id ) );
     4267        if ( $check_term_id != $term_id ) {
     4268                return $check_term_id;
     4269        }
     4270
    42654271        // Pull up data about the currently shared slug, which we'll use to populate the new one.
    42664272        if ( empty( $shared_term ) ) {
    42674273                $shared_term = $wpdb->get_row( $wpdb->prepare( "SELECT t.* FROM $wpdb->terms t WHERE t.term_id = %d", $term_id ) );