WP CLI说明文档

wp theme enable

命令概述

用于在WordPress多站点网络中启用主题,使其可在站点仪表板中激活。

适合在多站点环境下管理主题的启用状态,支持网络级启用和站点级激活。

参数列表

参数 说明
<theme> 要启用的主题。
[--network] 如果设置,主题将在整个网络中启用。
[--activate] 如果设置,主题将在当前站点激活。注意:network标志对此无影响。

常用示例

启用主题

$ wp theme enable twentysixteen
Success: Enabled the 'Twenty Sixteen' theme.

网络启用主题

$ wp theme enable twentysixteen --network
Success: Network enabled the 'Twenty Sixteen' theme.

网络启用并激活当前站点主题

$ wp theme enable twentysixteen --activate
Success: Enabled the 'Twenty Sixteen' theme.
Success: Switched to 'Twenty Sixteen' theme.