pfeifferNet

Print_Howto_Posts extends Printing
in package

Print howto posts collection.

  • Howto posts are WP Recipe Maker non-food posts.
Tags
since
5.7.0
since
5.9.0

Refactored to extend new Printing class.

uses
Printing

Table of Contents

Constants

DEFAULT_PRINT_ARGS  = array('content' => 'post', 'from' => '', 'to' => '', 'updated' => false, 'tid' => 0, 'num_posts' => -1, 'order' => 'ASC', 'order_by' => 'name', 'post_ids' => array(), 'recipe_ids' => array(), 'include_recipes' => false, 'post_type' => array('post', 'pfic_ingredient'), 'recipes_only' => false, 'url' => '')
Default arguments for printing.
FEATURED_IMAGE_SIZE  = 'large'
Featured image size.
ITEM_CONTAINER  = 'print-howto-post.php'
Howto content partial for printing.
WPRM_START_STRING  = '<!-- wp:wp-recipe-maker/recipe '
Start of WPRM content in post content.

Properties

$chapter  : Chapter
The instance of the Chapter class.
$instances  : array<string|int, object>
The array of instances of this class and sub-classes.
$item_container  : string
The fully qualified path to the print item content partial.
$media  : Media
The instance of the pNet media class.
$partials_dir  : string
The path to the partials directory.
$posts  : Posts
The instance of the Posts class.
$recipe  : Recipe
The instance of the Recipe class.

Methods

get_instance()  : object
Creates and/or returns the instance of this class.
render()  : void
Add content to print page.
render_item()  : void
Render a howto post.
__construct()  : void
Initialise the class and set its properties.
get_featured_image_url()  : string
Return the featured image details.

Constants

DEFAULT_PRINT_ARGS

Default arguments for printing.

protected array<string|int, mixed> DEFAULT_PRINT_ARGS = array('content' => 'post', 'from' => '', 'to' => '', 'updated' => false, 'tid' => 0, 'num_posts' => -1, 'order' => 'ASC', 'order_by' => 'name', 'post_ids' => array(), 'recipe_ids' => array(), 'include_recipes' => false, 'post_type' => array('post', 'pfic_ingredient'), 'recipes_only' => false, 'url' => '')

{ The default arguments to determine print content. @type string $content The type of content to display. Required - will default to post if not specified. @type string $from The inclusive start date for date range. @type string $to The inclusive end date for date range. @type bool $updated Use published date (false) or updated date (true). Defaults to false. @type int|string $tid The term id of the chapter to print, or 'all' to include all chapters. @type int $num_posts The number of posts to return.. @type string $order The posts sort order. @type string $orderby The posts sort key. @type int[] $post_ids The array of post_ids to print. @type int[] $recipe_ids The array of recipe ids to print. @type bool $include_recipes Flag to indicate if recipes hould be included in menu output. @type string[] $post_type The array of post types to include in query. @type bool $recipes-only Flag to indicate if only recipes should be included in the print output. @type string $url The URL of the relevant post or page. Used to build the QR code. }

Tags
since
5.7.0
since
5.9.0

Add post_type default variable.

since
6.3.0

Add number of posts variable.

Featured image size.

protected string FEATURED_IMAGE_SIZE = 'large'

The size of the featured image.

Tags
since
5.7.0

ITEM_CONTAINER

Howto content partial for printing.

protected string ITEM_CONTAINER = 'print-howto-post.php'
Tags
since
5.7.0

WPRM_START_STRING

Start of WPRM content in post content.

protected string WPRM_START_STRING = '<!-- wp:wp-recipe-maker/recipe '
  • The trailing space is important to avoid detecting other WPRM content.
Tags
since
5.4.0

Properties

$instances

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

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

$item_container

The fully qualified path to the print item content partial.

protected string $item_container
Tags
since
5.7.0

$partials_dir

The path to the partials directory.

protected string $partials_dir
Tags
since
5.7.0

Methods

get_instance()

Creates and/or returns the instance of this class.

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

The instance of this class.

render_item()

Render a howto post.

public render_item(int $post_id, array<string|int, mixed> $args) : void
Parameters
$post_id : int

The ID of the post to use.

$args : array<string|int, mixed>

The arguments to determine print content.

Tags
since
5.4.0
see
Printing::DEFAULT_PRINT_ARGS

Return the featured image details.

protected get_featured_image_url(int $post_id) : string
Parameters
$post_id : int

The ID of the post to use.

Tags
since
5.7.0
uses
Media::get_featured_image_url()
Return values
string

        
On this page

Search results