The Flexibility of the WP-CLI Configuration Files

The Flexibility of the WP-CLI Configuration Files

Let's talk about configuration files, not WordPress configuration, but WP-CLI configuration files. If you are hosting your WordPress installations on Apache, you most likely have the bright module enabled in your WP-CLI config file, if you want to have pretty permalinks working. This config file in your user directory and is convenient for defining those things you often repeat in every project, such as subcommand defaults for example. But then we all have that one project that is different from all the others, and it needs a complete set of different configurations.

What then? You could set multiple WP-CLI config files in various places with the highest priority being the one in WordPress install directory. This config file will override the global one.

But what if you don't want to override all of it? What if you want to keep those subcommand defaults from an upstream config file, but also want to change some other things specific for this project? You can do that, by setting merge to "true" for the _configuration option. Find out more in config file section here.

This tip is brought to you by Milana Cap

要查看或添加评论,请登录

Bob Dunn的更多文章

社区洞察

其他会员也浏览了