Created
September 3, 2018 21:41
-
-
Save WordBits/50ec2e0731a9cd449adf883a77797d7d to your computer and use it in GitHub Desktop.
Piece of code that I use regularly to unregister a WordPress post type. Just add/edit/remove the post type from lines 3, 4 and 5 and paste in your functions.php file.
This file contains hidden or 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 | |
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/unregister-wordpress-post-types/ | |
// Created by: Metal Potato | |
?> | |
<?php | |
function well_delete_post_type(){ | |
unregister_post_type( 'portfolio' ); | |
unregister_post_type( 'cms_block' ); | |
unregister_post_type( 'uncode_gallery' ); | |
} | |
add_action('init','well_delete_post_type'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment