Documentation

PostTypeDefinition
in package

Read onlyYes
FinalYes

Declarative custom post type: name it once, get sensible labels and args; `args` overrides anything the convention derives.

Table of Contents

Properties

$args  : array<string|int, mixed>
$plural  : string
$singular  : string
$slug  : string

Methods

__construct()  : mixed
toArgs()  : array<string, mixed>
The full register_post_type() argument array: derived defaults with the definition's overrides merged on top.

Properties

Methods

__construct()

public __construct(non-empty-string $slug, string $singular, string $plural[, array<string, mixed> $args = [] ]) : mixed
Parameters
$slug : non-empty-string
$singular : string
$plural : string
$args : array<string, mixed> = []

overrides merged over the derived defaults

toArgs()

The full register_post_type() argument array: derived defaults with the definition's overrides merged on top.

public toArgs() : array<string, mixed>
Return values
array<string, mixed>
On this page

Search results