API / Minn\Rest / RegisteredType

RegisteredType final readonly class

Minn\Rest\RegisteredType · public/minn/src/Minn/Rest/RegisteredType.php · 46 lines

A post type plugin code registered, as its REST object follows it (probe rest-plugin-types): what it supports, whether it is hierarchical, and the taxonomies it shows in REST under their REST bases. Only once the runtime has loaded the plugins that register it.

Constants and properties

propreadonly string $name

Promoted from the constructor.

privatereadonly WP_Post_Type $object

Promoted from the constructor.

Public

new__construct(string $name, WP_Post_Type $object)#
staticof(string $type): ?self#

The type when plugin code registered it (not a built-in), or null.

methodsupports(string $feature): bool#

Whether the type supports the feature (title, editor, author...).

methodhierarchical(): bool#

Whether the type's posts have parents.

methodbase(): string#

The REST base the type's routes live under, with its namespace.

methodtaxonomies(): array#

The taxonomies the type shows in REST, REST base => taxonomy, in registration order. @return array<string, string>

@return array<string, string>