Adding Required Image when submitting an event

Feb 22nd, 2013
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);
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add to your ad blocker whitelist or disable your adblocking software.