WP CLI说明文档

wp plugin search

命令概述

用于在WordPress.org插件目录中搜索并显示与给定查询匹配的插件。

适合在需要查找插件、获取插件列表或检查插件详细信息时使用。

参数列表

参数 说明
<search> 要搜索的字符串。
[--page=<page>] 可选,要显示的页码。默认:1。
[--per-page=<per-page>] 可选,每页显示的结果数量。默认:10。
[--field=<field>] 打印每个插件的单个字段值。
[--fields=<fields>] 从API请求特定字段。默认:name,slug,author_profile,rating。可接受的值:name, slug, version, author, author_profile, contributors, requires, tested, compatibility, rating, ratings, num_ratings, homepage, description, short_description, sections, downloaded, last_updated, added, tags, versions, donate_link, banners, icons, active_installs, contributors, url。
[--format=<format>] 以特定格式渲染输出。默认:table。选项:table, csv, count, json, yaml。

常用示例

搜索插件并以JSON格式显示

$ wp plugin search dsgnwrks --per-page=20 --format=json

搜索插件并指定返回字段

$ wp plugin search dsgnwrks --fields=name,version,slug,rating,num_ratings