Title: [Plugin: Post Type Switcher] Broken after 3.1
Last modified: August 19, 2016

---

# [Plugin: Post Type Switcher] Broken after 3.1

 *  Resolved [auzzy](https://wordpress.org/support/users/auz1111/)
 * (@auz1111)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-post-type-switcher-broken-after-31/)
 * I can see the post type change when selecting the wanted type on the post, but
   once published the change is not saved.
 * Otherwise, a very useful plugin!

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Vladimir Statsenko](https://wordpress.org/support/users/vladimirs/)
 * (@vladimirs)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-post-type-switcher-broken-after-31/#post-1963641)
 * I can suggest a temporary solution of this issue.
 * Add the following code to the end of
    wp-content/plugins/post-type-switcher/post-
   type-switcher.php file. Just before php closing tag (?>).
 *     ```
       function pts_save( $post_id, $post ) {
       	if ( isset( $_POST[ 'pts_post_type' ] ) && $_POST[ 'pts_post_type' ] != $post->post_type ) {
       		$cur_post_id = $post_id;
       		//checking if current post is a revision
       		if ( false !== ( $id = wp_is_post_revision( $post ) ) ) {
       			$cur_post_id = $id;
       		}
       		//updating post type
       		set_post_type( $cur_post_id, $_POST[ 'pts_post_type' ] );
       	}
       }
   
       add_action( 'save_post', 'pts_save', 10, 2 );
       ```
   
 *  Thread Starter [auzzy](https://wordpress.org/support/users/auz1111/)
 * (@auz1111)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-post-type-switcher-broken-after-31/#post-1963642)
 * Thanks a lot for that one! Also, gave me some more insight into the workings 
   of the plugin after taking a look.
 * Thanks!
 *  [GrandSlambert](https://wordpress.org/support/users/grandslambert/)
 * (@grandslambert)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-post-type-switcher-broken-after-31/#post-1963671)
 * Hmm, seems like that could should have been in the plugin all along. How did 
   it work without that?
 *  [kiddhustle](https://wordpress.org/support/users/kiddhustle/)
 * (@kiddhustle)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-post-type-switcher-broken-after-31/#post-1963688)
 * Hey Vladimir
 * Nice fix!
 * Yea.. How does this plugin switch the post type without that code in there? Trippy..
 *  [ericperson](https://wordpress.org/support/users/ericperson/)
 * (@ericperson)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-post-type-switcher-broken-after-31/#post-1963705)
 * It didn’t work for me in 3.1.1—I added the code but nothing changed. I also tried
   deactivating and reactivating the plugin after editing.
 * Is this working for anyone in 3.1.1?
 *  [Vladimir Statsenko](https://wordpress.org/support/users/vladimirs/)
 * (@vladimirs)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-post-type-switcher-broken-after-31/#post-1963707)
 * I didn’t see any problems with this fix on WP 3.1.1.
    Can you check pts_post_type
   post parameter (with firebug)? New post type will be sent in this parameter when
   you save or publish post.
 *  Plugin Author [John James Jacoby](https://wordpress.org/support/users/johnjamesjacoby/)
 * (@johnjamesjacoby)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-post-type-switcher-broken-after-31/#post-1963708)
 * Apologies. Plugin was updated but new version was never pushed out.
 * Version 0.3 will fix these issues.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘[Plugin: Post Type Switcher] Broken after 3.1’ 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/)

 * 7 replies
 * 6 participants
 * Last reply from: [John James Jacoby](https://wordpress.org/support/users/johnjamesjacoby/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-post-type-switcher-broken-after-31/#post-1963708)
 * Status: resolved