handbook/internal-api/wp-cli-halt.md
github-actions[bot] c22aa665e6 Regenerate handbook
2025-12-17 18:56:32 +00:00

2.6 KiB

WP_CLI::halt()

Halt script execution with a specific return code.


Usage

WP_CLI::halt( $return_code )
$return_code (integer)
@return (never)

Notes

Permits script execution to be overloaded by WP_CLI::runcommand()

When --debug is enabled, this method will also output a backtrace showing where the halt was triggered from, making it easier to identify the cause of early termination.

Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.