Tribe__Events__Repositories__Event::filter_by_starts_after( string|DateTime|int $datetime, string|DateTimeZone $timezone = null )
Filters events whose start date occurs after the provided date; fetch is not inclusive.
Contents
Parameters
- $datetime
-
(string|DateTime|int) (Required) A
strtotime
parse-able string, a DateTime object or a timestamp. - $timezone
-
(string|DateTimeZone) (Optional) A timezone string, UTC offset or DateTimeZone object; defaults to the site timezone; this parameter is ignored if the
$datetime
parameter is a DatTime object.Default value: null
Return
(array) An array of arguments that should be added to the WP_Query object.
Source
File: src/Tribe/Repositories/Event.php
public function filter_by_starts_after( $datetime, $timezone = null ) { $date = Tribe__Date_Utils::build_date_object( $datetime, $timezone ) ->setTimezone( $this->normal_timezone ); return array( 'meta_query' => array( 'starts-after' => array( 'key' => $this->start_meta_key, 'compare' => '>', 'value' => $date->format( Tribe__Date_Utils::DBDATETIMEFORMAT ), 'type' => 'DATETIME', ), ), ); }
Changelog
Version | Description |
---|---|
4.9 | Introduced. |