Home › Forums › Front-end Issues › acf_form to retrieve nested fields › Reply To: acf_form to retrieve nested fields
Looks like your not the only one not getting notifications, I did not get a notification that you replied. Sorry if this left you hanging.
anyway. If you wanted to target only the last row of a repeater, or any row. I would to this using get_post_meta() instead of ACF functions.
$repeater = 'repeater_field_name';
$sub_field = 'sub_field_name';
$repeater_count = intval(get_post_meta($post_id, $repeater, true);
if ($repeater_count) {
$last_row = $repeater_count - 1;
$value = get_post_meta($post_id, $repeater.'_'.$last_row.'_'.$sub_field, true);
// $value holds the value of the sub field of the last row
}
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.