1

https://make.wordpress.org/cli/handbook/config/#config-files is pretty good, but I'd like to have some more logic in my configuration. Is there a standard way for this?

For drush I have .drush/aliases.drushrc.php, which includes scripts from various Drupal repositories, which in turn contain the logic to handle various sites and variations (production, development). I'd like to have something similar for wp-cli, and YAML doesn't provide me with the right tools for what I want.

1 Answer 1

1

The WP CLI aliases are mostly for context. WP CLI uses Drush as a source of inspiration, but Drush has a much more robust implementation of aliases.

If it were me, I would include other scripts and complex logic as a custom command.

WP_CLI::add_command( 'core foo', 'Foo_Command' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.