Support » Plugin: Convert Post Types » Little bug (and fix) converting pages 2 posts and no post category assigned

  • Hello, great plugin that saved my client a lot of work, but I found maybe a little bug, that I post, including the fix that worked for me, just in case someone needs.

    The issue came out converting pages into posts, and the user wanted to assign categories during the conversion process.

    The problem: child pages of a selected parent were converted into posts, but the new posts had no category at all.

    I found at line 167 of convert-post-types.php, the following code :

    /* WRONG (line 167) */
    wp_set_post_terms( $post->ID, $_POST[‘post_category’], ‘post_category’, false );
    /* WRONG (line 167) */

    Strange, I never found a standard WP taxonomy named “post_category” before. So, I changed the line into the following :

    /* RIGHT */
    wp_set_post_terms( $post->ID, $_POST[‘post_category’], ‘category’, false );
    /* RIGHT */

    And it worked like a charm. I hope, the fix can be applied to the official version, if the Author agrees.

    Hth someone.

    All the best, Miguel

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Little bug (and fix) converting pages 2 posts and no post category assigned’ is closed to new replies.