WordPress.org

Make WordPress Core

Changeset 17688


Ignore:
Timestamp:
04/23/2011 09:27:37 AM (9 years ago)
Author:
dd32
Message:

Prevent $taxonony->object_type containing duplicate values. Initial patch props kevinB. Fixes #16951

File:
1 edited

Legend:

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

    r17686 r17688  
    355355
    356356    $args['name'] = $taxonomy;
    357     $args['object_type'] = (array) $object_type;
     357    $args['object_type'] =  array_unique( (array)$object_type );
    358358
    359359    $args['labels'] = get_taxonomy_labels( (object) $args );
     
    438438        return false;
    439439
    440     $wp_taxonomies[$taxonomy]->object_type[] = $object_type;
     440    if ( ! in_array( $object_type, $wp_taxonomies[$taxonomy]->object_type ) )
     441        $wp_taxonomies[$taxonomy]->object_type[] = $object_type;
    441442
    442443    return true;
Note: See TracChangeset for help on using the changeset viewer.