Posts
in package
Post-related helper functionality.
- Provide a method to return posts within a date range and/or restricted to recipe posts.
Tags
Table of Contents
Properties
- $instances : array<string|int, object>
- The array of instances of this class and sub-classes.
Methods
- filter_print_posts() : array<string|int, mixed>
- Return the posts within a date range.
- get_instance() : object
- Creates and/or returns the instance of this class.
- __construct() : void
- Initialise the class.
Properties
$instances
The array of instances of this class and sub-classes.
protected
static array<string|int, object>
$instances
= array()
Tags
Methods
filter_print_posts()
Return the posts within a date range.
public
filter_print_posts(array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
- $args : array<string|int, mixed>
-
{ Selection arguments. Not all fields may be present. @type string[] $post_type The post types to include in query. Default 'post'. @type string $from The inclusive start date for date range. Default '1-1-2010'. @type string $to The inclusive end date for date range. Default current date. @type bool $updated Use published date (false) or updated date (true). Default false. @type int $num_posts The number of posts to return. Default -1 (all). @type string $order The sort order, either 'ASC' or 'DESC'. Default 'ASC'. @type bool $recipes_only Flag to indicate if only recipes should be included in the print output. Default false. }
Tags
Return values
array<string|int, mixed> —Array of post objects.
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.
__construct()
Initialise the class.
protected
__construct() : void