Last active
May 24, 2018 07:24
-
-
Save dikiyforester/0a0da49ceabf616227943229451a1e3b to your computer and use it in GitHub Desktop.
Bash script to create a new fresh WordPress site install within a network (using wp cli)
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 | |
if [ $# -lt 1 ]; then | |
echo "usage: $(basename $0) <new-site-slug> [<theme-slug>, <plugin-slug>]" | |
exit 1 | |
fi | |
wp site delete --slug="$1" | |
wp site create --slug="$1" | |
if [ $# -ge 1 ]; then | |
wp theme activate "$2" --url="http://wp.home/$1" | |
fi | |
if [ $# -ge 2 ]; then | |
wp plugin activate "$3" --url="http://wp.home/$1" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where
http://wp.home/
is the network URLUsage:
It will re-install new site with
cp-new
slug and activateclassipress
theme withcritic
plugin