最近更新的页面
WP_CLI::log()
显示不带前缀的信息性消息。 用法 WP_CLI::log( $message ) $message (string) 要写入 STDOUT 的消息。 说明 消息会写入 STDOUT,当提供 -...
WP_CLI::line()
显示不带前缀的信息性消息,并忽略 --quiet 参数。 用法 WP_CLI::line( $message = '' ) $message (string) 要显示给最终用户的消息。 @re...
WP_CLI::launch()
启动一个接管 I/O 的任意外部进程。 用法 WP_CLI::launch( $command, $exit_on_error = true, $return_detailed = false ...
WP_CLI::launch_self()
在新的进程中运行一个 WP-CLI 命令,并复用当前的运行时参数。 用法 WP_CLI::launch_self( $command, $args = [], $assoc_args = [],...
WP_CLI::has_config()
确认全局配置参数是否存在。 用法 WP_CLI::has_config( $key ) $key (string) 要检查的配置参数键名。 @return (bool) 内部 API 文档在每...
WP_CLI::halt()
使用指定的返回码停止脚本执行。 用法 WP_CLI::halt( $return_code ) $return_code (integer) @return (never) 说明 允许脚本执...
WP_CLI::get_php_binary()
获取执行 WP-CLI 时使用的 PHP 二进制文件路径。 用法 WP_CLI::get_php_binary() @return (string) 说明 环境变量允许指定特定的二进制文件。 ...
WP_CLI::get_config()
获取全局配置参数的值。 用法 WP_CLI::get_config( $key = null ) $key (string) 获取特定全局配置参数的值。 @return (mixed) 说明 ...
WP_CLI::error()
Display error message prefixed with "Error: " and exit script. Usage WP_CLI::error( $message, $ex...
WP_CLI::error_multi_line()
在红色方框中显示多行错误信息。不会退出脚本。 用法 WP_CLI::error_multi_line( $message_lines ) $message_lines (array) 要显示的多...
WP_CLI::do_hook()
执行注册到指定钩子的回调函数。 使用方法 WP_CLI::do_hook( $when, $args ) $when (string) 钩子的标识符。 ...$args (mixed) 可选。将...
WP_CLI::debug()
当使用 --debug 参数时,显示以“Debug: ”为前缀的调试信息。 用法 WP_CLI::debug( $message, $group = false ) $message (str...
WP_CLI::confirm()
在执行破坏性操作前请求确认。 使用方法 WP_CLI::confirm( $question, $assoc_args = [] ) $question (string) 提示前显示的问题。 $...
WP_CLI::colorize()
为输出内容添加颜色。 用法 WP_CLI::colorize( $string ) $string (string) 需要添加颜色标记的字符串,包含颜色标记。 @return (string) ...
WP_CLI::add_wp_hook()
向 WordPress 动作或过滤器添加回调函数。 用法 WP_CLI::add_wp_hook( $tag, $function_to_add, $priority = 10, $accept...
WP_CLI::add_hook()
安排一个回调函数在特定时间点执行。 用法 WP_CLI::add_hook( $when, $callback ) $when (string) 钩子的标识符。 $callback (mixed...
WP_CLI::add_command()
Register a command to WP-CLI. Usage WP_CLI::add_command( $name, $callable, $args = [] ) $name (st...
When /^I (run|try) `([^`]+)`$/
运行或尝试执行给定的命令。 用法 run 期望退出码为 0,而 try 允许非零退出码。 因此,如果使用 run 且命令出错,该步骤将失败。 Scenario: 我的示例场景 When ...
When /^I (run|try) the previous command again$/
再次运行或尝试运行上一条命令。 用法 run 期望退出码为 0,而 try 允许非零退出码。 场景:我的示例场景 当 我运行 `wp site option update admin_us...
When /^I (run|try) `([^`]+)` from '([^\s]+)'$/
在子目录中运行或尝试执行给定的命令。 用法 run 期望退出码为 0,而 try 允许非零退出码。 Scenario: 我的示例场景 When I run `wp core is-inst...