WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WPSEO_Image_Utils::filter_usable_dimensions() public Yoast 1.0

Check original size of image. If original image is too small, return false, else return true.

Filters a list of variations by a certain set of usable dimensions.

{} Это метод класса: WPSEO_Image_Utils{}

Хуков нет.

Возвращает

Массив. Whether a variation is fit for display or not.

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

$result = WPSEO_Image_Utils::filter_usable_dimensions( $usable_dimensions, $variations );
$usable_dimensions(массив) (обязательный)

The parameters to check against.

  • min_width(int)
    Minimum width of image.

  • max_width(int)
    Maximum width of image.

  • min_height(int)
    Minimum height of image.

  • max_height(int)
    Maximum height of image.
$variations(массив) (обязательный)
The variations that should be considered.

Код WPSEO_Image_Utils::filter_usable_dimensions() Yoast 17.3

public static function filter_usable_dimensions( $usable_dimensions, $variations ) {
	$filtered = [];

	foreach ( $variations as $variation ) {
		$dimensions = $variation;

		if ( self::has_usable_dimensions( $dimensions, $usable_dimensions ) ) {
			$filtered[] = $variation;
		}
	}

	return $filtered;
}