Taxonomy
in package
Provide additional taxonomy admin functions.
- Export the terms for a particular taxonomy.
- List public taxonomy names and labels.
Tags
Table of Contents
Constants
- BASE_FIELDS : array<string|int, mixed> = array('term_id', 'name', 'slug', 'description',...
- The basic fields from the get_terms() function.
- COMMON_FIELDS : array<string|int, mixed> = array('rank_math_seo_score')
- The common term metadata fields to get values for.
- FIELD_DELIMITER : mixed = '|'
- The field delimiter for the export file.
Properties
- $instances : array<string|int, object>
- The array of instances of this class and sub-classes.
Methods
- get_export() : string
- Get the taxonomy terms export.
- get_instance() : object
- Creates and/or returns the instance of this class.
- get_titles() : array<string|int, mixed>
- Get the list of taxonomy title labels.
- __construct() : void
- Initialise the class.
Constants
BASE_FIELDS
The basic fields from the get_terms() function.
protected
array<string|int, mixed>
BASE_FIELDS
= array('term_id', 'name', 'slug', 'description', 'parent', 'count')
The target fields from the get_terms() function.
Tags
COMMON_FIELDS
The common term metadata fields to get values for.
protected
array<string|int, mixed>
COMMON_FIELDS
= array('rank_math_seo_score')
- These are the termmeta entries always included in the export file.
The target fields to get values for.
Tags
FIELD_DELIMITER
The field delimiter for the export file.
protected
mixed
FIELD_DELIMITER
= '|'
- Several of the fields may contain commas or tabs, so a pipe character is used as the delimiter.
Tags
Properties
$instances
The array of instances of this class and sub-classes.
protected
static array<string|int, object>
$instances
= array()
Tags
Methods
get_export()
Get the taxonomy terms export.
public
get_export(string $taxonomy[, array<string|int, mixed> $addtional_fields = array() ]) : string
Parameters
- $taxonomy : string
-
The taxonomy for which to export terms.
- $addtional_fields : array<string|int, mixed> = array()
-
The keys to the additional fields to include in the export.
Tags
Return values
string —The taxonomy terms delimited file contents.
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_titles()
Get the list of taxonomy title labels.
public
get_titles() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —The array of taxonomy title labels, keyed by taxonomy name, sorted by label.
__construct()
Initialise the class.
protected
__construct() : void