WP_REST_Attachments_Controller::dimension_exceeds_max │ private │ WP 7.1.0

Checks whether a dimension exceeds the maximum allowed value.

A maximum of zero means the dimension is unconstrained.

Метод класса: WP_REST_Attachments_Controller{}

Хуков нет.

Возвращает

bool. True if the value exceeds the maximum plus tolerance.

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

// private - только в коде основоного (родительского) класса
$result = $this->dimension_exceeds_max( $value, $max, $tolerance ): bool;
$value(int) (обязательный)
The actual dimension in pixels.
$max(int) (обязательный)
The maximum allowed dimension in pixels. Zero means no constraint.
$tolerance(int) (обязательный)
Pixel tolerance allowed for rounding differences.

Список изменений

С версии 7.1.0 Введена.

Код WP_REST_Attachments_Controller::dimension_exceeds_max() WP 7.1.2

private function dimension_exceeds_max( int $value, int $max, int $tolerance ): bool {
	return $max > 0 && $value > $max + $tolerance;
}