Make WordPress Core

Ticket #10943: taxonomy.php.diff

File taxonomy.php.diff, 902 bytes (added by sirzooro, 15 years ago)
  • taxonomy.php

    old new  
    13311331 * @since 2.3.0
    13321332 * @uses $wpdb
    13331333 *
     1334 * @uses apply_filters() Calls 'pre_wp_insert_term' hook with term and taxonomy as parameters.
    13341335 * @uses do_action() Calls 'create_term' hook with the term id and taxonomy id as parameters.
    13351336 * @uses do_action() Calls 'create_$taxonomy' hook with term id and taxonomy id as parameters.
    13361337 * @uses apply_filters() Calls 'term_id_filter' hook with term id and taxonomy id as parameters.
     
    13481349        if ( ! is_taxonomy($taxonomy) )
    13491350                return new WP_Error('invalid_taxonomy', __('Invalid taxonomy'));
    13501351
     1352        $term = apply_filters( 'pre_wp_insert_term', $term, $taxonomy );
     1353        if ( is_wp_error( $term ) )
     1354                return $term;
     1355
    13511356        if ( is_int($term) && 0 == $term )
    13521357                return new WP_Error('invalid_term_id', __('Invalid term ID'));
    13531358