Make WordPress Core


Ignore:
Timestamp:
06/08/2015 07:44:32 PM (9 years ago)
Author:
boonebgorges
Message:

Filter out empty object_types in register_taxonomy_for_object_type().

This prevents weird edge bugs when registering an existing taxonomy with an
object type when the taxonomy was previously associated with no object types.

Fixes #32590.

File:
1 edited

Legend:

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

    r32627 r32709  
    537537    if ( ! in_array( $object_type, $wp_taxonomies[$taxonomy]->object_type ) )
    538538        $wp_taxonomies[$taxonomy]->object_type[] = $object_type;
     539
     540    // Filter out empties.
     541    $wp_taxonomies[ $taxonomy ]->object_type = array_filter( $wp_taxonomies[ $taxonomy ]->object_type );
    539542
    540543    return true;
Note: See TracChangeset for help on using the changeset viewer.