Skip to content

Update documentation for new cli_init action. #578

Description

@jmichaelward

wp-cli/wp-cli#4818 introduces a "cli_init" hook during the Runner startup process that allows developers to register their custom commands by hooking into a specific event instead of checking for the definition and existence of the WP_CLI constant.

Developers can continue to check in the traditional way, but in order to communicate the existence of this hook to the broader community, we will need to update WP-CLI documentation to present examples on how this hook may be used. This includes:

  • Example code showing the hook in action
  • Extending the hook reference
  • Checking scaffolded packages for any necessary changes

Per Alain, "the WP_CLI constant example should stay, though. Using the cli_init hook is an alternative, not a replacement, depending on what your needs are."

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions