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

Use get_post_stati() instead of get_post_statuses() to support all registered post statuses in export #121

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

ouikhuan
Copy link
Contributor

Fixes #120

When using the export command, only posts with statuses returned by get_post_statuses() (publish, pending, draft, private) can be exported. This excludes other valid WordPress post statuses like 'future' for scheduled posts and any custom post statuses.

Proposed changes

  • Replaced get_post_statuses() with get_post_stati() in the export command
  • This change allows exporting posts with any status that is registered in WordPress

@ouikhuan ouikhuan requested a review from a team as a code owner January 16, 2025 11:13
Copy link
Member

@swissspidy swissspidy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me!

Looks like it was this way ever since this command was first built.

@swissspidy swissspidy added this to the 2.1.14 milestone Jan 16, 2025
@swissspidy swissspidy merged commit 2eb9ad1 into wp-cli:main Jan 16, 2025
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export functionality limited to hardcoded post statuses
2 participants