wppaste
WordPress

apply_filters( 'big_image_size_threshold', int $threshold, array $imagesize, string $file, int $attachment_id )

Since
5.3.0
Filters the "BIG image" threshold value.

Description

If the original image width or height is above the threshold, it will be scaled down. The threshold is used as max width and max height. The scaled down image will be used as the largest available size, including the _wp_attached_file post meta value.

Returning false from the filter callback will disable the scaling.

Compatibility

WordPress
since 5.3.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$thresholdint
The threshold value in pixels. Default 2560.
$imagesizearray
{ Indexed array of the image width and height in pixels.
@type int $0 The image width.
@type int $1 The image height.
}
  • $0int

    The image width.
  • $1int

    The image height.
$filestring
Full path to the uploaded image file.
$attachment_idint
Attachment post ID.

Where this hook fires · 1

  • wp-admin/includes/image.php:285wp_create_image_subsizes()

Source code

	 *     @type int $0 The image width.	 *     @type int $1 The image height.	 * }	 * @param string $file          Full path to the uploaded image file.	 * @param int    $attachment_id Attachment post ID.	 */	$threshold = (int) apply_filters( 'big_image_size_threshold', 2560, $imagesize, $file, $attachment_id ); 	/*	 * If the original image's dimensions are over the threshold,	 * scale the image and use it as the "full" size.	 */	$scale_down = false;

Changelog

Introduced in 5.3.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.