eventsmanager

Modify default event total spaces

Jul 15th, 2015
398
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3. for more information on adding this snippet to your site, see here
  4. http://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/
  5. */
  6.  
  7. /**
  8.  * Changes the default total spaces available for booking when creating a new event.
  9.  * @param EM_Event $EM_Event
  10.  */
  11. function my_em_default_total_spaces($EM_Event) {
  12.     if( empty($EM_Event->event_id) ){
  13.         $EM_Event->event_spaces = 30; //set the default Total Spaces you'd like here
  14.     }  
  15. }
  16. add_action('em_event', 'my_em_default_total_spaces', 10, 1);
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.

×