Support

Home Forums Event Espresso Premium Creat a Post overwrite glitch still exisits

Creat a Post overwrite glitch still exisits

Posted: November 14, 2013 at 12:07 pm


cstephens

November 14, 2013 at 12:07 pm

Here is what I wrote 8 months ago and it’s still broken:

Dealing with a frustrating glitch when using the Create a Post option to create a WordPress post (not an EE custom post).

When we have a new event open for registration we set the “Add/Update post for this event?” option to Yes. Everything works fine.

However, when we duplicate an event, the new event retains a link to the WordPress post created by the original event. When we edit and update the duplicated event, it overwrites the post created by the original event.

Even if we set the “Add/Update post for this event?” option to “No,” saving the duplicated event sets the default back to “Yes” (although it doesn’t update the original event’s post.

The only fix I’ve found is to edit the database record to remove the references to the WordPress post.

Can you fix this by having the duplicate event feature delete the post info stored in the record?


Josh

  • Support Staff

November 14, 2013 at 1:18 pm

Hi there,

In some cases folks don’t want a new post to be created when they duplicate events in order to avoid duplicated content on their blog. It turns out they’re depending on new posts not being created when an event is duplicated.

We have added a filter hook to the development build of Event Espresso that allows a “set it and forget it” filter to be applied so it creates a new post instead.

While we haven’t released the version that has the new filter hook, you can go into event-espresso/includes/event-management/copy_event.php and change the line (46) where it says:

'post_id'                         => $event->post_id,

to

'post_id'                         => 0,

After you update to Event Espresso 3.1.37 when it’s released, you will be able to use the new hook by adding this to a custom function file:

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

The support post ‘Creat a Post overwrite glitch still exisits’ 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.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Josh 5 years, 7 months ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!