• Resolved Clif Johnston

    (@clif_johnston)


    When switching from post type posts to a custom post type (e.g. movies), the change is not committed when saving the post.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Ian

    (@ianaleksander)

    I’m having exactly the same problem. I think that it worked fine up until 3.1, this is the first time I’m using it past the upgrade.

    I am having the same issue… only tried after 3.1, though.

    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 );
    Plugin Author John James Jacoby

    (@johnjamesjacoby)

    Apologies. Plugin was updated but new version was never pushed out.

    Version 0.3 will fix these issues.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Post Type Switcher] Switch to Custom Type Not Being Saved’ is closed to new replies.