Created
February 25, 2019 16:20
-
-
Save ajdinmore/86ff965f2116fbb1454715494ca1613b to your computer and use it in GitHub Desktop.
WordPress Multisite Cron Shell Script
This file contains 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
#!/bin/bash | |
WP_PATH="/srv/example/public_html" | |
for SITE_URL in $(wp site list --field=url --archived=0 --deleted=0 --path="$WP_PATH") | |
do | |
echo -e "\n$SITE_URL" | |
wp cron event run --due-now --path="$WP_PATH" --url="$SITE_URL" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment