This is article 2 of 2 in the series “Automating Local WordPress Site Setup with Scripts” Automating Local WordPress Site Setup with Scripts Part 2: Creating a WP-CLI Package
In my previous article in this series, I discussed some simple ways to make working with local WordPress development environments a bit easier by using shell scripts to automate the more repetitive tasks, such as installing and deleting WordPress sites.
Soon after publishing that post, Daniel Bachuber mentioned that the scripts could have been written up as a WP-CLI command, which led me to realize that there are quite a few good reasons to do so –
I’m more comfortable in PHP than I am in Shell
The Shell scripts were mostly firing off WP-CLI commands anyway
WP-CLI can handle a lot of the leg work regarding parameter validation and documentation
WP-CLI commands can be easily shared via the Package Index
In this article, we’ll look at automating things a bit further and converting the scripts to WP-CLI commands. We’ll also look at how we can use the WP-CLI Package Index to make things easier and share our workflows with other developers.
Creating a WP-CLI Command
Let’s get
Source: https://managewp.org/articles/13652/automating-local-wordpress-site-setup-with-scripts-part-2-creating-a-wp-cli-package
source https://williechiu40.wordpress.com/2016/10/18/automating-local-wordpress-site-setup-with-scripts-part-2-creating-a-wp-cli-package/
No comments:
Post a Comment