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

Only add needed user when filtering by --author #88

Merged
merged 3 commits into from
Jul 25, 2021

Conversation

schlessera
Copy link
Member

Instead of adding all users unconditionally, only add the one user that is needed when filtering by a specific --author.

Fixes #67

@schlessera schlessera requested a review from a team as a code owner July 25, 2021 16:07
@schlessera schlessera added this to the 2.0.9 milestone Jul 25, 2021
@schlessera schlessera merged commit 1215104 into master Jul 25, 2021
@schlessera schlessera deleted the fix/67-skip-unneeded-authors branch July 25, 2021 16:16
@pjv
Copy link

pjv commented Aug 3, 2021

@schlessera I’m not sure if I am understanding correctly what this patch is supposed to do, or if I am using the export cli command correctly, but if I do and I am, then this patch doesn’t seem to be doing what I think it should be doing.

Here’s my steps and my results:

  1. I updated wp cli on my test site to 2.5.0
  2. I installed the latest master version of export-command over that by doing wp package install git@github.com:wp-cli/export-command.git
  3. I tested the resulting output by exporting a single page from the test site where that page is the only page authored by a specific author using a command like so wp export --post_type=page --author=<my-userid> --skip_comments --stdout > page.xml

The resulting file (page.xml) has thousands of <wp:author> items in it. I expected that it would only have the one for my-userid.

Am I misunderstanding this patch or doing something wrong?

@pjv
Copy link

pjv commented Aug 10, 2021

Hello @schlessera ^^

@schlessera
Copy link
Member Author

@pjv This patch is not part of the v2.5.0 release. To test it, you'll need to use the latest nightly version of WP-CLI. You can update to the latest nightly version with the following command:

wp cli update --nightly

@pjv
Copy link

pjv commented Aug 10, 2021

@schlessera Thank you, but shouldn't doing this:

wp package install git@github.com:wp-cli/export-command.git

override the built-in wp cli export command with the current master branch of this repo?

danielbachhuber pushed a commit that referenced this pull request Nov 18, 2022
Only add needed user when filtering by `--author`
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.

Don't append all authors to WXR if author arg provided
2 participants