Ticket #11058: 11058-2.diff
| File 11058-2.diff, 1.6 KB (added by , 13 years ago) |
|---|
-
wp-includes/taxonomy.php
466 466 * @param string $object_type Name of the object type 467 467 * @return bool True if successful, false if not 468 468 */ 469 function register_taxonomy_for_object_type( $taxonomy, $object_type ) {469 function register_taxonomy_for_object_type( $taxonomy, $object_type ) { 470 470 global $wp_taxonomies; 471 471 472 if ( ! isset($wp_taxonomies[$taxonomy]) )472 if ( ! isset( $wp_taxonomies[$taxonomy] ) ) 473 473 return false; 474 474 475 if ( ! get_post_type_object( $object_type) )475 if ( ! get_post_type_object( $object_type ) ) 476 476 return false; 477 477 478 478 if ( ! in_array( $object_type, $wp_taxonomies[$taxonomy]->object_type ) ) … … 481 481 return true; 482 482 } 483 483 484 /** 485 * Remove an already registered taxonomy from an object type. 486 * 487 * @package WordPress 488 * @subpackage Taxonomy 489 * @since 3.7.0 490 * @uses $wp_taxonomies Modifies taxonomy object 491 * 492 * @param string $taxonomy Name of taxonomy object 493 * @param string $object_type Name of the object type 494 * @return bool True if successful, false if not 495 */ 496 function unregister_taxonomy_from_object_type( $taxonomy, $object_type ) { 497 global $wp_taxonomies; 498 499 if ( ! isset( $wp_taxonomies[$taxonomy] ) ) 500 return false; 501 502 foreach ( array_keys( $wp_taxonomies[$taxonomy]->object_type ) as $array_key ) { 503 if ( $wp_taxonomies[$taxonomy]->object_type[$array_key] === $object_type ) { 504 unset( $wp_taxonomies[$taxonomy]->object_type[$array_key] ); 505 return true; 506 } 507 } 508 509 return false; 510 } 511 484 512 // 485 513 // Term API 486 514 //
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)