WordPress.org

Make WordPress Core

Changeset 13430


Ignore:
Timestamp:
02/26/2010 07:40:35 AM (8 years ago)
Author:
nacin
Message:

Add pre_insert_term hook to wp_insert_term(). fixes #10943 props sirzooro

File:
1 edited

Legend:

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

    r13405 r13430  
    14451445 * @uses $wpdb
    14461446 *
     1447 * @uses apply_filters() Calls 'pre_insert_term' hook with term and taxonomy as parameters.
    14471448 * @uses do_action() Calls 'create_term' hook with the term id and taxonomy id as parameters.
    14481449 * @uses do_action() Calls 'create_$taxonomy' hook with term id and taxonomy id as parameters.
     
    14611462    if ( ! is_taxonomy($taxonomy) )
    14621463        return new WP_Error('invalid_taxonomy', __('Invalid taxonomy'));
     1464
     1465    $term = apply_filters( 'pre_insert_term', $term, $taxonomy );
     1466        if ( is_wp_error( $term ) )
     1467            return $term;
    14631468
    14641469    if ( is_int($term) && 0 == $term )
Note: See TracChangeset for help on using the changeset viewer.