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. :(
Bug Report
Describe the current, buggy behavior
Here, there are listed three
wp export
examples. The third is broken:Because the subcommand returns the list as a
space-separated
list of ids, whereas --post__in expect the list to becomma-separated
.Here is my output:
Output of the subcommand alone is, infact:
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. :(