WPSEO_Image_Utils::filter_usable_file_size()public staticYoast 1.0

Filters a list of variations by (disk) file size.

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

Хуков нет.

Возвращает

Массив. The validations that pass the required file size limits.

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

$result = WPSEO_Image_Utils::filter_usable_file_size( $variations );
$variations(массив) (обязательный)
The variations to consider.

Код WPSEO_Image_Utils::filter_usable_file_size() Yoast 19.7.1

public static function filter_usable_file_size( $variations ) {
	foreach ( $variations as $variation ) {
		// We return early to prevent measuring the file size of all the variations.
		if ( self::has_usable_file_size( $variation ) ) {
			return [ $variation ];
		}
	}

	return [];
}