Created
November 18, 2017 13:03
-
-
Save kneupmedia/b1e94cc5bf3c2fb0ef1863cb113911f5 to your computer and use it in GitHub Desktop.
Remove Custom Post Type - WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( ! function_exists( 'unregister_post_type' ) ) : | |
function unregister_post_type() { | |
global $wp_post_types; | |
if ( isset( $wp_post_types[ 'post_type_name' ] ) ) { | |
unset( $wp_post_types[ 'post_type_name' ] ); | |
return true; | |
} | |
return false; | |
} | |
endif; | |
add_action('init', 'unregister_post_type'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment