Title: Defaults To Post post_type
Last modified: August 21, 2016

---

# Defaults To Post post_type

 *  [Mat Lipe](https://wordpress.org/support/users/mat-lipe/)
 * (@mat-lipe)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/defaults-to-post-post_type/)
 * On line 94 of post-type-switcher.php the select is generated in the meta box 
   without a blank option.
 * While this works great in many cases, we are finding that if we use the filter‘
   pts_post_type_filter’ to remove a few post types, this select just defaults to
   the first post type and switch the post to that on every save.
 * For instance is we remove the post_type called ‘events’ from the available to
   switch to post_types then add a new event, when we save the event it is automatically
   converted to a post due to post being the first available option in the select.
 * I was able to fix it by adding an empty valued option which does not convert 
   the post type unless one is selected, or automatically adding an option for the
   current post type if not in the $post_types variable.
 * [https://wordpress.org/plugins/post-type-switcher/](https://wordpress.org/plugins/post-type-switcher/)

Viewing 1 replies (of 1 total)

 *  [the.wong.one](https://wordpress.org/support/users/thewongone/)
 * (@thewongone)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/defaults-to-post-post_type/#post-5046356)
 * I second the suggestion of defaulting to a blank entry or the current post type
   being edited.
 * One of my colleagues had installed this plugin when setting up a site for a client.
   I was not aware of it when it was moved over to production. The problem we had
   was that Woocommerce was also installed on this site and it uses custom post 
   types to track order data. So whenever an order was updated, it was set to the‘
   post’ post type and then lost from the orders section.
 * It took a while to track down what was happening but glad it was a single plugin
   that was the culprit.
 * Aside from that, this plugin is pretty handy. Thanks.

Viewing 1 replies (of 1 total)

The topic ‘Defaults To Post post_type’ is closed to new replies.

 * ![](https://ps.w.org/post-type-switcher/assets/icon-256x256.jpg?rev=1823578)
 * [Post Type Switcher](https://wordpress.org/plugins/post-type-switcher/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-type-switcher/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-type-switcher/)
 * [Active Topics](https://wordpress.org/support/plugin/post-type-switcher/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-type-switcher/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-type-switcher/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [the.wong.one](https://wordpress.org/support/users/thewongone/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/defaults-to-post-post_type/#post-5046356)
 * Status: not resolved