WP CLI说明文档

wp theme upgrade

命令概述

该命令是 wp theme update 的别名,用于更新一个或多个WordPress主题。

适合在需要批量更新主题、指定版本更新或排除特定主题时使用。

参数列表

参数 说明
[<theme>...] 一个或多个要更新的主题。
[--all] 如果设置,将更新所有有更新的主题。
[--exclude=<theme-names>] 应从更新中排除的主题名称的逗号分隔列表。
[--minor] 仅执行次要版本的更新(例如从1.3到1.4,而不是2.0)。
[--patch] 仅执行补丁版本的更新(例如从1.3到1.3.3,而不是1.4)。
[--format=<format>] 以特定格式渲染输出。默认:table。选项:table、csv、json、summary。
[--version=<version>] 如果设置,主题将更新到指定版本。
[--dry-run] 预览哪些主题将被更新。
[--insecure] 如果TLS握手失败,不验证证书重试下载。注意:这会使请求容易受到MITM攻击。

常用示例

更新多个主题

$ wp theme update twentyfifteen twentysixteen

批量更新时排除特定主题

$ wp theme update --all --exclude=twentyfifteen

更新所有主题

$ wp theme update --all