TermObject final readonly class
Minn\Rest\TermObject · public/minn/src/Minn/Rest/TermObject.php · 107 lines
The wp/v2 category and tag objects.
Constants and properties
| private | TAXONOMIES = array ( 'categories' => array ( 'taxonomy' => 'category', 'has_parent' => true, 'post_arg' => 'categories', 'post_base' => 'posts', ), 'tags' => array ( 'taxonomy' => 'post_tag', 'has_parent' => false, 'post_arg' => 'tags', 'post_base' => 'posts', ), 'wp_pattern_category' => array ( 'taxonomy' => 'wp_pattern_category', 'has_parent' => false, 'post_arg' => 'wp_pattern_category', 'post_base' => 'blocks', ), ) | |
| private | readonly Minn\Db $db | Promoted from the constructor. |
| private | readonly Minn\Front\Permalinks $permalinks | Promoted from the constructor. |
| private | readonly Minn\Rest\RestUrl $url | Promoted from the constructor. |
| private | readonly Minn\Rest\Caller $caller | Promoted from the constructor. |
Public
| new | __construct(Minn\Db $db, Minn\Front\Permalinks $permalinks, Minn\Rest\RestUrl $url, Minn\Rest\Caller $caller)# | |
| method | view(Minn\Content\TermRecord $term, string $restBase): array# | A term as its REST base shows it, through rest_prepare_{taxonomy} when a plugin hooks it. |
| method | url(): Minn\Rest\RestUrl# | The REST URL builder. |
| static | config(string $restBase): array# | The taxonomy behind a rest_base. @return array{taxonomy: string, has_parent: bool, post_arg: string, post_base: string} |
| static | registered(string $restBase): ?array# | A taxonomy plugin code registered to show in REST under wp/v2, by its REST base (probe rest-plugin-types), as a term route's config: its terms nest when it is hierarchical, and its posts are those of the first type it belongs to. @return array{taxonomy: string, has_parent: bool, post_arg: string, post_base: string}|null |
Internals 2
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
Nothing matches.