Skip to content

Instantly share code, notes, and snippets.

@fnicastri
Created June 27, 2016 16:37
Show Gist options
  • Save fnicastri/4d2793cc2b3c85fb8e6bd28d26f0639b to your computer and use it in GitHub Desktop.
Save fnicastri/4d2793cc2b3c85fb8e6bd28d26f0639b to your computer and use it in GitHub Desktop.
WP unregister custom file type
if ( ! function_exists( 'unregister_post_type' ) ) :
function unregister_post_type( $post_type ) {
global $wp_post_types;
if ( isset( $wp_post_types[ $post_type ] ) ) {
unset( $wp_post_types[ $post_type ] );
return true;
}
return false;
}
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment