I have a nested repeater with Days of the week followed by times
Times is a repeater with in the Days of the week
I am trying to update the subfield of locations (check box group)
Basically all i want to do is turn off 1 location if my code calls for it. I am processing a front end form, and if the user checks this location then it will update the back end of this post.
I use this to update a text field, but can not figure out how to get the check boxes unchecked using the same logic
update_sub_field( array('date_and_time', $updatebooking['dtrow'], 'time', $updatebooking['timerow'], 'email'), $bookingemail , $updatebooking['postid'] );
i ran a loop and can return the array of the locations
if ( have_rows( ‘date_and_time’, $updatebooking[‘postid’] ) ) :
while ( have_rows( ‘date_and_time’,$updatebooking[‘postid’] ) ) : the_row();
if ( have_rows( ‘time’ ) ) :
while ( have_rows( ‘time’ ) ) : the_row();
$location_form_array = get_sub_field( ‘field_5d38d29aeb712’ );
endwhile;
endif;
endwhile;
endif;
I have a nested repeater with Days of the week followed by times
Times is a repeater with in the Days of the week
I am trying to update the subfield of locations (check box group)
Basically all i want to do is turn off 1 location if my code calls for it. I am processing a front end form, and if the user checks this location then it will update the back end of this post.
I use this to update a text field, but can not figure out how to get the check boxes unchecked using the same logic
update_sub_field( array('date_and_time', $updatebooking['dtrow'], 'time', $updatebooking['timerow'], 'email'), $bookingemail , $updatebooking['postid'] );
i ran a loop and can return the array of the locations
if ( have_rows( ‘date_and_time’, $updatebooking[‘postid’] ) ) :
while ( have_rows( ‘date_and_time’,$updatebooking[‘postid’] ) ) : the_row();
if ( have_rows( ‘time’ ) ) :
while ( have_rows( ‘time’ ) ) : the_row();
$location_form_array = get_sub_field( ‘field_5d38d29aeb712’ );
endwhile;
endif;
endwhile;
endif;
You must be logged in to reply to this topic.
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!
🚀 This week’s session of ACF Chat Fridays dips into the preliminary results of our first ever user survey. Don’t miss it! https://t.co/3UtvQbDwNm pic.twitter.com/kMwhaJTkZc
— Advanced Custom Fields (@wp_acf) May 9, 2023
© 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.