Advertisement
eventsmanager

Adding Required Image when submitting an event

Feb 22nd, 2013
269
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2. This snippet will make featured image required when submitting new events.
  3. */
  4. function em_validate($result,$EM_Event){
  5. global $EM_Notices;
  6. $image = $EM_Event->get_image_url();
  7. if ( empty($image) && !is_admin()){
  8. $EM_Event->add_error('image is required.');
  9. }
  10. }
  11. add_filter('em_event_validate_meta','em_validate',10,2);
Advertisement
RAW Paste Data Copied
Advertisement