Function Reference: _unregister_post_type

Summary

Removes the post type and its taxonomy associations.

Source Code

function _unregister_post_type( $cpt_name ) {
	unset( $GLOBALS['wp_post_types'][ $cpt_name ] );
	unset( $GLOBALS['_wp_post_type_features'][ $cpt_name ] );

	foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy ) {
		if ( false !== $key = array_search( $cpt_name, $taxonomy->object_type ) ) {
			unset( $taxonomy->object_type[$key] );
		}
	}
}