date_query_valid_columns filter-hookWP 3.7.0

Filters the list of valid date query columns.

Usage

add_filter( 'date_query_valid_columns', 'wp_kama_date_query_valid_columns_filter' );

/**
 * Function for `date_query_valid_columns` filter-hook.
 * 
 * @param string[] $valid_columns An array of valid date query columns.
 *
 * @return string[]
 */
function wp_kama_date_query_valid_columns_filter( $valid_columns ){

	// filter...
	return $valid_columns;
}
$valid_columns(string[])
An array of valid date query columns.
Default: are 'post_date', 'post_date_gmt', 'post_modified', 'post_modified_gmt', 'comment_date', 'comment_date_gmt', 'user_registered', 'registered', 'last_updated'

Changelog

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

Where the hook is called

WP_Date_Query::validate_column()
date_query_valid_columns
wp-includes/class-wp-date-query.php 504
if ( ! in_array( $column, apply_filters( 'date_query_valid_columns', $valid_columns ), true ) ) {

Where the hook is used in WordPress

Usage not found.