Support » Plugins and Hacks » Post Type Switcher » [Resolved] [Plugin: Post Type Switcher] Broken after 3.1

[Resolved] [Plugin: Post Type Switcher] Broken after 3.1

  • 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)
  • I can suggest a temporary solution of this issue.

    Add the following code to the end of
    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 );

    Thanks a lot for that one! Also, gave me some more insight into the workings of the plugin after taking a look.


    Hmm, seems like that could should have been in the plugin all along. How did it work without that?

    Hey Vladimir

    Nice fix!

    Yea.. How does this plugin switch the post type without that code in there? Trippy..

    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?

    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


    BuddyPress/bbPress Lead

    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 ‘[Resolved] [Plugin: Post Type Switcher] Broken after 3.1’ is closed to new replies.
Skip to toolbar