Validate event on creation / modifying and provide error message.
-
I hooked into
em_event_save
to check whether my taxonomies are valid or not.
But if I return false, the event is saved anyway and no error appears.
I also wonder whyem_event_validate
(or$EM_Event->validate()
) isn’t called, which would make more sense.
What do I miss?Code:
add_filter('em_event_save','em_event_filter_event_save', 1, 2); function em_event_filter_event_save($result, $EM_Event) { $condition = true; // Some condition for invalid taxonomy if ($condition) { $EM_Event->add_error('Some error message'); return false; } return $result; }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Validate event on creation / modifying and provide error message.’ is closed to new replies.