there are a handful of WP-CLI commands that i regularly use on my other hosting accounts/servers that are not allowed on WPMU hosting. as an example:
wp transient delete --all --network && wp site list --field=url | xargs -n1 -I % wp --url=% transient delete --all; wp cache flush --all --network && wp site list --field=url | xargs -n1 -I % wp --url=% cache flush --all
is there a way that we can go about using that command?
also… on some of my larger MU installs, i had created files called wp-cron.sh. they functioned as a single point to run MU crons. here’s an example of the file, if it were located on WPMU hosting:
#!/bin/bash
clear
echo "$(tput setaf 4)############## $(tput sgr 0)";
echo "$(tput setaf 3)$(tput bold) HILINEMERCH.com $(tput sgr 0)";
echo "$(tput setaf 4)############## $(tput sgr 0)";
echo "";
PATH_TO_WORDPRESS="~/site/public_html/"
echo "";
echo "$(tput setaf 3)$(tput bold)>> CRON - Run on Each Sub-Site $(tput sgr 0)";
echo "";
for URL in = $(wp site list --fields=url --format=csv --path="$PATH_TO_WORDPRESS")
do
if [[ $URL == "http"* ]]; then
wp cron event run --all --due-now --url="$URL" --path="$PATH_TO_WORDPRESS"
fi
done
echo "$(tput setaf 4) ########### $(tput sgr 0)";
echo "";
echo "$(tput setaf 3)$(tput bold)>> ACTION-SCHEDULER - Run on Each Sub-Site $(tput sgr 0)";
echo "";
for URL in = $(wp site list --fields=url --format=csv --path="$PATH_TO_WORDPRESS")
do
if [[ $URL == "http"* ]]; then
wp action-scheduler run --url="$URL" --path="$PATH_TO_WORDPRESS" --force
fi
done
echo "$(tput setaf 4) ########### $(tput sgr 0)";
echo "";
echo "$(tput setaf 3)$(tput bold)>> WOO UPDATE - Run on Each Sub-Site $(tput sgr 0)";
echo "";
for URL in = $(wp site list --fields=url --format=csv --path="$PATH_TO_WORDPRESS")
do
if [[ $URL == "http"* ]]; then
wp wc update run --url="$URL" --path="$PATH_TO_WORDPRESS" --force
fi
done
…so… is there any way to run commands like these on WPMU hosting?