Skip to content

Commit 23f6589

Browse files
committed
remove extraneous themes
1 parent 14f4863 commit 23f6589

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

setup-wordpress.sh

+22
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ wordpress-importer
3636
ACTIVATE_THEMES='
3737
vocabulary-theme
3838
'
39+
REMOVE_THEMES='
40+
twentytwentyone
41+
twentytwentytwo
42+
'
3943
WEB_WP_DIR=/var/www/html
4044
WEB_WP_URL=http://localhost:8080
4145

@@ -136,6 +140,23 @@ install_wordpress() {
136140
}
137141

138142

143+
remove_themes() {
144+
local _theme
145+
header 'Remove extraneous WordPress themes'
146+
for _theme in ${REMOVE_THEMES}
147+
do
148+
if ! wpcli --no-color --quiet theme is-installed "${_theme}" \
149+
> /dev/null
150+
then
151+
echo "no-op: ${_theme} is not installed"
152+
else
153+
wpcli theme delete "${_theme}"
154+
fi
155+
done
156+
echo
157+
}
158+
159+
139160
utils_info() {
140161
header 'Utilities info'
141162
docker compose run --rm composer --version 2>/dev/null
@@ -181,6 +202,7 @@ wpcli() {
181202
utils_info
182203
composer_install
183204
install_wordpress
205+
remove_themes
184206
activate_plugins
185207
activate_themes
186208
enable_permalinks

0 commit comments

Comments
 (0)