Skip to content

Instantly share code, notes, and snippets.

@palicko
Created June 15, 2016 11:47
Show Gist options
  • Save palicko/21079517111fdd272b40cdc34ec015f3 to your computer and use it in GitHub Desktop.
Save palicko/21079517111fdd272b40cdc34ec015f3 to your computer and use it in GitHub Desktop.
Unregister post type
<?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