Featured_Recipes
extends Collection
in package
Provides post or recipe ids for our favourite recipes.
- Our favourite recipes have the "featured" tag.
Tags
Table of Contents
Constants
- COLLECTION_TAG = 'featured'
- The featured post tag.
- TRANSIENT_EXPIRATION_DEBUG = MINUTE_IN_SECONDS * 5
- The transient expiration for debugging.
- TRANSIENT_EXPIRATION_PRODUCTION = WEEK_IN_SECONDS
- The transient expiration for production
- TRANSIENT_KEY = 'pfic_featured_recipes'
- Featured post transient key.
Properties
- $instances : array<string|int, object>
- The array of instances of this class and sub-classes.
- $recipe : Recipe
- The instance of the recipe class.
- $transient_expiration : int
- The transient expiration.
Methods
- get_instance() : object
- Creates and/or returns the instance of this class.
- get_post_ids() : array<string|int, int>
- Return the array of post ids for the collection.
- get_recipe_ids() : array<string|int, int>
- Return the array of recipe ids for the collection.
- rebuild_collection() : array<string|int, int>|bool
- Rebuild the transient array of featured post ids.
- __construct() : void
- Initialise the class and set its properties.
Constants
COLLECTION_TAG
The featured post tag.
protected
string
COLLECTION_TAG
= 'featured'
Tags
TRANSIENT_EXPIRATION_DEBUG
The transient expiration for debugging.
protected
int
TRANSIENT_EXPIRATION_DEBUG
= MINUTE_IN_SECONDS * 5
Tags
TRANSIENT_EXPIRATION_PRODUCTION
The transient expiration for production
protected
int
TRANSIENT_EXPIRATION_PRODUCTION
= WEEK_IN_SECONDS
Tags
TRANSIENT_KEY
Featured post transient key.
protected
string
TRANSIENT_KEY
= 'pfic_featured_recipes'
Tags
Properties
$instances
The array of instances of this class and sub-classes.
protected
static array<string|int, object>
$instances
= array()
Tags
$recipe
The instance of the recipe class.
protected
Recipe
$recipe
Tags
$transient_expiration
The transient expiration.
protected
int
$transient_expiration
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_post_ids()
Return the array of post ids for the collection.
public
get_post_ids() : array<string|int, int>
Tags
Return values
array<string|int, int> —Array of post ids.
get_recipe_ids()
Return the array of recipe ids for the collection.
public
get_recipe_ids() : array<string|int, int>
Tags
Return values
array<string|int, int> —Array of recipe ids.
rebuild_collection()
Rebuild the transient array of featured post ids.
public
rebuild_collection() : array<string|int, int>|bool
- Return the array of post_ids.
Tags
Return values
array<string|int, int>|bool —Array of post ids or false if no data
__construct()
Initialise the class and set its properties.
protected
__construct() : void