eventsmanager

Random Events List

Dec 24th, 2014
522
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. Display random events list using custom shortcode [similarevents]
  3. */
  4. function similar_events() {
  5. $replace = "";
  6. $temp = array();
  7.  
  8. $events = EM_Events::get(array('scope'=>'future'));
  9. foreach ( $events as $EM_Event ) {
  10. array_push($temp,'<h6>'.$EM_Event->output('#_EVENTLINK').'</h6>');
  11. }
  12. shuffle($temp);
  13. foreach ( $temp as $event ) {
  14. if ($limit < 4)$replace .= $event;
  15. $limit++;
  16. }
  17. return $replace;
  18. }
  19. add_shortcode( 'similarevents', 'similar_events' );
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.

×