Skip to content

Instantly share code, notes, and snippets.

@basterrika
basterrika / update.sh
Created Sep 18, 2020
Handle WordPress and WooCommerce updates
View update.sh
# This file must go in the WordPress installation root
# Core updates on multisite network
if $( wp core is-installed --network ); then
wp core update-db --network
fi
# Handle WooCommerce database updates on multisite if installed
if $( wp plugin is-installed woocommerce ) && $( wp core is-installed --network ); then
for site_id in $( wp site list --field=blog_id ); do