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

WPSEO_Image_Utils::has_usable_file_size() public Yoast 1.0

Checks a size version of an image to see if it's not too heavy.

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

Хуки из метода
Возвращает

true|false. True when the image is within limits, false if not.

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

$result = WPSEO_Image_Utils::has_usable_file_size( $image );
$image(массив) (обязательный)
Image to check the file size of.

Код WPSEO_Image_Utils::has_usable_file_size() Yoast 17.2

public static function has_usable_file_size( $image ) {
	if ( ! is_array( $image ) || $image === [] ) {
		return false;
	}

	/**
	 * Filter: 'wpseo_image_image_weight_limit' - Determines what the maximum weight
	 * (in bytes) of an image is allowed to be, default is 2 MB.
	 *
	 * @api int - The maximum weight (in bytes) of an image.
	 */
	$max_size = apply_filters( 'wpseo_image_image_weight_limit', 2097152 );

	// We cannot check without a path, so assume it's fine.
	if ( ! isset( $image['path'] ) ) {
		return true;
	}

	return ( self::get_file_size( $image ) <= $max_size );
}