Last active
July 13, 2022 12:13
-
-
Save chrisjangl/9bd4f4f81a20d93e59392110a7ace1d8 to your computer and use it in GitHub Desktop.
WP CLI script to update active plugins, and commit each update individually. 99% percent stolen from https://markjaquith.wordpress.com/2018/02/12/updating-plugins-using-git-and-wp-cli/, (ever so slightly) adapted to my own personal workflow
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
for plugin in $(wp plugin list --update=available --status=active --field=name); | |
do | |
TITLE=$(wp plugin get $plugin --field=title) | |
wp plugin update $plugin && | |
VERSION=$(wp plugin get $plugin --field=version) | |
git add -A wp-content/plugins/$plugin && | |
git commit -m "$(printf "update plugin: $TITLE to $VERSION")" | |
echo "$TITLE -> $VERSION" >> updated.txt | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment