Make WordPress Core

Changeset 14784


Ignore:
Timestamp:
05/21/2010 06:03:53 PM (15 years ago)
Author:
ryan
Message:

If slug and name match an existing term in the same taxonomy at the same hieararchy level return error. fixes #13481

File:
1 edited

Legend:

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

    r14783 r14784  
    16271627                return new WP_Error('db_insert_error', __('Could not insert term into the database'), $wpdb->last_error);
    16281628            $term_id = (int) $wpdb->insert_id;
     1629        } elseif ( is_term( (int) $term_id, $taxonomy ) )  {
     1630            // Same name, same slug.
     1631            return new WP_Error('term_exists', __('A term with the name provided already exists.'));
    16291632        }
    16301633    } else {
Note: See TracChangeset for help on using the changeset viewer.