Make WordPress Core

Changeset 57681

Timestamp:
02/21/2024 06:13:27 PM (5 months ago)
Author:
hellofromTonya
Message:

Export: Include featured image for posts or pages.

This bugfix resolves an issue in export_wp() with featured images.

When using Tools > Export and selecting either Posts or Pages (with or without a specific author), the resulting XML file now includes a XML item for each post|page's featured image attachment and its metadata.

Uses same chunking (for performance) and code patterns from existing code in the same file.

Adds a new test class for export_wp() with code coverage specific to this bugfix.

Follow-up to [34326], [14444], [6375], [6335].

Props billseymour, nateallen, petitphp, hellofromTonya, duck_, jane, rcain, jghazally, jghazally, smub, batmoo, axwax, creativeslice, dlocc, nacin, wonderboymusic, ganon, SergeyBiryukov, hlashbrooke, chriscct7, fischfood, hifidesign, ankit-k-gupta, 5um17, shailu25, huzaifaalmesbah, mukesh27.
Fixes #17379.

Location:
trunk
Files:
1 added
1 edited

Legend:

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

    r55942 r57681  
    144144    // Grab a snapshot of post IDs, just in case it changes during the export.
    145145    $post_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} $join WHERE $where" );
     146
     147
     148
     149
     150
     151
     152
     153
     154
     155
     156
     157
     158
     159
     160
     161
     162
     163
     164
     165
     166
     167
     168
     169
     170
     171
     172
     173
     174
     175
     176
     177
     178
     179
     180
     181
     182
     183
     184
     185
     186
     187
     188
     189
     190
     191
    146192
    147193    /*
Note: See TracChangeset for help on using the changeset viewer.