API / Minn\Runtime / TypeProps

TypeProps final class

Minn\Runtime\TypeProps · public/minn/src/Minn/Runtime/TypeProps.php · 150 lines

A post type's or taxonomy's properties from the arguments it was built with, as WP_Post_Type::set_props and WP_Taxonomy::set_props fill them (probe type-object-methods): the reference's defaults where an argument is missing, a given value kept as given.

Uses 1

Public

staticpostType(string $name, array $args): array#

A post type's properties from its arguments (probe type-object-methods): the reference's defaults where an argument is missing, a given value kept as given. The labels are the type's own; get_post_type_labels makes them whole on the object.

$argsarray<string, mixed>
@return array<string, mixed>
statictaxonomy(string $name, array $objectTypes, array $args): array#

A taxonomy's properties from the types it belongs to and its arguments (probe type-object-methods): the reference's defaults where an argument is missing, a given value kept as given. The meta box is the category checklist for a hierarchical taxonomy and the tag box for any other; its input is read as checkboxes for the checklist and as text otherwise. A default term gets a name, slug and description.

$objectTypeslist<mixed>
$argsarray<string, mixed>
@return array<string, mixed>

Internals 2

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatetypeRewrite(string $name, mixed $rewrite, mixed $hasArchive): mixed#

A type's rewrite settles into its full form, public or not; feeds only where there is an archive (probe registry-rewrites).

privatetaxonomyRewrite(string $name, mixed $rewrite): mixed#

A taxonomy's rewrite settles, whether queryable or not, the given keys merged over the defaults; a rewrite of true leaves an empty "0" entry behind, as the reference's merge does (probe registry-rewrites).