|
18 | 18 | * by post type, status, author, parent, or included IDs. Raw fields are only returned for |
19 | 19 | * posts the current user can edit. |
20 | 20 | * |
21 | | - * The class is intentionally structured around shared building blocks (exposed post type |
22 | | - * discovery, schema generation, per-post formatting and permission checks) so future |
23 | | - * write-oriented content abilities can reuse them. |
| 21 | + * Unlike the other core abilities, which are self-contained closures registered directly |
| 22 | + * in wp_register_core_abilities(), the content ability lives in a dedicated class because |
| 23 | + * its callbacks and schemas share helpers: the permission and execute callbacks resolve and |
| 24 | + * authorize the requested post through the same code, and the input schema, output schema, |
| 25 | + * and field projection are built from the same field definitions. Future write-oriented |
| 26 | + * content abilities can reuse them as well. |
24 | 27 | * |
25 | 28 | * This class is part of WordPress' internal implementation of the core abilities and is |
26 | 29 | * not part of the public API. It may be changed or removed at any time without notice. |
@@ -968,7 +971,7 @@ private function get_fields_input_schema(): array { |
968 | 971 | 'type' => 'string', |
969 | 972 | 'enum' => array_keys( $this->get_post_properties() ), |
970 | 973 | ), |
971 | | - 'description' => __( 'Limit each returned post to these fields. The `id` is always included. If omitted, a lean set of common read fields is returned. Explicit raw field requests require edit access.' ), |
| 974 | + 'description' => __( 'Limit each returned post to these fields. The `id` is always included. If omitted or empty, a lean set of common read fields is returned. Explicit raw field requests require edit access.' ), |
972 | 975 | ); |
973 | 976 | } |
974 | 977 |
|
|
0 commit comments