WordPress.org

Make WordPress Core

Changeset 49910


Ignore:
Timestamp:
12/28/2020 03:24:37 PM (12 months ago)
Author:
SergeyBiryukov
Message:

Export: Add post_modified and post_modified_gmt fields to the generated WXR export file.

This allows for more flexibility when determining which version of a post is the latest one, and makes it possible to implement import logic involving updating and adding revisions to existing posts or pages.

Props jmdodd.
Fixes #52180.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/export.php

    r49193 r49910  
    2424 *
    2525 * @since 2.1.0
     26 * @since 5.7.0 Added the `post_modified` and `post_modified_gmt` fields to the export file.
    2627 *
    2728 * @global wpdb    $wpdb WordPress database abstraction object.
     
    577578        <wp:post_date><?php echo wxr_cdata( $post->post_date ); ?></wp:post_date>
    578579        <wp:post_date_gmt><?php echo wxr_cdata( $post->post_date_gmt ); ?></wp:post_date_gmt>
     580        <wp:post_modified><?php echo wxr_cdata( $post->post_modified ); ?></wp:post_modified>
     581        <wp:post_modified_gmt><?php echo wxr_cdata( $post->post_modified_gmt ); ?></wp:post_modified_gmt>
    579582        <wp:comment_status><?php echo wxr_cdata( $post->comment_status ); ?></wp:comment_status>
    580583        <wp:ping_status><?php echo wxr_cdata( $post->ping_status ); ?></wp:ping_status>
Note: See TracChangeset for help on using the changeset viewer.