unregister_taxonomy_for_object_type
Remove an already registered taxonomy from an object type.
Description
Parameters (2)
- 0. $taxonomy (string)
- Name of taxonomy object.
- 1. $object_type (string)
- Name of the object type.
Usage
if ( !function_exists( 'unregister_taxonomy_for_object_type' ) ) { require_once ABSPATH . WPINC . '/taxonomy.php'; } // Name of taxonomy object. $taxonomy = ''; // Name of the object type. $object_type = ''; // NOTICE! Understand what this does before running. $result = unregister_taxonomy_for_object_type($taxonomy, $object_type);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/taxonomy.php
- function unregister_taxonomy_for_object_type( $taxonomy, $object_type ) {
- global $wp_taxonomies;
- if ( ! isset( $wp_taxonomies[ $taxonomy ] ) )
- return false;
- if ( ! get_post_type_object( $object_type ) )
- return false;
- $key = array_search( $object_type, $wp_taxonomies[ $taxonomy ]->object_type, true );
- if ( false === $key )
- return false;
- unset( $wp_taxonomies[ $taxonomy ]->object_type[ $key ] );
- return true;
- }