WP-CLI 命令行手册

title: "WP_CLI::log()" post_status: publish comment_status: open taxonomy: category: - wp-cli-handbook post_tag: - Internal Api - References - Repos


WP_CLI::log()

显示不带前缀的信息性消息。


用法

WP_CLI::log( $message )
$message (string) 要写入 STDOUT 的消息。

说明

消息会写入 STDOUT,当提供 --quiet 标志时会被丢弃。

# `wp cli update` 让用户了解更新过程中的每个步骤。
WP_CLI::log( sprintf( '正在从 %s 下载...', $download_url ) );

内部 API 文档在每次发布时从 WP-CLI 代码库生成。如需改进,请提交 pull request。


相关