Version 0.12 released

It’s been almost two months since the last major releaseMajor Release A set of releases or versions having the same major version number may be collectively referred to as “X.Y” -- for example version 5.2.x to refer to versions 5.2, 5.2.1, and all other versions in the 5.2. (five dot two dot) branch of that software. Major Releases often are the introduction of new major features and functionality.. We have a few neat features to show you:

wp site list command

I predict that this will turn out to be the most useful command for managing multisiteMultisite Multisite is a WordPress feature which allows users to create a network of sites on a single WordPress installation. Available since WordPress version 3.0, Multisite is a continuation of WPMU or WordPress Multiuser project. WordPress MultiUser project was discontinued and its features were included into WordPress core.https://codex.wordpress.org/Create_A_Network. installs, because you can use it to loopLoop The Loop is PHP code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags. Any HTML or PHP code in the Loop will be processed on each post. https://codex.wordpress.org/The_Loop. through all of them, directly from bash even:

for url in $(wp site list --field=url)
do
    echo "$url:"
    wp --url=$url post list
done

New --field= parameter

Notice the --field=url parameter I used above? It’s available for all commands that display some information. A few examples:

wp post get 123 --field=content

wp user list --field=username

This will retrieve only the content of the post with ID 123 and nothing else.

Experimental --prompt global parameter

This nifty little parameter changes the behaviour of commands when required arguments are not passed to a command. Instead of showing an error and exiting, it prompts you for the value of each argument. Try it out:

wp theme scaffold --prompt

Phar archives are back

They were originally introduced in version 0.9 and… ahem, naively abandoned in the next release with the introduction of the installer script.

The installer uses Composer, which has its own environmental requirements, but, more importantly, it has to fetch all of the packages WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/ https://make.wordpress.org/cli/ depends on, which is both less reliable and slower than downloading a single file that contains everything.

This is particularly important in a continuous integration environment, like Travis CI, where you want to have your builds run as fast as possible and fail only due to failing tests, not due to a faulty internet connection.

So, phar archives can be downloaded from the wp-cli/builds repository.

Breaking changes

  • wp post get --format=content was replaced with wp post get --field=content
  • the wp rewrite dump command was replaced with wp rewrite list
  • the wp comment last command was removed (use wp comment list instead)

Other non-obvious changes

  • wp search-replace no longer touches serialized objects (#792)
  • WP-CLI will display PHPPHP PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php. errors on STDERR, even if XDebug is not installed (#786)

New commands

  • wp comment get, wp comment update and wp comment exists
  • wp plugin get and wp theme get
  • wp plugin search and wp theme search
  • wp plugin is-installed and wp theme is-installed
  • wp user add-cap, wp user remove-cap and wp user list-caps

You can browse the full list of resolved issues on GithubGitHub GitHub is a website that offers online implementation of git repositories that can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/.

Contributors to this release: c10b10, danielbachhuber, getsource, goldenapples, jmslbam, johnbillion, joshbetz, jtsternberg, mattes, MattiaG, mpeshev, nikolay, nullvariable, oknoway, Rarst, scribu, smhmic, stianlik, thisislawatts, trepmal, westonruter.