Directory

Include attachments and featured images for posts being exported by nate-allen · Pull Request #4245 · WordPress/wordpress-develop · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include attachments and featured images for posts being exported #4245

Closed
wants to merge 4 commits into from

Conversation

nate-allen
Copy link

This pull request fixes an issue where attachments are not included when exporting posts, unless you choose the "all" option.

A unit test is also included.

Trac ticket: 17379


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Currently, attachmets are only exported if you choose to export
with the 'all' option. This change will get the attachment IDs
of all of the posts being exported when the 'all' option isn't
used.
This commit refactors the Test_Export_Includes_Attachments test class to use protected static properties for the post and attachment variables. It also introduces a second test post with a different author and an attached file. The test method has been updated to check for post IDs instead of post titles to make the assertions more robust.

Additionally, the test now ensures that the export function only includes posts and attachments for the specified author, and it verifies this by asserting the count of items in the exported XML. These changes improve the test coverage and make the test more reliable.
@electricbrick
Copy link

electricbrick commented Sep 10, 2023

If support for PHP versions < v7 has been dropped, why is a unit test for 5.6 holding up the merge of a patch for a 12 year old Trac ticket?

@nate-allen
Copy link
Author

@electricbrick Should I close this pull request and open a new one? That would trigger a new checks on the code that don't include PHP 5.6.

@electricbrick
Copy link

@nate-allen Good question... By the way, my reply was meant more for maintainers to see activity on the ticket, and not shade @ you.

is a new PR against the rules? Because maybe it would work — are there potentially unforeseen consequences though? An alternative is someone could show up at the Make Slack contributors stand-up and advocate for it. I don't know if that's still held on Wednesdays.

@nate-allen nate-allen closed this Nov 29, 2023
@nate-allen nate-allen deleted the trac-17379 branch November 29, 2023 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants