Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
[wp-cli] wp-cli と jq で wp-cron に登録されているイベントをすべて実行する
wp="wp --path=${wp_root}"
hooks=`${wp} cron event list --format=json | jq -r '.[] | select(.next_run_relative == "now") | .hook'`
for hook in ${hooks} ; do
echo "***** run event ${hook} *****"
${wp} cron event run ${hook}
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment