Title: remove dates on duplicate
Last modified: August 31, 2016

---

# remove dates on duplicate

 *  Resolved [security_man](https://wordpress.org/support/users/security_man/)
 * (@security_man)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/remove-dates-on-duplicate/)
 * I see an apply filters in the duplicate function in em-event.php, but when i 
   try to hook into it there seems to be no effect on the resulting $EM_Events object
   that is returned.
 * What i am trying to do is remove the date’s upon duplication so that the user
   has to enter new ones in the future before saving. I know a new event is created
   when the duplicate function is run, but that is okay. If the date is saved with
   the duplication that is fine, but we want to make sure it cannot be modified 
   without changing the dates in the future.
 *     ```
       function my_remove_dates_on_duplicate($result,$EM_Event) {
       $EM_Event->event_start_date = null;
       return $EM_Event;
       }
   
       add_filter('em_event_duplicate','my_remove_dates_on_duplicate',10,2);
       ```
   
 * While i am at it, why can i not get the results from $EM_Event->duplicate that
   is set earlier in that function?
 * Any help or different direction would be great!
 * [https://wordpress.org/plugins/events-manager/](https://wordpress.org/plugins/events-manager/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Support [angelo_nwl](https://wordpress.org/support/users/angelo_nwl/)
 * (@angelo_nwl)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/remove-dates-on-duplicate/#post-7086316)
 * sorry but can I know what do you mean by “why can i not get the results from 
   $EM_Event->duplicate” ? Or did you mean $EM_Event->duplicated ?
 *  Thread Starter [security_man](https://wordpress.org/support/users/security_man/)
 * (@security_man)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/remove-dates-on-duplicate/#post-7086320)
 * Yeah, duplicated is what I meant
 *  Plugin Support [angelo_nwl](https://wordpress.org/support/users/angelo_nwl/)
 * (@angelo_nwl)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/remove-dates-on-duplicate/#post-7086341)
 * this line $EM_Event->duplicated is set as true inside this function or filter
   and you need to set it to true as well
 *  Thread Starter [security_man](https://wordpress.org/support/users/security_man/)
 * (@security_man)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/remove-dates-on-duplicate/#post-7086360)
 * without the filter i am not able to get the results of $EM_Event->duplicated.
   The filter was the other choice i was trying to get working. It does not seem
   to change the $EM_Event->event_start_date at all
 * so without the function i had above, if i go to the [mydomain.com]/events?action
   =edit&event_id=[duplicated event id] page, and have echo $EM_Event->duplicated;
   on that page i get nothing.
 * if i hook the function, on events?action=edit&event_id=[duplicated event id] 
   the start date is not null. What am i doing wrong?
 *  Thread Starter [security_man](https://wordpress.org/support/users/security_man/)
 * (@security_man)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/remove-dates-on-duplicate/#post-7086410)
 * any ideas on this guys?
 *  Plugin Support [angelo_nwl](https://wordpress.org/support/users/angelo_nwl/)
 * (@angelo_nwl)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/remove-dates-on-duplicate/#post-7086414)
 * you can try to hook into em_event_duplicate_pre filter instead which runs before
   saving the event;
 * for more info: you can try to check php file under classes/em-event.php

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘remove dates on duplicate’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=3550347)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [angelo_nwl](https://wordpress.org/support/users/angelo_nwl/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/remove-dates-on-duplicate/#post-7086414)
 * Status: resolved