ok, so thanks to your code i have made some progress. at this point i am at least getting the word “Array” outputting on the front end for each entry into a repeatable field on the back end.
my repeatable metabox is for a list of ingredients, and is set up like this:
array( // Repeatable & Sortable Text inputs
'label' => 'Ingredients', // <label>
'desc' => 'Ingredients', // description
'id' => $prefix.'ingredients', // field id and name
'type' => 'repeatable', // type of field
'sanitizer' => array( // array of sanitizers with matching kets to next array
'featured' => 'meta_box_santitize_boolean',
'title' => 'sanitize_text_field',
'desc' => 'wp_kses_data'
),
'repeatable_fields' => array ( // array of fields to be repeated
'title' => array(
'label' => 'Ingredient',
'id' => 'ingredient',
'type' => 'text'
),
)
),
the code i am using to try to output the information to the front is this:
<div id="ingredients">
<h3>Ingredients</h3>
<?php
$recipe_ingredients = get_post_meta($post->ID, 'recipe_ingredients', true); {
echo '<ul class="custom_repeatable">';
foreach ($recipe_ingredients as $ingredients) {
echo '<li>'.$ingredients.'</li>';
}
echo '</ul>';
}
?>
</div>
My test entry in the backend only has 3 ingredients, but the result is only the word “Array” output 3 times in an unordered list.
When i call all meta info I get this as a result:
recipe_ingredients: a:3:{i:0;a:1:{s:10:”ingredient”;s:17:”1 Stick of Butter”;} i:1;a:1:{s:10:”ingredient”;s:6:”3 Eggs”;} i:2;a:1:{s:10:”ingredient”;s:12:”1/2 Cup Milk”;}}