https://guides.wp-bullet.com/using-wp-cli-for-batch-updating-contact-form-7-postmeta-options/
wp post-type list
wp help post
wp help taxonomy
wp help term ...
You should scroll down (press J key as vim naviate) to see Example usage.
wp db query "SELECT meta_value FROM $(wp db prefix --allow-root)postmeta WHERE post_id = 300 AND meta_key = '_mail'" --allow-root
wp post list --post_type=wpcf7_contact_form --allow-root
wp post meta list 300 --allow-root
Accessing Serialized postmeta with WP-CLI
Scripting with WP-CLI
In this simple bash script we create an array of all the Contact Form 7 post_ids.
Then we use the post meta patch command to update each programatically via a for loop through the array.
POSTIDLIST=($(wp post list --post_type=wpcf7_contact_form --field=ID --allow-root))
for POSTID in ${POSTIDLIST[@]}; do
wp post meta patch update ${POSTID} _mail use_html 1 --allow-root
done
wp post list --fields=ID,mycustomfield --meta_key=mycustomfield '--meta_compare=active'
Time filter
wp post list --post_type=post --format=ids --year=2015
wp post list --post_type=post --format=ids --date_query='{"before":{"year":"2015"}}'
wp post list --post_type=product_variation --post_parent=56332
List post meta
wp post meta list 50527
wp term list categories
wp post term list ...
wp taxonomy list
https://github.com/wp-cli/wp-cli
Future will use $ wp rest api ?
WP user
wp user list --fields=ID,user_pass,user_email
Example show --field=ID (not feild_S) -> magnificent
wp post-type list
wp help post
wp help taxonomy
wp help term ...
You should scroll down (press J key as vim naviate) to see Example usage.
wp db query "SELECT meta_value FROM $(wp db prefix --allow-root)postmeta WHERE post_id = 300 AND meta_key = '_mail'" --allow-root
wp post list --post_type=wpcf7_contact_form --allow-root
wp post meta list 300 --allow-root
Accessing Serialized postmeta with WP-CLI
Scripting with WP-CLI
In this simple bash script we create an array of all the Contact Form 7 post_ids.
Then we use the post meta patch command to update each programatically via a for loop through the array.
POSTIDLIST=($(wp post list --post_type=wpcf7_contact_form --field=ID --allow-root))
for POSTID in ${POSTIDLIST[@]}; do
wp post meta patch update ${POSTID} _mail use_html 1 --allow-root
done
wp post list --fields=ID,mycustomfield --meta_key=mycustomfield '--meta_compare=active'
Time filter
wp post list --post_type=post --format=ids --year=2015
wp post list --post_type=post --format=ids --date_query='{"before":{"year":"2015"}}'
wp post list --post_type=product_variation --post_parent=56332
List post meta
wp post meta list 50527
wp term list categories
wp post term list ...
wp taxonomy list
https://github.com/wp-cli/wp-cli
Future will use $ wp rest api ?
WP user
wp user list --fields=ID,user_pass,user_email
Example show --field=ID (not feild_S) -> magnificent
veororgu-gi Evgeni Shu click
ReplyDeleteresarepot