eventsmanager

Adding Required Image when submitting an event

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

Adblocker detected! Please consider disabling it...

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

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

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

×