Wicked Calendar Guide

wicked_get_events()

The wicked_get_events() function can be used to query events.  The function works the same as get_posts() but accepts some additional arguments to help you query events.

Usage

<?php $events = wicked_get_events( $args ); ?>

Parameters

$args
(array) (optional) An array of any arguments accepted by WP_Query plus the following Wicked Calendar specific arguments:

  • ‘start_date’
    (string) Event start date. Date can be in any format that can be parsed by strtotime().  Default: today’s date if no end date is supplied, otherwise false.
  • ‘end_date’
    (string) Event end date. Date can be in any format that can be parsed by strtotime().  Default: today’s date if no start date is supplied, otherwise false.
  • ‘start_date_compare’
    (string) Comparison operator for start date. Valid values are <, >, <>, <=, and >=.  Default is >=.
  • ‘end_date_compare’
    (string) Comparison operator end date. Valid values are <, >, <>, <=, and >=.  Default is <=.
  • ‘categories’
    (array) Array of event category slugs to filter events by.
  • ‘tags’
    (array) Array of event tag slugs to filter events by.
  • ‘recurring_event_instance_limit’
    (integer) The number of instances to return for each recurring event (if any) returned by the query. For example, if you want to get a list of upcoming events but only want each recurring event to be displayed once, set this to 1. Defaults to -1 (i.e. all recurring event instances are returned).

Return Value

(array)
List of events (WP_Post objects).