date_query_valid_columns WordPress Filter Hook

This hook is used to allow columns other than 'post_date' and 'post_date_gmt' to be used in the date query.

apply_filters( 'date_query_valid_columns', string[] $valid_columns ) #

Filters the list of valid date query columns.


Parameters

$valid_columns

(string[])An array of valid date query columns. Defaults are 'post_date', 'post_date_gmt', 'post_modified', 'post_modified_gmt', 'comment_date', 'comment_date_gmt', 'user_registered', 'registered', 'last_updated'.


Top ↑

Source

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

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.6.0Added 'registered' and 'last_updated' to the default recognized columns.
4.1.0Added 'user_registered' to the default recognized columns.
3.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.