Skip to content

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

Merged
schlessera merged 3 commits intomasterfrom
fix/67-skip-unneeded-authors
Jul 25, 2021
Merged

Only add needed user when filtering by --author#88
schlessera merged 3 commits intomasterfrom
fix/67-skip-unneeded-authors

Conversation

@schlessera
Copy link
Copy Markdown
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 bug command:export Related to 'export' command labels Jul 25, 2021
@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
Copy Markdown

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
Copy Markdown

pjv commented Aug 10, 2021

Hello @schlessera ^^

@schlessera
Copy link
Copy Markdown
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
Copy Markdown

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

Labels

bug command:export Related to 'export' command

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