/** * Get the instructions for a recipe. * * @since 1.0.0 * * @param array $args Optional. @see Simmer_Recipe::get_instructions(). * @return array|bool $instructions The array of instructions or false if none set. */ function simmer_get_the_instructions($args = array()) { $recipe = simmer_get_recipe(get_the_ID()); $instructions = $recipe->get_instructions($args); /** * Filter the returned array of instructions. * * @since 1.0.0 * * @param array $instructions The returned array of instructions or empty if none set. */ $instructions = apply_filters('simmer_get_the_instructions', $instructions); return $instructions; }
/** * Get the total time for a recipe. * * @since 1.0.0 * * @param int $recipe_id Optional. A recipe's ID. * @param string $format Optional. The duration format to return. Specify 'machine' * for microdata-friendly format. Default: 'human'. * @return string $time The recipe total time. */ function simmer_get_the_total_time($recipe_id = null, $format = 'human') { if (!is_numeric($recipe_id)) { $recipe_id = get_the_ID(); } $recipe = simmer_get_recipe($recipe_id); $total_time = $recipe->get_total_time($format); return $total_time; }