Custom Post not Deleting on Uninstall

try with this : $args = array ( ‘post_type’ => ‘book’, ‘nopaging’ => true ); $myquery = new WP_Query ($args); while ($myquery->have_posts ()) { $myquery->the_post (); $id = get_the_ID (); wp_delete_post ($id, true); } wp_reset_postdata (); let me know if this works for you!

How do I use a plugin to swap out the template file for a custom post type?

After trying a whole bunch of filter possibilities, I found one that worked. add_filter( ‘single_template’, array($this,’page_template’) ); Which got my function to be called. However, I also needed to make some more changes (not least of which taking out the die line). This was, finally, what worked: public function page_template( $page_template ) { global $post; … Read more