/**
  * 	process_shortcode - ESPRESSO_EVENTS - Returns a list of events
  * 	[ESPRESSO_EVENTS]
  * 	[ESPRESSO_EVENTS title="My Super Event"]
  * 	[ESPRESSO_EVENTS limit=5]
  * 	[ESPRESSO_EVENTS css_class="my-custom-class"]
  * 	[ESPRESSO_EVENTS month="April 2014"]
  * 	[ESPRESSO_EVENTS show_expired=true]
  * 	[ESPRESSO_EVENTS category_slug="free-events"]
  * 	[ESPRESSO_EVENTS order_by="start_date,id"]
  * 	[ESPRESSO_EVENTS sort="ASC"]
  *
  *  @access 	public
  *  @param 	array 	$attributes
  *  @return 	string
  */
 public function process_shortcode($attributes = array())
 {
     // make sure EED_Events_Archive is setup properly
     if (apply_filters('FHEE__fallback_shortcode_processor__EES_Espresso_Events', FALSE)) {
         EED_Events_Archive::instance()->event_list();
     }
     // merge in any attributes passed via fallback shortcode processor
     $attributes = array_merge((array) $attributes, (array) $this->_attributes);
     //set default attributes
     $default_espresso_events_shortcode_atts = array('title' => NULL, 'limit' => 10, 'css_class' => NULL, 'show_expired' => FALSE, 'month' => NULL, 'category_slug' => NULL, 'order_by' => 'start_date', 'sort' => 'ASC', 'fallback_shortcode_processor' => FALSE);
     // allow the defaults to be filtered
     $default_espresso_events_shortcode_atts = apply_filters('EES_Espresso_Events__process_shortcode__default_espresso_events_shortcode_atts', $default_espresso_events_shortcode_atts);
     // grab attributes and merge with defaults, then extract
     $attributes = array_merge($default_espresso_events_shortcode_atts, $attributes);
     // make sure we use the_excerpt()
     add_filter('FHEE__EES_Espresso_Events__process_shortcode__true', '__return_true');
     // run the query
     global $wp_query;
     $wp_query = new EE_Event_List_Query($attributes);
     // check what template is loaded and load filters accordingly
     EED_Events_Archive::instance()->template_include('loop-espresso_events.php');
     // load our template
     $event_list = EEH_Template::locate_template('loop-espresso_events.php', array(), TRUE, TRUE);
     // now reset the query and postdata
     wp_reset_query();
     wp_reset_postdata();
     EED_Events_Archive::remove_all_events_archive_filters();
     // pull our content from the output buffer and return it
     return $event_list;
 }
 /**
  * 	espresso_get_events
  * @param array $params
  * @return array
  */
 function espresso_get_events($params = array())
 {
     //set default params
     $default_espresso_events_params = array('limit' => 10, 'show_expired' => FALSE, 'month' => NULL, 'category_slug' => NULL, 'order_by' => 'start_date', 'sort' => 'ASC');
     // allow the defaults to be filtered
     $default_espresso_events_params = apply_filters('espresso_get_events__default_espresso_events_params', $default_espresso_events_params);
     // grab params and merge with defaults, then extract
     $params = array_merge($default_espresso_events_params, $params);
     // run the query
     $events_query = new EE_Event_List_Query($params);
     // assign results to a variable so we can return it
     $events = $events_query->have_posts() ? $events_query->posts : array();
     // but first reset the query and postdata
     wp_reset_query();
     wp_reset_postdata();
     EED_Events_Archive::remove_all_events_archive_filters();
     unset($events_query);
     return $events;
 }