Home › Forums › Add-ons › Repeater Field › Trying to get values from nested repeater in admin area › Reply To: Trying to get values from nested repeater in admin area
The problem is that ACF does not know what post you want to get the field from
add_action('wp_ajax_email_sender', 'email_sender');
function email_sender($field) {
// move this to the top
$post_id = $_POST["post_id"];
if( have_rows('day_repeater', $post_id) ):
// loop through the rows of data
while ( have_rows('day_repeater', $post_id) ) : the_row();
$date = get_sub_field('date'); // I need values from this field
// LOOP FOR NESTED REPEATER FIELD
if ( get_field('accommondation') ):
while( has_sub_field('accommondation') ) : the_row();
$notes = the_sub_field('notes'); // I need values from this field
endwhile;
endif;
endwhile;
endif;
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.