Ticket #22542: 22542.patch
| File 22542.patch, 2.8 KB (added by SergeyBiryukov, 6 months ago) |
|---|
-
wp-includes/taxonomy.php
2077 2077 } else { 2078 2078 // The alias isn't in a group, so let's create a new one and firstly add the alias term to it. 2079 2079 $term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms") + 1; 2080 do_action( 'edit_terms', $alias->term_id );2080 do_action( 'edit_terms', $alias->term_id, $taxonomy ); 2081 2081 $wpdb->update($wpdb->terms, compact('term_group'), array('term_id' => $alias->term_id) ); 2082 do_action( 'edited_terms', $alias->term_id );2082 do_action( 'edited_terms', $alias->term_id, $taxonomy ); 2083 2083 } 2084 2084 } 2085 2085 … … 2118 2118 // Seems unreachable, However, Is used in the case that a term name is provided, which sanitizes to an empty string. 2119 2119 if ( empty($slug) ) { 2120 2120 $slug = sanitize_title($slug, $term_id); 2121 do_action( 'edit_terms', $term_id );2121 do_action( 'edit_terms', $term_id, $taxonomy ); 2122 2122 $wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) ); 2123 do_action( 'edited_terms', $term_id );2123 do_action( 'edited_terms', $term_id, $taxonomy ); 2124 2124 } 2125 2125 2126 2126 $tt_id = $wpdb->get_var( $wpdb->prepare( "SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.term_id = %d", $taxonomy, $term_id ) ); … … 2390 2390 } else { 2391 2391 // The alias isn't in a group, so let's create a new one and firstly add the alias term to it. 2392 2392 $term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms") + 1; 2393 do_action( 'edit_terms', $alias->term_id );2393 do_action( 'edit_terms', $alias->term_id, $taxonomy ); 2394 2394 $wpdb->update( $wpdb->terms, compact('term_group'), array( 'term_id' => $alias->term_id ) ); 2395 do_action( 'edited_terms', $alias->term_id );2395 do_action( 'edited_terms', $alias->term_id, $taxonomy ); 2396 2396 } 2397 2397 } 2398 2398 … … 2409 2409 else 2410 2410 return new WP_Error('duplicate_term_slug', sprintf(__('The slug “%s” is already in use by another term'), $slug)); 2411 2411 } 2412 do_action( 'edit_terms', $term_id );2412 do_action( 'edit_terms', $term_id, $taxonomy ); 2413 2413 $wpdb->update($wpdb->terms, compact( 'name', 'slug', 'term_group' ), compact( 'term_id' ) ); 2414 2414 if ( empty($slug) ) { 2415 2415 $slug = sanitize_title($name, $term_id); 2416 2416 $wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) ); 2417 2417 } 2418 do_action( 'edited_terms', $term_id );2418 do_action( 'edited_terms', $term_id, $taxonomy ); 2419 2419 2420 2420 $tt_id = $wpdb->get_var( $wpdb->prepare( "SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.term_id = %d", $taxonomy, $term_id) ); 2421 2421 do_action( 'edit_term_taxonomy', $tt_id, $taxonomy );
