Changeset 32709
- Timestamp:
- 06/08/2015 07:44:32 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r32627 r32709 537 537 if ( ! in_array( $object_type, $wp_taxonomies[$taxonomy]->object_type ) ) 538 538 $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 ); 539 542 540 543 return true; -
trunk/tests/phpunit/tests/taxonomy.php
r31457 r32709 239 239 240 240 } 241 242 /** 243 * @ticket 32590 244 */ 245 public function test_register_taxonomy_for_post_type_for_taxonomy_with_no_object_type_should_filter_out_empty_object_types() { 246 register_taxonomy( 'wptests_tax', '' ); 247 register_taxonomy_for_object_type( 'wptests_tax', 'post' ); 248 $tax = get_taxonomy( 'wptests_tax' ); 249 250 $expected = array( 'post' ); 251 $this->assertEqualSets( $expected, $tax->object_type ); 252 } 253 241 254 /** 242 255 * @ticket 25706
Note: See TracChangeset
for help on using the changeset viewer.