WP-CLI 命令行手册

title: "wp language core install" post_status: publish comment_status: open taxonomy: category: - wp-cli-handbook post_tag: - Core - Language - Commands


wp language core install

安装指定的语言。

从 WordPress.org 下载语言包。请在此处查找您的语言代码:https://translate.wordpress.org/

选项

有关所用语法约定的详细说明,请参阅参数语法参考。

<language>... : 要安装的语言代码。

[--activate] : 如果设置,安装后将立即激活该语言。

示例

# 安装巴西葡萄牙语。
$ wp language core install pt_BR
Downloading translation from https://downloads.wordpress.org/translation/core/6.5/pt_BR.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the translation...
Translation updated successfully.
Language 'pt_BR' installed.
Success: Installed 1 of 1 languages.

全局参数

这些全局参数在所有命令中具有相同的行为,并影响 WP-CLI 与 WordPress 的交互方式。

参数 描述
--path=<path> WordPress 文件的路径。
--url=<url> 模拟请求来自给定的 URL。在多站点中,此参数用于指定目标站点。
--ssh=[<scheme>:][<user>@]<host\|container>[:<port>][<path>] 通过 SSH 对远程服务器执行操作(或使用 "docker"、"docker-compose"、"docker-compose-run"、"vagrant" 方案对容器执行操作)。
--http=<http> 通过 HTTP 对远程 WordPress 安装执行操作。
--user=<id\|login\|email> 设置 WordPress 用户。
--skip-plugins[=<plugins>] 跳过加载所有插件,或跳过加载以逗号分隔的插件列表。注意:mu-plugins 仍会被加载。
--skip-themes[=<themes>] 跳过加载所有主题,或跳过加载以逗号分隔的主题列表。
--skip-packages 跳过加载所有已安装的包。
--require=<path> 运行命令前加载 PHP 文件(可多次使用)。
--exec=<php-code> 运行命令前执行 PHP 代码(可多次使用)。
--context=<context> 在给定的上下文中加载 WordPress。
--[no-]color 是否对输出进行着色。
--debug[=<group>] 显示所有 PHP 错误并增加 WP-CLI 输出的详细程度。内置组包括:bootstrap、commandfactory 和 help。
--prompt[=<assoc>] 提示用户输入所有命令参数的值,或输入以逗号分隔的指定子集的值。
--quiet 抑制信息性消息。