Ingredients
in package
Class to provide ingredients custom post type admin functionality.
Adds metabox for extended data.
Tags
Table of Contents
Constants
- METADATA_CONTAINER = 'table-ingredient-meta.php'
- Ingredient metadata container partial.
- NONCE_ACTION = 'update_ingredient'
- The nonce action.
- NONCE_NAME = 'token'
- The nonce name.
Properties
- $cpt_definition : Ingredients
- The instance of the Ingredients CPT definition class.
- $instances : array<string|int, object>
- The array of instances of this class and sub-classes.
- $metadata_container : string
- Fully qualified path to ingredient metadata container partial.
Methods
- add_metabox() : void
- Add the metabox to custom post edit screens.
- get_instance() : object
- Creates and/or returns the instance of this class.
- render_metabox() : void
- Render the metabox on custom post edit screens.
- save_metabox() : void
- Save the metabox data.
- __construct() : void
- Initialise the class and set its properties.
Constants
METADATA_CONTAINER
Ingredient metadata container partial.
protected
string
METADATA_CONTAINER
= 'table-ingredient-meta.php'
Tags
NONCE_ACTION
The nonce action.
protected
string
NONCE_ACTION
= 'update_ingredient'
Tags
NONCE_NAME
The nonce name.
protected
string
NONCE_NAME
= 'token'
Tags
Properties
$cpt_definition
The instance of the Ingredients CPT definition class.
protected
Ingredients
$cpt_definition
Tags
$instances
The array of instances of this class and sub-classes.
protected
static array<string|int, object>
$instances
= array()
Tags
$metadata_container
Fully qualified path to ingredient metadata container partial.
protected
string
$metadata_container
Tags
Methods
add_metabox()
Add the metabox to custom post edit screens.
public
add_metabox() : void
Tags
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.
render_metabox()
Render the metabox on custom post edit screens.
public
render_metabox(WP_Post $post) : void
Parameters
- $post : WP_Post
-
The post object.
Tags
save_metabox()
Save the metabox data.
public
save_metabox(int $post_id, WP_Post $post, bool $update) : void
Parameters
- $post_id : int
-
The post ID.
- $post : WP_Post
-
The post object.
- $update : bool
-
Whether this is an existing post being updated or not.
Tags
__construct()
Initialise the class and set its properties.
protected
__construct() : void