admin管理员组文章数量:1415684
I cna get list of widgets with
wp widget list sidebar-1
| search | search-2 | 1 | {"title":""}
| recent-posts | recent-posts-2 | 2 | {"title":"","number":5}
| recent-comments | recent-comments-2 | 3 | {"title":"","number":5}
| categories | categories-2 | 4 | {"title":"","count":0}
| meta | meta-3 | 5 | {"title":""}
I can deactivate meta plugins with:
wp widget deactivate meta-3
My problem is: how can I get the id meta-3 from widget list ? or any other method to deactivate some widgets like meta, recent-comments etc
I cna get list of widgets with
wp widget list sidebar-1
| search | search-2 | 1 | {"title":""}
| recent-posts | recent-posts-2 | 2 | {"title":"","number":5}
| recent-comments | recent-comments-2 | 3 | {"title":"","number":5}
| categories | categories-2 | 4 | {"title":"","count":0}
| meta | meta-3 | 5 | {"title":""}
I can deactivate meta plugins with:
wp widget deactivate meta-3
My problem is: how can I get the id meta-3 from widget list ? or any other method to deactivate some widgets like meta, recent-comments etc
Share Improve this question edited Aug 14, 2019 at 22:44 fuxia♦ 107k39 gold badges255 silver badges459 bronze badges asked Aug 14, 2019 at 22:14 yarekyarek 1274 bronze badges 3 |1 Answer
Reset to default 1Try using the --fields
and --format
parameter, e.g.
wp widget list sidebar-1 --fields=id --format=json
Docs: WP-CLI Commands wp widget list
本文标签: wp cliHow do I deactivate widgets by name
版权声明:本文标题:wp cli - How do I deactivate widgets by name? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745239914a2649265.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
--fields
and--format
for example? – Nicolai Grossherr Commented Aug 14, 2019 at 23:00