This documentation describes unreleased changes on the main branch.

#[TermReference]

Attribute on parameters and properties.

use Saij\WpAppFramework\Value\TermReference;

A reference to terms: on ?int the ID of one term (null without), on array a list of term IDs in a fixed order. A term that no longer exists or belongs to another taxonomy becomes null (or is left out of the list).

Arguments

#[TermReference(?array $taxonomies = null)]
ParameterTypeDefaultDescription
taxonomieslist<string>|nullnullTaxonomies to choose from (slugs, e.g. ["category"]); null for all viewable taxonomies.