Skip to content

Instantly share code, notes, and snippets.

@Vinsanity
Created January 7, 2018 22:18
Show Gist options
  • Save Vinsanity/38ac9a91aa85abf097a3a2a6652e8262 to your computer and use it in GitHub Desktop.
Save Vinsanity/38ac9a91aa85abf097a3a2a6652e8262 to your computer and use it in GitHub Desktop.
WP CLI post creation in docker
for i in {1..10}; do bash -xc "curl http://loripsum.net/api/5 | wp --allow-root post create - --post_title='Post $i' --post_type=page --post_status=publish --post_category=$(wp --allow-root term list category --field=id --number=1 --offset=$(shuf -i 0-9 -n 1)) --tags_input='$(wp --allow-root term list post_tag --field=name --number=1 --offset=$(shuf -i 0-99 -n 1))'"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment