Home › Forums › ACF PRO › load_fields with cloned fields › Reply To: load_fields with cloned fields
You didn’t mention that the problem was running out of memory.
It could be that your have_rows() loop is creating an infinite loop, this can happen when using ACF function to load values inside of filters for other ACF functions.
What you might have to do is use get_post_meta() instead of the ACF functions.
For example
$layouts = get_post_meta($post_id, 'blocks', true);
will return an array of layouts, something like this.
$layouts = get_post_meta($post_id, 'blocks', true);
if (count($layouts)) {
$field['choices'] = array();
for ($i=0; $i<count($layouts); $i++) {
if ($layouts[$i]) == 'anchor_point') {
$title = get_post_meta($post_id, 'block_'.$i.'_title', true);
$slug = sanitize_title($title);
$field['choices'][ $slug ] = $title;
} // end if layouts[$i] is anchor point
} // end for layouts
} // end if layouts
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.