@@ -35,14 +35,15 @@ to register and discover distinct units of functionality within a WordPress site
3535 +---------------------------+----------------------+----------+------------------------------------------+
3636
3737 # Get details of a specific ability.
38- $ wp ability get core/get-site-info --fields=name,label,category,readonly,show_in_rest
38+ $ wp ability get core/get-site-info --fields=name,label,category,readonly,public, show_in_rest
3939 +---------------+----------------------+
4040 | Field | Value |
4141 +---------------+----------------------+
4242 | name | core/get-site-info |
4343 | label | Get Site Information |
4444 | category | site |
4545 | readonly | 1 |
46+ | public | 1 |
4647 | show_in_rest | 1 |
4748 +---------------+----------------------+
4849
@@ -74,7 +75,7 @@ to register and discover distinct units of functionality within a WordPress site
7475Lists all registered abilities.
7576
7677~~~
77- wp ability list [--category=<slug>] [--namespace=<prefix>] [--show-in-rest=<bool> ] [--field=<field>] [--fields=<fields>] [--format=<format>]
78+ wp ability list [--category=<slug>] [--namespace=<prefix>] [--public] [-- show-in-rest] [--field=<field>] [--fields=<fields>] [--format=<format>]
7879~~~
7980
8081** OPTIONS**
@@ -85,8 +86,11 @@ wp ability list [--category=<slug>] [--namespace=<prefix>] [--show-in-rest=<bool
8586 [--namespace=<prefix>]
8687 Filter abilities by namespace prefix (e.g., 'core' for 'core/*' abilities).
8788
88- [--show-in-rest=<bool>]
89- Filter abilities by REST API exposure.
89+ [--public]
90+ Only list abilities flagged for client exposure. Pass --no-public to invert.
91+
92+ [--show-in-rest]
93+ Only list abilities exposed to the REST API. Pass --no-show-in-rest to invert.
9094
9195 [--field=<field>]
9296 Prints the value of a single field for each ability.
@@ -121,8 +125,15 @@ These fields are optionally available:
121125* readonly
122126* destructive
123127* idempotent
128+ * public
124129* show_in_rest
125130
131+ The ` public ` field reports the high-level client exposure flag as declared
132+ by the ability. As of WordPress 7.1 it seeds the default for channel-specific
133+ flags such as ` show_in_rest ` , which take precedence when set explicitly.
134+ On earlier versions the flag is stored but has no effect, so ` public ` and
135+ ` show_in_rest ` may disagree.
136+
126137** EXAMPLES**
127138
128139 # List all abilities.
@@ -141,7 +152,13 @@ These fields are optionally available:
141152 $ wp ability list --namespace=core
142153
143154 # List abilities exposed to REST API.
144- $ wp ability list --show-in-rest=true
155+ $ wp ability list --show-in-rest
156+
157+ # List abilities meant to be available to clients.
158+ $ wp ability list --public
159+
160+ # Find abilities that opt out of REST despite being public.
161+ $ wp ability list --public --no-show-in-rest
145162
146163 # List abilities as JSON.
147164 $ wp ability list --format=json
@@ -186,6 +203,8 @@ wp ability get <name> [--field=<field>] [--fields=<fields>] [--format=<format>]
186203
187204** AVAILABLE FIELDS**
188205
206+ These fields will be displayed by default:
207+
189208* name
190209* label
191210* category
@@ -195,8 +214,22 @@ wp ability get <name> [--field=<field>] [--fields=<fields>] [--format=<format>]
195214* readonly
196215* destructive
197216* idempotent
217+ * public
198218* show_in_rest
199219
220+ These fields are optionally available:
221+
222+ * meta
223+
224+ The ` public ` field reports the high-level client exposure flag as declared
225+ by the ability. As of WordPress 7.1 it seeds the default for channel-specific
226+ flags such as ` show_in_rest ` , which take precedence when set explicitly.
227+ On earlier versions the flag is stored but has no effect, so ` public ` and
228+ ` show_in_rest ` may disagree.
229+
230+ The ` meta ` field renders the raw metadata as JSON. It is the only way to
231+ inspect channel-specific settings registered by plugins, such as ` mcp ` .
232+
200233** EXAMPLES**
201234
202235 # Get details of a specific ability.
@@ -213,9 +246,14 @@ wp ability get <name> [--field=<field>] [--fields=<fields>] [--format=<format>]
213246 | readonly | 1 |
214247 | destructive | 0 |
215248 | idempotent | 1 |
249+ | public | 1 |
216250 | show_in_rest | 1 |
217251 +---------------+----------------------+
218252
253+ # Inspect channel-specific settings that have no field of their own.
254+ $ wp ability get my-plugin/my-ability --field=meta
255+ {"annotations":{"readonly":true,"destructive":false,"idempotent":null},"mcp":{"public":false},"show_in_rest":true,"public":true}
256+
219257 # Get ability as JSON.
220258 $ wp ability get core/get-site-info --format=json
221259
0 commit comments