Created
June 15, 2016 11:47
-
-
Save palicko/21079517111fdd272b40cdc34ec015f3 to your computer and use it in GitHub Desktop.
Unregister post type
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
<?php | |
/* | |
* | |
* Usage for the built in 'post' post type: | |
* unregister_post_type( 'post', 'edit.php' ); | |
*/ | |
function deregister_post_type() { | |
global $wp_post_types; | |
$post_type = 'post'; | |
if ( isset( $wp_post_types[ $post_type ] ) ) { | |
unset( $wp_post_types[ $post_type ] ); | |
return true; | |
} | |
return false; | |
} | |
add_action('init', 'deregister_post_type'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment