WordPress at a glance
функция не описана

WP_Date_Query::build_value() public WP 3.7.0

Builds and validates a value string based on the comparison operator.

It's a method of the class: WP_Date_Query{}

Хуков нет.

Возвращает

String/false/Int. The value to be used in SQL or false on error.

Использование

$WP_Date_Query = new WP_Date_Query();
$WP_Date_Query->build_value( $compare, $value );
$compare(string) (required)
The compare operator to use.
$value(string/array) (required)
The value.

Changelog

Since 3.7.0 Introduced.

Код WP_Date_Query::build_value() WP 5.5.1

<?php
public function build_value( $compare, $value ) {
	if ( ! isset( $value ) ) {
		return false;
	}

	switch ( $compare ) {
		case 'IN':
		case 'NOT IN':
			$value = (array) $value;

			// Remove non-numeric values.
			$value = array_filter( $value, 'is_numeric' );

			if ( empty( $value ) ) {
				return false;
			}

			return '(' . implode( ',', array_map( 'intval', $value ) ) . ')';

		case 'BETWEEN':
		case 'NOT BETWEEN':
			if ( ! is_array( $value ) || 2 !== count( $value ) ) {
				$value = array( $value, $value );
			} else {
				$value = array_values( $value );
			}

			// If either value is non-numeric, bail.
			foreach ( $value as $v ) {
				if ( ! is_numeric( $v ) ) {
					return false;
				}
			}

			$value = array_map( 'intval', $value );

			return $value[0] . ' AND ' . $value[1];

		default:
			if ( ! is_numeric( $value ) ) {
				return false;
			}

			return (int) $value;
	}
}