pfeifferNet

Ingredient
in package

Public-facing ingredients functionality.

Add ingredients to archives. Render ingredient meta data and associated links.

Tags
since
1.0.0
since
5.5.0

Inherits standard singleon class.

since
5.11.0

Deprecated global singleton.

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 partial filename.

protected string LINKS_CONTAINER = 'ingredient-links.php'
Tags
since
5.1.0

METADATA_CONTAINER

Meta data container partial filename.

protected string METADATA_CONTAINER = 'ingredient-meta.php'
Tags
since
5.1.0

WHERE_USED

WPRM ingredient slug for where used ingredient archive.

protected string WHERE_USED = 'uses'
Tags
since
5.1.0

Properties

$ingredient_cpt_name

The ingredient CPT name.

public string $ingredient_cpt_name
Tags
since
5.7.0

$instances

The array of instances of this class and sub-classes.

protected static array<string|int, object> $instances = array()
Tags
since
5.11.0

The fully qualified path to the links container.

protected string $links_container_path
Tags
since
5.1.0

$metadata_container_path

The fully qualified path to the meta data container.

protected string $metadata_container_path
Tags
since
5.1.0

Methods

get_instance()

Creates and/or returns the instance of this class.

public static get_instance() : object
Tags
since
5.11.0
Return values
object

The instance of this class.

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
since
5.1.0
uses
Link_Buttons::render()

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
since
5.1.0
used-by
ingredient_meta_data()

        
On this page

Search results