Support

Home Forums Event Espresso Premium duplicating Event with Created Post causes overwrite of original Event's Post?

duplicating Event with Created Post causes overwrite of original Event's Post?

Posted: October 25, 2013 at 8:32 am


Milan

October 25, 2013 at 8:32 am

hi, I don’t know if this is a bug, but, it appears that duplicating an Event with a Created Post causes an overwrite of the Post connected to the original Event.


Josh

  • Support Staff

October 25, 2013 at 11:56 am

Hi Milan,

This was the intent because in many cases the event’s posts are desired to not be duplicated. For example if there’s a sewing class that meets twice a month and there’s an event that gets duplicated for each time people sign up for it there would be one post instead of 24 posts for the same class.

If your use case is different there’s a filter were going to release in Event Espresso 3.1.37 that you can use to override this feature.

In the meantime you can change the line in includes/event-management/copy_event.php (line 46) where it says:

'post_id' 	=> $event->post_id,

to

'post_id' 	=> 0,

After you update to Event Espresso 3.1.37.P you’ll be able to use the new filter in a custom function file to override it without changing a core file. Here’s a code snippet that will work for the .37 release:

function override_event_post_id (){
    return 0;
}
add_filter( 'filter_hook_espresso_existing_post_id', 'override_event_post_id' );

The support post ‘duplicating Event with Created Post causes overwrite of original Event's Post?’ 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.

Event Espresso