Skip to content

The third example doesn't work (post__in should be comma-separated post IDs.) #65

Description

@DrLightman

Bug Report

Describe the current, buggy behavior

Here, there are listed three wp export examples. The third is broken:

# Export a random subset of content
$ wp export --post__in="$(wp post list --post_type=post --orderby=rand --posts_per_page=8 --format=ids)"
Starting export process...
Writing to file /var/www/example.com/public_html/staging.wordpress.2016-05-24.000.xml
Success: All done with export.

Because the subcommand returns the list as a space-separated list of ids, whereas --post__in expect the list to be comma-separated.

Here is my output:

D:\Siti\wordpress>wp export --max_file_size=-1 --with_attachments --post__in="$(wp post list --post_type=post --posts_per_page=-1 --format=ids --category_name=subcat)"
Warning: post__in should be comma-separated post IDs.

Output of the subcommand alone is, infact:

D:\Siti\wordpress>wp post list --post_type=post --posts_per_page=-1 --format=ids --category_name=subcat
82 80 78

I know this is not strictly related to the export command, but I suppose it makes sense to post it in here since the example has been found in its page.

That said, I'd really liked that example to work because I needed to overcome the fact that --category doesn't seem to work and I decided to generate a list of post ids belonging to the category and pass it via the subcommand. :(

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions