WP CLI说明文档

wp theme disable

命令概述

用于在WordPress多站点安装中,禁止某个主题在站点仪表盘中被激活。

适合需要限制特定主题在子站点中激活的场景,可配合网络级别禁用使用。

参数列表

参数 说明
<theme> 要禁用的主题。
[--network] 如果设置,则在网络级别禁用该主题。注意:如果之前已单独启用,个别站点可能仍保留启用状态。

常用示例

禁用主题

$ wp theme disable twentysixteen
Success: Disabled the 'Twenty Sixteen' theme.

在网络级别禁用主题

$ wp theme disable twentysixteen --network
Success: Network disabled the 'Twenty Sixteen' theme.