Ingredient
in package
Public-facing ingredients functionality.
Add ingredients to archives. Render ingredient meta data and associated links.
Tags
Table of Contents
Constants
- LINKS_CONTAINER = 'ingredient-links.php'
- Links container partial filename.
- METADATA_CONTAINER = 'ingredient-meta.php'
- Meta data container partial filename.
- WHERE_USED = 'uses'
- WPRM ingredient slug for where used ingredient archive.
Properties
- $ingredient_cpt_name : string
- The ingredient CPT name.
- $instances : array<string|int, object>
- The array of instances of this class and sub-classes.
- $links_container_path : string
- The fully qualified path to the links container.
- $metadata_container_path : string
- The fully qualified path to the meta data container.
Methods
- add_ingredient_to_archive() : void
- Add ingredient CPT to ingredient category and tag archive pages.
- get_instance() : object
- Creates and/or returns the instance of this class.
- render_links() : void
- Maybe render the ingredient link buttons container.
- render_metadata() : void
- Render the ingredient meta data section.
- __construct() : void
- Initialise the class and set its properties.
Constants
LINKS_CONTAINER
Links container partial filename.
protected
string
LINKS_CONTAINER
= 'ingredient-links.php'
Tags
METADATA_CONTAINER
Meta data container partial filename.
protected
string
METADATA_CONTAINER
= 'ingredient-meta.php'
Tags
WHERE_USED
WPRM ingredient slug for where used ingredient archive.
protected
string
WHERE_USED
= 'uses'
Tags
Properties
$ingredient_cpt_name
The ingredient CPT name.
public
string
$ingredient_cpt_name
Tags
$instances
The array of instances of this class and sub-classes.
protected
static array<string|int, object>
$instances
= array()
Tags
$links_container_path
The fully qualified path to the links container.
protected
string
$links_container_path
Tags
$metadata_container_path
The fully qualified path to the meta data container.
protected
string
$metadata_container_path
Tags
Methods
add_ingredient_to_archive()
Add ingredient CPT to ingredient category and tag archive pages.
public
add_ingredient_to_archive(WP_Query $query) : void
Parameters
- $query : WP_Query
-
WP Query object passed by reference.
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_links()
Maybe render the ingredient link buttons container.
public
render_links(int $post_id) : void
Parameters
- $post_id : int
-
The id of the ingredient post.
Tags
render_metadata()
Render the ingredient meta data section.
public
render_metadata([int $post_id = 0 ]) : void
Parameters
- $post_id : int = 0
-
The id of the ingredient post.
Tags
__construct()
Initialise the class and set its properties.
protected
__construct() : void