[wp-trac] [WordPress Trac] #64556: Tools -> Export | Failure when setting category

WordPress Trac noreply at wordpress.org
Tue Jan 27 11:12:44 UTC 2026


#64556: Tools -> Export | Failure when setting category
--------------------------+-----------------------------
 Reporter:  kbpcit        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Export        |    Version:  6.9
 Severity:  normal        |   Keywords:  needs-patch
  Focuses:                |
--------------------------+-----------------------------
 Hi,

 Export of posts fails when exporting posts of a specific category. This
 probably has affect on other export settings as well.

 File /wp-admin/includes/export.php, line 543 is supposed to echo the slug
 of the current category's parent.  It is trying to get that data from the
 $cats variable, which normally contains all the categories, but it does
 not contain that data when limiting the posts to export to a specific
 category.

 Current line 543:
 {{{
 <wp:category_parent><?php echo wxr_cdata( $c->parent ? $cats[ $c->parent
 ]->slug : '' ); ?></wp:category_parent>
 }}}


 Suggested fix:
 {{{
 <wp:category_parent><?php echo wxr_cdata( $c->parent && isset( $cats[
 $c->parent ] ) ? $cats[ $c->parent ]->slug : '' ); ?></wp:category_parent>
 }}}


 Blessings,

 Klaas

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


More information about the wp-trac mailing list