Taxonomy
in package
Provide additional taxonomy functions.
- Return an array of terms in the taxonomy sorted by specified key.
- List links to terms in the taxonomy.
Tags
Table of Contents
Constants
- TAX_SEQUENCE_KEY : array<string|int, mixed> = 'pnet_sequence'
- Define taxonomy term preferred sequence key name.
- TV_DEFAULTS : mixed = array('childless' => false, 'hide_empty' => tru...
- The default term selection query variables.
Properties
- $instances : array<string|int, object>
- The array of instances of this class and sub-classes.
Methods
- get_instance() : object
- Creates and/or returns the instance of this class.
- get_terms() : array<string|int, WP_Term>
- Get the taxonomy terms.
- render_links() : void
- Render the list of term links.
- __construct() : void
- Initialise the class.
Constants
TAX_SEQUENCE_KEY
Define taxonomy term preferred sequence key name.
protected
array<string|int, mixed>
TAX_SEQUENCE_KEY
= 'pnet_sequence'
Tags
TV_DEFAULTS
The default term selection query variables.
protected
mixed
TV_DEFAULTS
= array('childless' => false, 'hide_empty' => true, 'order' => 'ASC', 'orderby' => 'name', 'parent' => '', 'taxonomy' => '')
Tags
Properties
$instances
The array of instances of this class and sub-classes.
protected
static array<string|int, object>
$instances
= array()
Tags
Methods
get_instance()
Creates and/or returns the instance of this class.
public
static get_instance() : object
Tags
Return values
object —The instance of this class.
get_terms()
Get the taxonomy terms.
public
get_terms([array<string|int, mixed> $args = array() ]) : array<string|int, WP_Term>
- Return an array of term objects.
- Array will be sorted by the specified key. Defaults to name.
Parameters
- $args : array<string|int, mixed> = array()
-
The taxonomy term selection arguments.
Tags
Return values
array<string|int, WP_Term> —An array of selected terms.
render_links()
Render the list of term links.
public
render_links(string $taxonomy) : void
Parameters
- $taxonomy : string
-
The taxonomy to use for the list.
Tags
__construct()
Initialise the class.
protected
__construct() : void