/** * Query for events * * @since 0.4.0 * * @param array $args See WP_Query * * @return array Array of post objects */ function wp_get_events($args = array()) { // Parse arguments $r = wp_parse_args($args, array('post_type' => wp_event_calendar_allowed_post_types(), 'post_status' => array('publish', 'future'), 'posts_per_page' => -1, 'orderby' => 'meta_value', 'order' => 'ASC', 'hierarchical' => false, 'ignore_sticky_posts' => true, 'suppress_filters' => true, 'no_found_rows' => true, 'meta_query' => wp_event_calendar_get_meta_query())); // Query for events $query = new WP_Query($r); // Return posts return $query->posts; }
/** * Get the meta_query for the current mode * * @since 0.3.2 * * @return array */ protected function get_meta_query() { return wp_event_calendar_get_meta_query(array('mode' => $this->mode, 'start' => $this->view_start, 'end' => $this->view_end)); }