WPSEO_Image_Utils::get_full_size_image_data()protected staticYoast 1.0

Returns the image data for the full size image.

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

Хуков нет.

Возвращает

Массив|false. Array when there is a full size image. False if not.

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

$result = WPSEO_Image_Utils::get_full_size_image_data( $attachment_id );
$attachment_id(int) (обязательный)
Attachment ID.

Код WPSEO_Image_Utils::get_full_size_image_data() Yoast 22.4

protected static function get_full_size_image_data( $attachment_id ) {
	$image = wp_get_attachment_metadata( $attachment_id );
	if ( ! is_array( $image ) ) {
		return false;
	}

	$image['url']  = wp_get_attachment_image_url( $attachment_id, 'full' );
	$image['path'] = get_attached_file( $attachment_id );
	$image['size'] = 'full';

	return $image;
}