Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.1/src/wp-includes/taxonomy.php

    r30959 r31476  
    33543354
    33553355        // Check for duplicate slug
    3356         $id = $wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->terms WHERE slug = %s", $slug ) );
    3357         if ( $id && ($id != $term_id) ) {
     3356        $duplicate = get_term_by( 'slug', $slug, $taxonomy );
     3357        if ( $duplicate && $duplicate->term_id != $term_id ) {
    33583358                // If an empty slug was passed or the parent changed, reset the slug to something unique.
    33593359                // Otherwise, bail.
    … …  
    43374337         *
    43384338         * @since 3.1.0
     4339         * @since 4.1.1 Introduced the `$resource_type` parameter.
    43394340         *
    43404341         * @param array  $ancestors     An array of object ancestors.
    … …  
    43434344         * @param string $resource_type Type of resource $object_type is.
    43444345         */
    4345         return apply_filters( 'get_ancestors', $ancestors, $object_id, $object_type );
     4346        return apply_filters( 'get_ancestors', $ancestors, $object_id, $object_type, $resource_type );
    43464347}
    43474348
Note: See TracChangeset for help on using the changeset viewer.