Home › Forums › Add-ons › Repeater Field › Copy/Paste Repeater Field Array › Reply To: Copy/Paste Repeater Field Array
Can you provide more info?
How is the data being added to the contents being added to lc_photos_list in the first instance?
If you then add info to lc_registration, does it matter what the post ID will be?
Based on your code, something like:
add_action( 'woocommerce_payment_complete_order_status_completed', 'lc_complete_for_status' );
function lc_complete_for_status( $order_id ){
if( have_rows('lc_photos_list', 579) ):
while( have_rows('lc_photos_list', 579) ) : the_row();
$sub_value = get_sub_field('sub_field');
$post_id = 576;
$row = array(
'field_61645b916cbd7' => $sub_value #this is your repeater field key
);
$i = add_row('field_61645b866cbd6', $row, $post_id); #this is the key for the main repeater
endwhile;
endif;
#update_field("lc_photos_list", $copyPhotosObject, 576);
}
I don’t know the repeater field info or how you get the post IDs (579/576)
Should hopefully get you underway.
Code is untested!
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.