WordPress at a glance
function is not described

WP_Date_Query::validate_column() WP 3.7.0

Validates a column name parameter.

Column names without a table prefix (like 'post_date') are checked against a whitelist of known tables, and then, if found, have a table prefix (such as 'wp_posts.') prepended. Prefixed column names (such as 'wp_posts.post_date') bypass this whitelist check, and are only sanitized to remove illegal characters.

This is a method of the class: WP_Date_Query

Hooks from the method
Return

String. A validated column name value.

Usage

$WP_Date_Query = new WP_Date_Query();
$var = $WP_Date_Query->validate_column( $column );
$column(string) (required)
The user-supplied column name.

Changelog

Since 3.7.0 Introduced.

Code of WP Date Query::validate column: wp-includes/class-wp-date-query.php WP 5.4.2

<?php
public function validate_column( $column ) {
	global $wpdb;

	$valid_columns = array(
		'post_date',
		'post_date_gmt',
		'post_modified',
		'post_modified_gmt',
		'comment_date',
		'comment_date_gmt',
		'user_registered',
		'registered',
		'last_updated',
	);

	// Attempt to detect a table prefix.
	if ( false === strpos( $column, '.' ) ) {
		/**
		 * Filters the list of valid date query columns.
		 *
		 * @since 3.7.0
		 * @since 4.1.0 Added 'user_registered' to the default recognized columns.
		 *
		 * @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'
		 */
		if ( ! in_array( $column, apply_filters( 'date_query_valid_columns', $valid_columns ) ) ) {
			$column = 'post_date';
		}

		$known_columns = array(
			$wpdb->posts    => array(
				'post_date',
				'post_date_gmt',
				'post_modified',
				'post_modified_gmt',
			),
			$wpdb->comments => array(
				'comment_date',
				'comment_date_gmt',
			),
			$wpdb->users    => array(
				'user_registered',
			),
			$wpdb->blogs    => array(
				'registered',
				'last_updated',
			),
		);

		// If it's a known column name, add the appropriate table prefix.
		foreach ( $known_columns as $table_name => $table_columns ) {
			if ( in_array( $column, $table_columns ) ) {
				$column = $table_name . '.' . $column;
				break;
			}
		}
	}

	// Remove unsafe characters.
	return preg_replace( '/[^a-zA-Z0-9_$\.]/', '', $column );
}