# wp_load_image()

URL: https://chugunov.pro/api-wordpress/functions/wp_load_image/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 2.1.0.

> Устаревший элемент. Помечен устаревшим с версии 3.5.0.

## Сигнатура

```php
wp_load_image( string $file ): resource|GdImage|string
```

## Описание

См. alsowp_get_image_editor()

## Параметры

- `$file` `string` — обязательный. Имя файла загружаемого изображения.

## Возвращаемое значение

`resource|GdImage|string`

## Исходный код

Файл: `wp-includes/deprecated.php:3202`

```php
function wp_load_image( $file ) {
	_deprecated_function( __FUNCTION__, '3.5.0', 'wp_get_image_editor()' );

	if ( is_numeric( $file ) )
		$file = get_attached_file( $file );

	if ( ! is_file( $file ) ) {
		/* translators: %s: File name. */
		return sprintf( __( 'File &#8220;%s&#8221; does not exist?' ), $file );
	}

	if ( ! function_exists('imagecreatefromstring') )
		return __('The GD image library is not installed.');

	// Set artificially high because GD uses uncompressed images in memory.
	wp_raise_memory_limit( 'image' );

	$image = imagecreatefromstring( file_get_contents( $file ) );

	if ( ! is_gd_image( $image ) ) {
		/* translators: %s: File name. */
		return sprintf( __( 'File &#8220;%s&#8221; is not an image.' ), $file );
	}

	return $image;
}
```

## История изменений

- 3.5.0 — Deprecated. Use wp_get_image_editor()
- 2.1.0 — Introduced.

## Связанные

Использует: [`is_gd_image`](https://chugunov.pro/api-wordpress/functions/is_gd_image/), [`wp_raise_memory_limit`](https://chugunov.pro/api-wordpress/functions/wp_raise_memory_limit/), [`get_attached_file`](https://chugunov.pro/api-wordpress/functions/get_attached_file/), [`__`](https://chugunov.pro/api-wordpress/functions/__/), [`_deprecated_function`](https://chugunov.pro/api-wordpress/functions/_deprecated_function/).

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/wp_load_image/
