Created
April 20, 2018 13:53
-
-
Save kuznacic/6af7f6d719480c384c4bf657d44a4955 to your computer and use it in GitHub Desktop.
Unregister WordPress custom post type (useful for removing unwanted CPTs from themes)
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 | |
| //Remove "Event" custom post type from a WordPress site. This example uses CPT named "event." | |
| function delete_event_cpt(){ | |
| unregister_post_type( 'event' ); | |
| } | |
| add_action('init','delete_event_cpt', 9999); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment