From eb8c819e97b0fae9991795aa9e4993cbb1315d32 Mon Sep 17 00:00:00 2001 From: David Edwards Date: Thu, 18 May 2017 15:27:05 +0100 Subject: [PATCH] Allow multiple ingredients in recipes ingredients seperated by commars will be split into mutliple ingredients instead of being lumped in as one --- functions.php | 12 +++++++++--- meta-boxes.php | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/functions.php b/functions.php index c1e80bb..9090c53 100644 --- a/functions.php +++ b/functions.php @@ -553,11 +553,17 @@ function display_rich_snippet($content) { { if($args_recipe['recipe_name'] != "") $recipe .= '
'.esc_attr( stripslashes( $args_recipe['recipe_name'] ) ).'
'; + $recipe .= '
'.esc_attr( $recipes_name ).'
- - -
'; + + $arr_recipes_ingredient = explode(',',$recipes_ingredient); + foreach ($arr_recipes_ingredient as $ingredient) { + $recipe .= ''; + } + + $recipe .= '
'; diff --git a/meta-boxes.php b/meta-boxes.php index ab2a163..ed206e1 100644 --- a/meta-boxes.php +++ b/meta-boxes.php @@ -474,7 +474,7 @@ function bsf_metaboxes( array $meta_boxes ) { ), array( 'name' => __('Ingredients','rich-snippets'), - 'desc' => __('Enter the ingredients used','rich-snippets'), + 'desc' => __('Enter ingredients used separated by commas (ingredient 1, ingredient 2, etc)','rich-snippets'), 'id' => $prefix . 'recipes_ingredient', 'class' => 'recipes', 'type' => 'text_medium',