Tax_Meta
extends Tax_Meta
in package
Taxonomy extended meta data functionality.
Create or extend admin screens to add an excerpt, preferred display sequence and taxonomy image.
Tags
Table of Contents
Constants
- CREATE_META_CONTAINER = 'create-tax-meta.php'
- Create screen partial.
- EDIT_META_CONTAINER = 'edit-tax-meta.php'
- Edit screen partial.
- MEDIA_FIELD_ID = 'pnet-image-id'
- The media selector field id attribute.
- MEDIA_FIELD_NAME = 'pnet_image_id'
- The media selector field name attribute.
- TAXONOMIES = array('pfic_chapter', 'wprm_cuisine', 'wprm_diff', 'wprm_suitablefordiet')
- The taxonomies to apply extended meta data.
Properties
- $create_meta_container : string
- The fully qualified path to create screen partial.
- $edit_meta_container : string
- The fully qualified path to edit screen partial.
- $instances : array<string|int, object>
- The array of instances of this class and sub-classes.
- $media_selector : Media_Selector
- The instance of the Media_Selector class.
Methods
- get_instance() : object
- Creates and/or returns the instance of this class.
- get_taxonomies() : array<string|int, string>
- Return the array of target taxonomies.
- render_create_fields() : void
- Render the extra fields on the create screen.
- render_edit_fields() : void
- Render the fields on the edit screen.
- save() : void
- Save the data.
- __construct() : void
- Initialise the class.
Constants
CREATE_META_CONTAINER
Create screen partial.
protected
string
CREATE_META_CONTAINER
= 'create-tax-meta.php'
Tags
EDIT_META_CONTAINER
Edit screen partial.
protected
string
EDIT_META_CONTAINER
= 'edit-tax-meta.php'
Tags
MEDIA_FIELD_ID
The media selector field id attribute.
protected
string
MEDIA_FIELD_ID
= 'pnet-image-id'
Tags
MEDIA_FIELD_NAME
The media selector field name attribute.
protected
string
MEDIA_FIELD_NAME
= 'pnet_image_id'
Tags
TAXONOMIES
The taxonomies to apply extended meta data.
protected
array<string|int, string>
TAXONOMIES
= array('pfic_chapter', 'wprm_cuisine', 'wprm_diff', 'wprm_suitablefordiet')
Tags
Properties
$create_meta_container
The fully qualified path to create screen partial.
protected
string
$create_meta_container
= ''
Tags
$edit_meta_container
The fully qualified path to edit screen partial.
protected
string
$edit_meta_container
= ''
Tags
$instances
The array of instances of this class and sub-classes.
protected
static array<string|int, object>
$instances
= array()
Tags
$media_selector
The instance of the Media_Selector class.
protected
Media_Selector
$media_selector
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_taxonomies()
Return the array of target taxonomies.
public
get_taxonomies() : array<string|int, string>
- This is used to build the admin hooks in the core plugin class.
Tags
Return values
array<string|int, string>render_create_fields()
Render the extra fields on the create screen.
public
render_create_fields(string $taxonomy) : void
Parameters
- $taxonomy : string
-
The taxonomy slug.
Tags
render_edit_fields()
Render the fields on the edit screen.
public
render_edit_fields(WP_Term $term, string $taxonomy) : void
Parameters
- $term : WP_Term
-
The taxonomy term object.
- $taxonomy : string
-
The taxonomy slug.
Tags
save()
Save the data.
public
save(int $term_id) : void
Parameters
- $term_id : int
-
The taxonomy term id.
Tags
__construct()
Initialise the class.
protected
__construct() : void