Created
March 9, 2019 04:03
-
-
Save bhubbard/44ace4313ff5719b9494c7ac2c502cc8 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# purpose delete inactive WordPress themes | |
WPPATH="" | |
WPFLAGS="--path=${WPPATH} --skip-plugins --skip-themes --allow-root" | |
THEMEEXCEPTIONS=( | |
twentynineteen | |
) | |
THEMELIST=($(wp theme list --fields=name --status=inactive ${WPFLAGS})) | |
for THEME in ${THEMELIST[@]} | |
do | |
if [[ ! " ${THEMEEXCEPTIONS[@]} " =~ " ${THEME} " ]]; then | |
wp theme delete ${THEME} ${WPFLAGS} | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would this delete a parent theme provided when a child is active?