The forums are not ideal for posting blocks of code, small snippets of a few lines are ok, but the above has multiple formated ' and ‘ and ’, I have no idea if that’s from your code or the forum formatting so we recommend posting blocks of code to something like PasteBin and then posting the link here for us to view.
Other than the formatted quotes, the above code looks fine.
However, something to note is our models have a wrapper for get/update/add_post_meta which saves you haveing to pass the ID around makes it a little easier to follow.
$guest = $orig_event->get_post_meta('guest', true);
if ($guest) {
$new_event->update_post_meta('guest', $guest);
}
The relevant ID’s are passed internally.
Have you tried adding something like:
var_dump($orig_event);
var_dump($new_event));
To the beginning of that callback to confirm you have both objects when duplicating?
Viewing 1 reply thread
The support post ‘Duplicate Event including ACF?’ 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.