Home › Forums › ACF PRO › Default number of repeater rows › Reply To: Default number of repeater rows
Let me know if you have any questions. There are some older answers to similar questions on the forums (and I answered some of them) but this has changed… loading a repeater has been pretty stable for a while
add_filter('acf/load_value/name=repeater_field_name', 'preload_repeater_field_name', 10, 3);
function preload_repeater_field_name($value, $post_id, $field) {
// $value will === NUL for new post
if ($value !== NULL) {
return $value;
}
$value = array_fill(0, 20, array());
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.