Created
February 25, 2018 20:36
-
-
Save BenBroide/d132892752f9d052889e45f60b1ee2c5 to your computer and use it in GitHub Desktop.
WP CLI - update post meta to many posts by wp post list result
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POSTIDLIST=($(wp post list --post_type=booking --format=ids)); | |
for POSTID in ${POSTIDLIST[@]}; do | |
wp post meta set $POSTID _field_name field_value | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment