Ticket #19148: taxonomy.php.patch
| File taxonomy.php.patch, 1.4 KB (added by , 15 years ago) |
|---|
-
wp-includes/taxonomy.php
354 354 unset( $args['capabilities'] ); 355 355 356 356 $args['name'] = $taxonomy; 357 $args['object_type'] = array _unique( (array)$object_type);357 $args['object_type'] = array(); 358 358 359 359 $args['labels'] = get_taxonomy_labels( (object) $args ); 360 360 $args['label'] = $args['labels']->name; 361 361 362 362 $wp_taxonomies[$taxonomy] = (object) $args; 363 363 364 foreach (array_unique( (array)$object_type ) as $type){ 365 register_taxonomy_for_object_type($taxonomy, $type); 366 } 367 364 368 // register callback handling for metabox 365 369 add_filter('wp_ajax_add-' . $taxonomy, '_wp_ajax_add_hierarchical_term'); 366 370 … … 432 436 * @return bool True if successful, false if not 433 437 */ 434 438 function register_taxonomy_for_object_type( $taxonomy, $object_type) { 435 global $wp_taxonomies ;439 global $wp_taxonomies, $wp_post_types; 436 440 437 441 if ( !isset($wp_taxonomies[$taxonomy]) ) 438 442 return false; … … 440 444 if ( ! get_post_type_object($object_type) ) 441 445 return false; 442 446 443 if ( ! in_array( $object_type, $wp_taxonomies[$taxonomy]->object_type ) ) 447 if ( ! in_array( $object_type, $wp_taxonomies[$taxonomy]->object_type ) ){ 444 448 $wp_taxonomies[$taxonomy]->object_type[] = $object_type; 449 $wp_post_types[$object_type]->taxonomies[] = $taxonomy; 450 } 445 451 446 452 return true; 447 453 }
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)