A new version of WP-CLI is here. The highlights:
Manage more things
There are brand new top-level commands for dealing with more types of objects in a WordPress install:
wp super-adminfor managing caped admins on multisitewp menufor managing navigation menuswp widgetandwp sidebarfor managing widgets and sidebarswp theme modfor managing theme mods
Exporting only particular database tables
With the new wp db tables subcommand, you can generate a list of database tables, which you can pass to the wp db export command, like so:
wp db export --tables=$(wp db tables --url=sub.example.com | tr '\n' ',')
Composability is beautiful.
Arbitrary command nesting
Up until now, you could only have top-level commands, like wp search-replace and second-level subcommands, like wp core install. Now, you can have commands at any depth, such as wp post meta update.
This capability is especially useful to third-party commands, such as wp-cli-buddypress.
Revamped bash completions
Bash completions are now a bit smarter: besides auto-completing positional parameters like --dbname=, it will also suggest file names, if the subcommand you’re writing out expects a file name.
Note that after updating wp-cli.phar, you will also have to update the wp-completion.bash file.
Other changes
- added support for WordPress 3.9 and bumped minimum required version to 3.5
- disable KSES filtering when a user is not explicitly set
- allow defining
skip-pluginsandwp core config --extra-phpin thewp-cli.ymlfile - added
wp role resetsubcommand - added
wp transient delete-allandwp transient delete-expiredsubcommands wp core config: added--skip-checkflagwp core is-installed: added--networkflagwp user create: added--send-emailflagwp user delete: added--networkflagwp option add: added--autoload=parameterwp search-replace: now works with tables that have a composite primary keywp post create: fixed handling of--post_category=parameterwp eval-file: allow passing arbitrary arguments to the file
You can browse the full list of resolved issues on GitHub.
Contributors to this release: clemens-tolboom, danielbachhuber, francescolaffi, itsananderson, johnpbloch, mattheu, nyordanov, Rarst, robertboloc, rodrigoprimo, sboisvert, scribu, szepeviktor, trepmal.
Survey
We’d like to know how people are using WP-CLI so we set up a quick survey (just 5 questions). We’d appreciate it if you would fill it out. The results will be posted here, in a separate blog post.
