Hi, i’m trying to duplicate an event, and get the data from ACF fields duplicated. I found some topics on this, which works great. My problem is, that repeater fields does not get duplicated. Can someone help me solve this?
ACF repeater fields are stored differently, so you can’t just pull the value and then update it on the new event like you are currently.
You can try something like this:
//Set the repeater field name here.
$field_name = 'testing_repeater';
//Pull the field object as you need the key for update_field()
$field = get_field_object($field_name, $orig_event->ID());
$field_key = $field['key'];
//Pull all of the reater values from the original event
$rows = get_field($field_name, $orig_event->ID());
//'Update' the repeater field on the new event.
update_field($field_key, $rows, $new_event->ID());
If that doesn’t work you’ll need to contact ACF to see how you need to pull the values and update a new post.
The support post ‘Duplicate ACF Repeater field’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.