| | 198 | * Reverse the effects of register_taxonomy() |
| | 199 | * |
| | 200 | * @package WordPress |
| | 201 | * @subpackage Taxonomy |
| | 202 | * @since 3.0 |
| | 203 | * @uses $wp_taxonomies Modifies taxonomy object |
| | 204 | * |
| | 205 | * @param string $taxonomy Name of taxonomy object |
| | 206 | * @param array|string $object_type Name of the object type |
| | 207 | * @return bool True if successful, false if not |
| | 208 | */ |
| | 209 | function unregister_taxonomy( $taxonomy, $object_type = '') { |
| | 210 | global $wp_taxonomies; |
| | 211 | |
| | 212 | if ( !isset($wp_taxonomies[$taxonomy]) ) |
| | 213 | return false; |
| | 214 | |
| | 215 | if ( !empty( $object_type ) ) { |
| | 216 | $i = array_search($object_type, $wp_taxonomies[$taxonomy]->object_type); |
| | 217 | |
| | 218 | if ( false !== $i ) |
| | 219 | unset($wp_taxonomies[$taxonomy]->object_type[$i]); |
| | 220 | |
| | 221 | if ( empty($wp_taxonomies[$taxonomy]->object_type) ) |
| | 222 | unset($wp_taxonomies[$taxonomy]); |
| | 223 | } else { |
| | 224 | unset($wp_taxonomies[$taxonomy]); |
| | 225 | } |
| | 226 | |
| | 227 | return true; |
| | 228 | } |
| | 229 | |
| | 230 | /** |