# jpeg_quality

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

Тип: хук-фильтр.
Появился в версии: 2.5.0.

## Сигнатура

```php
apply_filters( 'jpeg_quality', int $quality, string $context )
```

## Описание

Applies only during initial editor instantiation, or when set_quality() is run manually without the `$quality` argument.

The [WP_Image_Editor::set_quality()](https://developer.wordpress.org/reference/classes/wp_image_editor/set_quality/) method has priority over the filter.

The filter is evaluated under two contexts: ‘image_resize’, and ‘edit_image’, (when a JPEG image is saved to file).

## Параметры

- `$quality` `int` — обязательный. Уровень качества JPEG от 0 (низкое) до 100 (высокое).
- `$context` `string` — обязательный. Контекст фильтра.

## Фильтруемое значение

Уровень качества JPEG от 0 (низкое) до 100 (высокое).

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

Файл: `wp-includes/class-wp-image-editor.php:288`

```php
$quality = apply_filters( 'jpeg_quality', $quality, 'image_resize' );
```

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

- 2.5.0 — Introduced.

## Связанные

Используется в: [`wp_save_image_file`](https://chugunov.pro/api-wordpress/functions/wp_save_image_file/), `WP_Image_Editor::set_quality`.

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