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!
The topic ‘remove dates on duplicate’ is closed to new replies.