Home › Forums › Feature Requests › Repeater: default fields/data › Reply To: Repeater: default fields/data
I got this to work with ACF Pro 5.8.12, using the above code and code from this answer. Here’s what I added to my functions.php:
add_filter('acf/load_value/key=field_5eff2f9949765', 'acf_load_my_defaults', 10, 3);
function acf_load_my_defaults($value, $post_id, $field) {
if ($value === false) {
$value = array();
$value[] = array(
'field_5eff2fac49766' => 'Example Title One',
'field_5eff2fbd49767' => 'Some content for this block'
);
$value[] = array(
'field_5eff2fac49766' => 'Example Title Two',
'field_5eff2fbd49767' => 'Some content for this block'
);
}
return $value;
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.