Beispiel #1
0
/**
 * Update an existing ingredient.
 *
 * @since 1.3.0
 *
 * @param  int    $ingredient_id The ID for the ingredient to update.
 * @param array $args {
 *     The updated ingredient values.
 *
 *     @type int    $recipe_id   The recipe ID.
 *     @type float  $amount      The ingredient amount.
 *     @type string $unit        The ingredient unit.
 *     @type string $description The ingredient description.
 *     @type int    $order       The ingredient order number.
 * }
 * @return int|bool $result The ingredient ID or false on failure.
 */
function simmer_update_recipe_ingredient($ingredient_id, $args)
{
    $ingredients_api = new Simmer_Recipe_Ingredients();
    $result = $ingredients_api->update_ingredient($ingredient_id, $args);
    return $result;
}