WordPress.org

Make WordPress Core

Changeset 24829


Ignore:
Timestamp:
07/28/13 22:15:03 (4 years ago)
Author:
nacin
Message:

Add $taxonomy to edit_terms and edited_terms actions. props SergeyBiryukov, fixes #22542.

File:
1 edited

Legend:

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

    r24714 r24829  
    20782078            // The alias isn't in a group, so let's create a new one and firstly add the alias term to it. 
    20792079            $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 ); 
    20812081            $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 ); 
    20832083        } 
    20842084    } 
     
    21192119    if ( empty($slug) ) { 
    21202120        $slug = sanitize_title($slug, $term_id); 
    2121         do_action( 'edit_terms', $term_id ); 
     2121        do_action( 'edit_terms', $term_id, $taxonomy ); 
    21222122        $wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) ); 
    2123         do_action( 'edited_terms', $term_id ); 
     2123        do_action( 'edited_terms', $term_id, $taxonomy ); 
    21242124    } 
    21252125 
     
    24772477            // The alias isn't in a group, so let's create a new one and firstly add the alias term to it. 
    24782478            $term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms") + 1; 
    2479             do_action( 'edit_terms', $alias->term_id ); 
     2479            do_action( 'edit_terms', $alias->term_id, $taxonomy ); 
    24802480            $wpdb->update( $wpdb->terms, compact('term_group'), array( 'term_id' => $alias->term_id ) ); 
    2481             do_action( 'edited_terms', $alias->term_id ); 
     2481            do_action( 'edited_terms', $alias->term_id, $taxonomy ); 
    24822482        } 
    24832483    } 
     
    24962496            return new WP_Error('duplicate_term_slug', sprintf(__('The slug “%s” is already in use by another term'), $slug)); 
    24972497    } 
    2498     do_action( 'edit_terms', $term_id ); 
     2498    do_action( 'edit_terms', $term_id, $taxonomy ); 
    24992499    $wpdb->update($wpdb->terms, compact( 'name', 'slug', 'term_group' ), compact( 'term_id' ) ); 
    25002500    if ( empty($slug) ) { 
     
    25022502        $wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) ); 
    25032503    } 
    2504     do_action( 'edited_terms', $term_id ); 
     2504    do_action( 'edited_terms', $term_id, $taxonomy ); 
    25052505 
    25062506    $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) ); 
Note: See TracChangeset for help on using the changeset viewer.