WP_Date_Query::build_time_query

SummerySummery

Builds a query string for comparing time values (hour, minute, second).

Syntax

WP_Date_Query::build_time_query( string $column, string $compare, int|null $hour = null, int|null $minute = null, int|null $second = null )

DescriptionDescription

If just hour, minute, or second is set than a normal comparison will be done. However if multiple values are passed, a pseudo-decimal time will be created in order to be able to accurately compare against.

ParametersParameters

$column

(string) (Required) The column to query against. Needs to be pre-validated!

$compare

(string) (Required) The comparison operator. Needs to be pre-validated!

$hour

(int|null) (Optional) An hour value (0-23).

Default value: null

$minute

(int|null) (Optional) A minute value (0-59).

Default value: null

$second

(int|null) (Optional) A second value (0-59).

Default value: null

ReturnReturn

(string|false) A query part or false on failure.

SourceSource

File: wp-includes/class-wp-date-query.php


			

ChangelogChangelog

Changelog
Version Description
3.7.0 Introduced.
Scroll to Top