StatusesController final readonly class
Minn\Rest\StatusesController · public/minn/src/Minn/Rest/StatusesController.php · 97 lines
wp/v2/statuses as the reference answers it (probe rest-statuses): every post status that is not internal, a plugin's beside core's, by name, and trash last. A visitor sees the public ones; someone who can edit a type shown in REST sees them all, and only they may ask for the edit context of the list. Each status links to its posts and goes through rest_prepare_status. Like wp/v2/types, the list is keyed by name, so _fields over the whole of it keeps nothing.
Constants and properties
| private | FIELDS = array ( 'embed' => array ( 0 => 'name', 1 => 'slug', ), 'view' => array ( 0 => 'name', 1 => 'public', 2 => 'queryable', 3 => 'slug', 4 => 'date_floating', ), 'edit' => array ( 0 => 'name', 1 => 'private', 2 => 'protected', 3 => 'public', 4 => 'queryable', 5 => 'show_in_list', 6 => 'slug', 7 => 'date_floating', ), ) | The fields each context shows, in the reference's order. |
| private | readonly Minn\Rest\RestUrl $url | Promoted from the constructor. |
| private | readonly Minn\Rest\Caller $caller | Promoted from the constructor. |
Public
| new | __construct(Minn\Rest\RestUrl $url, Minn\Rest\Caller $caller)# | |
| method | list(Minn\Http\Request $request): Minn\Http\ResponseGET /wp/v2/statuses (public)# | The statuses the caller may see. |
| method | single(Minn\Http\Request $request, string $status): Minn\Http\ResponseGET /wp/v2/statuses/{status:[\w-]+} (public)# | One status. |
Internals 4
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | item(string $name, array $status, array $fields): array# | A status as the reference shows it, its link to its posts after its fields.
@return array<string, mixed> | ||||||
| private | readable(string $name, array $status): bool# | Whether the caller may see a status: a public one, or (for someone who edits a type shown in REST) any but an internal one; trash counts as not internal.
| ||||||
| private | statuses(): array# | Every registered status: a plugin's too once plugins are loaded. @return array<string, array<string, mixed>> @return array<string, array<string, mixed>> | ||||||
| private | context(Minn\Http\Request $request): string# |
Nothing matches.