WP-CLI 命令行手册

title: "WP_CLI\Utils\launch_editor_for_input()" post_status: publish comment_status: open taxonomy: category: - wp-cli-handbook post_tag: - Internal Api - Repos - Data


WP_CLI\Utils\launch_editor_for_input()

启动系统的 $EDITOR 编辑器供用户编辑文本。


用法

WP_CLI\Utils\launch_editor_for_input( $input, $title = WP-CLI, $ext = tmp )
$input (string) 待编辑的文本内容(例如文章内容)。
$title (string) 在编辑器中显示的标题。
$ext (string) 临时文件使用的扩展名。
@return (string|bool) 如果文件从编辑器保存,则返回文本;如果文件未更改,则返回 false。

内部 API 文档在每个版本发布时从 WP-CLI 代码库生成。如需改进建议,请提交拉取请求。


相关函数