[wp-trac] [WordPress Trac] #39301: Importer associates all posts with uncategorized term in WP4.7 PHP7

WordPress Trac noreply at wordpress.org
Fri Dec 16 01:00:22 UTC 2016


#39301: Importer associates all posts with uncategorized term in WP4.7 PHP7
----------------------------+-----------------------------
 Reporter:  staymanhou      |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Import          |    Version:  4.7
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 The WordPress Importer plugin fails to remove the uncategorized term from
 the post which has at least one category set. It's a pretty quick fix,
 though.

 wordpress-importer.php after line 729
 Insert:

 {{{#!php
 if ( 'category' == $term['domain'] )
         $post_is_categorized = TRUE;
 }}}

 wordpress-importer.php after line 753
 Insert:

 {{{#!php
 if ( isset( $post_is_categorized ) && $post_is_categorized ) {
         wp_remove_object_terms( $post_id, 'uncategorized', 'category' );
         unset( $post_is_categorized );
 }
 }}}

 And BTW, is there somewhere I can make pull requests for WP like on
 github? That will make it much easier to suggest code changes.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39301>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list