Types final class
Minn\Rest\Types · public/minn/src/Minn/Rest/Types.php · 190 lines
The engine's registry of built-in post types, seeded from the observed contract (src/data/types.json) with _links attached at runtime.
Constants and properties
| private | ?array $types | |
| private | readonly Minn\Rest\RestUrl $url | Promoted from the constructor. |
| private | readonly array $declared | Promoted from the constructor. |
Public
| new | __construct(Minn\Rest\RestUrl $url, array $declared = array ( ))# |
| |||
| method | all(): array# | Every post type the surface knows, by slug. @return array<string, array> keyed by type slug | |||
| method | find(string $slug): ?array# | One post type by slug, or null. | |||
| method | slugForRestBase(string $base): ?string# | The type behind a rest_base, or null. | |||
| method | declaredBases(): array# | The rest_base of every type an extension declared or plugin code registered under wp/v2. @return list<string> @return list<string> | |||
| method | routeBases(): array# | Every base the {base} routes serve: the declared post types' and the taxonomies plugin code registered to show in REST under wp/v2. @return list<string> | |||
| method | isDeclared(string $slug): bool# | Whether the engine serves this type through its {base} routes: an extension declared it, or plugin code registered it to show in REST under wp/v2 (probe rest-plugin-types). | |||
| method | searchable(): array# | The types a post search covers: the built-in post and page, the ones extensions declare, and the public types plugin code shows in REST, as the reference's post search handler takes them. @return list<string> | |||
| method | restBase(string $slug): string# | The rest_base of a type slug. |
Internals 3
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | core(): array# | The built-in types and the ones extensions declare. @return array<string, array> @return array<string, array> |
| private | registered(): array# | The types plugin code registered to show in REST (probe rest-types-edit), in registration order, as the reference describes them: their label, icon, the taxonomies they show in REST. @return array<string, array> |
| private | servedRegistered(): array# | @return array<string, array> the registered types under wp/v2 |
Nothing matches.