2015 is an exciting time for WP-CLI. WP-API is days away from 2.0-beta1, and brings with it a powerful new interface to WordPress. In the near future, we’ll start exploring how WP-CLI can use WP-API internally. If all goes well, WP-CLI could see just one more 0.x.0 release before the big 1.0.0.
wp plugin scaffold is a great way to get started on your next WordPress plugin. It automates many procedural steps you can easily forget to do, or need to copy and paste out of another plugin. v0.19.0 brings these improvements:
bin/install-wp-tests.shwill use either cURL or wget, depending on which is available. The script is also more fault tolerant.
- Use the
--dir=<path-to-dir>argument to scaffold your new plugin to an arbitrary directory (e.g. mu-plugins or a theme folder).
- For custom projects, use the
--activate-networkflag to network activate the plugin after creation.
- Generates a Gruntfile with two helpful tasks:
grunt readmeto build a
grunt i18nto create a
- The default
.travis.ymlhas increased maximum tested PHP version to 5.5, is more smart about the build matrix it generates, and changes notifications preferences to only email developers on build failures.
Other changes in v0.19.0
wp option listlists all options, or searching for specific options based on a pattern. Use
--format=total_bytesto get the total bytes for the matching options.
wp search-replaceto perform replacements against all tables in the database. In 0.17.0, we changed the behavior of
wp search-replaceto only affect tables registered to
$wpdb. This new flag permits users to opt-in to all tables.
- When scaffolding a child theme, the parent theme’s stylesheet is enqueued, instead of being loaded via
- Added a
wp core language updatecommand to update language files.
- Added a
wp scaffold post-typewhich will specify the icon for the post type.
- Added a
wp scaffold _sto download the SASS version of
- MySQL binary commands execute with
--no-auto-rehashfor a substantial performance boost on larger databases.
- On export, taxonomy terms with missing parents are explicitly identified to make them easier to fix.
- When updating an option or post/user/comment meta and the supplied value is the same as the stored value, the success message indicates such.
wp post term list.
wp media regenerate. This is helpful on sites where thumbnails might’ve been linked to within post content. Skipping deletion prevents breaking image references.
after_invokehook for any post-command execution tasks.
- Supports filtering by site value in
wp site list.
- Added archive/unarchive, activate/deactivate and spam/not-spam subcommands to
- Added a summary table to output of
wp theme updateand
wp plugin update. This makes it easier to parse the final results when you’re updating a number of themes or plugins in one go.
- On multisite, user creation is run through
wpmu_create_user(), which perform multisite-specific validation rules.
- The object cache is periodically cleared on import to prevent excess memory usage.
- Nightly builds are accompanied by checksums.
\WP_CLI\Utils\get_flag_value()helper function to fix a systemic problem throughout WP-CLI. Read through this issue for the full details.
- Provides a human-friendly error when an invalid class is specified for a command. The prior behavior was to fatal error.
- Correctly sets
sslverifyargument when testing WP-Cron.
- Importer throws a hard error if process to import a file returns
WP_Errorto report that an author mapping file needs to be updated. However, when importing a directory of WXR files, the prior logic to use
WP_CLI::warning()means the second file will use the author mapping file of the first, which should’ve been edited.
- Comment meta values are wrapped in CDATA tags on export.
wp core multisite-installand
wp core multisite-convertwill properly include
define( 'WP_ALLOW_MULTISITE', true );constant.
- https scheme is honored for the
wp post term listdisplays error for an invalid taxonomy.
- Provides a human-friendly error when an incorrect version or locale was supplied for
wp core downloadThe prior behavior was to fatal error.
wp cron event schedulerespects the
- Child themes aren’t permitted to be activated without their parent installed.
- Themes are network enabled based on stylesheet value, not template. Previously, it wasn’t possible to network-enable a child theme because of this bug.
You can browse the full list of resolved issues on Github.
Contributors to this release: 2ndkauboy, acusti, bobbywalters, bmackinney, danielbachhuber, francescolaffi, heiglandreas, hirozed, jeichorn, johnbillion, joshbetz, jpry, keeth, mavin, morganestes, mwithheld, nyordanov, rodrigoprimo, sebastiaandegeus, szepeviktor, wrnx, yivi