wppaste
WordPress

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

Since
3.7.0, 4.1.0, 4.6.0
Filters the list of valid date query columns.

Compatibility

WordPress
since 4.6.0
  • 6.7.10
  • 6.8.11
  • 6.9.10
  • 7.0.7
  • 7.1.3

Present in every tracked release (6.7.10 to 7.1.3).

Parameters

$valid_columnsstring[]
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'.

Where this hook fires · 1

  • wp-includes/class-wp-date-query.php:510WP_Date_Query::validate_column()

Source code

			 *			 * @param string[] $valid_columns 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'.			 */			if ( ! in_array( $column, apply_filters( 'date_query_valid_columns', $valid_columns ), true ) ) {				$column = 'post_date';			} 			$known_columns = array(				$wpdb->posts    => array(					'post_date',

Changelog

Introduced in 3.7.0. Unchanged from 6.7.10 through 7.1.3.

  1. 6.7.10
  2. 6.8.11
  3. 6.9.10
  4. 7.0.7
  5. 7.1.3

Signature, return type and hooks compared across 5 parsed releases.

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

About this page

Parsed data
Generated from the wordpress-develop 6.7.10 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.