diff --git wp-includes/taxonomy.php wp-includes/taxonomy.php
index 955369e..b81d8cd 100644
|
|
|
function get_taxonomy_labels( $tax ) {
|
| 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 ) ) |
| … |
… |
function register_taxonomy_for_object_type( $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 | if ( ! get_post_type_object( $object_type ) ) |
| | 503 | return false; |
| | 504 | |
| | 505 | foreach ( array_keys( $wp_taxonomies[$taxonomy]->object_type ) as $array_key ) { |
| | 506 | if ( $wp_taxonomies[$taxonomy]->object_type[$array_key] === $object_type ) { |
| | 507 | unset( $wp_taxonomies[$taxonomy]->object_type[$array_key] ); |
| | 508 | return true; |
| | 509 | } |
| | 510 | } |
| | 511 | |
| | 512 | return false; |
| | 513 | } |
| | 514 | |
| 484 | 515 | // |
| 485 | 516 | // Term API |
| 486 | 517 | // |