Overview

Packages

  • Simmer
    • Admin
      • Bulk
      • Functions
      • Recipes
      • Settings
    • Deprecated
    • Frontend
    • Install
    • Recipes
      • Items
        • Ingredients
        • Instructions
      • Shortcode
    • Upgrade
    • Widgets

Classes

  • Simmer_Recipe
  • Simmer_Recipe_Durations

Functions

  • simmer_get_recipe
  • simmer_get_source_text
  • simmer_get_source_url
  • simmer_get_the_cook_time
  • simmer_get_the_prep_time
  • simmer_get_the_servings
  • simmer_get_the_servings_label
  • simmer_get_the_source
  • simmer_get_the_total_time
  • simmer_get_the_yield
  • simmer_the_cook_time
  • simmer_the_prep_time
  • simmer_the_servings
  • simmer_the_source
  • simmer_the_total_time
  • simmer_the_yield
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class Simmer_Recipe

The single recipe object.

Final
Package: Simmer\Recipes
Since: 1.3.0
Located at core/recipes/class-simmer-recipe.php
Methods summary
public
# __construct( $recipe )

Construct the recipe.

Construct the recipe.

Since

1.3.0
public array
# get_items( string $type = '' )

Get the items that belong to the recipe.

Get the items that belong to the recipe.

Parameters

$type

Optional. The type of items to get. If blank, all items will be returned. Default: all items.

Returns

array
$items The attached items.

Since

1.3.0
public array
# get_ingredients( array $args = array() )

Get the ingredients.

Get the ingredients.

Parameters

$args

{ Optional. An array of arguments.

Returns

array

$ingredients An array of the recipe's ingredients. An empty array is returned when there are no ingredients for the recipe.

Since

1.3.0

Type

bool $exclude_headings Whether returned ingredients should exclude headings. Default 'false'.

string $orderby What to order the ingredients by. Default 'order' for their set order. Accepts 'order', 'amount', 'unit', or 'random'. Requires $exclude_headings be set to 'true'. }


public array
# get_instructions( array $args = array() )

Get the instructions.

Get the instructions.

Parameters

$args

{ Optional. An array of arguments.

Returns

array

$instructions An array of the recipe's instructions. An empty array is returned when there are no instructions for the recipe.

Since

1.3.0

Type

bool $exclude_headings Whether returned instructions should exclude headings. Default 'false'. }


public string|boolean
# get_prep_time( string $format = 'human' )

Get the prep time.

Get the prep time.

Parameters

$format

Optional. The duration format to return. Specify 'machine' for microdata-friendly format. Default: 'human'.

Returns

string|boolean
$prep_time The formatted prep time or false on failure.

Since

1.3.0
public string|boolean
# get_cook_time( string $format = 'human' )

Get the cook time.

Get the cook time.

Parameters

$format

Optional. The duration format to return. Specify 'machine' for microdata-friendly format. Default: 'human'.

Returns

string|boolean
$cook_time The formatted cook time or false on failure.

Since

1.3.0
public string|boolean
# get_total_time( string $format = 'human' )

Get the total time.

Get the total time.

Parameters

$format

Optional. The duration format to return. Specify 'machine' for microdata-friendly format. Default: 'human'.

Returns

string|boolean
$total_time The formatted total time or false on failure.

Since

1.3.0
Properties summary
public integer $id

The recipe ID.

The recipe ID.

Since

1.3.0
# 0
public object $post

The standard WordPress post object.

The standard WordPress post object.

Since

1.3.0
# null
Simmer API documentation generated by ApiGen