Home › Forums › Add-ons › Repeater Field › Repeater text field default values › Reply To: Repeater text field default values
Got it working by removing the foreach and just spitting out the return value:
add_filter('acf/load_value/key=field_599774ca9d074', 'ek_option_defaults', 10, 3);
function ek_option_defaults($value, $post_id, $field) {
if ($value === false) {
$value = array(
array(
'field_59977c2759a56' => '24 hours ago',
'field_599841d665210' => '',
),
array(
'field_59977c2759a56' => '3 days ago',
'field_599841d665210' => '',
),
array(
'field_59977c2759a56' => '7 days ago',
'field_599841d665210' => '',
),
//etc
);
}
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!
🚀 ACF & ACF PRO 6.0.7 are now available.
— Advanced Custom Fields (@wp_acf) January 18, 2023
✨This release contains bug fixes and improvements while we continue to work on the next major release of ACF.https://t.co/wQgAOpwmUI
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.