Skip to content

Instantly share code, notes, and snippets.

@ajdinmore
ajdinmore / wp_cron_multisite.sh
Created February 25, 2019 16:20
WordPress Multisite Cron Shell Script
#!/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
/*
* Goes in your theme's functions.php, replace '/img/default-image.jpg' with
* the path to the custom placeholder image in your theme.
*/
add_filter ('woocommerce_placeholder_img_src', () => get_stylesheet_directory_uri() . '/img/default-image.jpg');