title: "WP_CLI::halt()" post_status: publish comment_status: open taxonomy: category: - wp-cli-handbook post_tag: - Internal Api - References - Repos
WP_CLI::halt()
使用指定的返回码停止脚本执行。
用法
WP_CLI::halt( $return_code )
$return_code (integer)
@return (never)
@return (never)
说明
允许脚本执行被 WP_CLI::runcommand() 重载。
内部 API 文档基于每个发布版本的 WP-CLI 代码库生成。如需改进,请提交拉取请求。
相关
- WP_CLI\Utils\format_items() - 将项目集合渲染为 ASCII 表格、JSON、CSV、YAML、ID 列表或计数。
- WP_CLI\Utils\make_progress_bar() - 创建进度条以显示给定操作的完成百分比。
- WP_CLI::colorize() - 为输出字符串着色。
- WP_CLI::line() - 显示不带前缀的信息性消息,并忽略 `--quiet`。
- WP_CLI::log() - 显示不带前缀的信息性消息。
- WP_CLI::success() - 显示以“Success: ”为前缀的成功消息。
- WP_CLI::debug() - 当使用 `--debug` 时,显示以“Debug: ”为前缀的调试消息。
- WP_CLI::warning() - 显示以“Warning: ”为前缀的警告消息。
- WP_CLI::error() - 显示以“Error: ”为前缀的错误消息并退出脚本。
- WP_CLI::error_multi_line() - 在红色框中显示多行错误消息。不退出脚本。