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.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

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:513WP_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.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

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 7.0.4 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.