big_image_size_threshold WordPress Filter Hook

The big_image_size_threshold hook is used to determine the maximum image size to be used when an image is inserted into the post content.

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

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.


Top ↑

Parameters

$threshold

(int)The threshold value in pixels. Default 2560.

$imagesize

(array)Indexed array of the image width and height in pixels.

  • (int) The image width.
  • '1'
    (int) The image height.

$file

(string)Full path to the uploaded image file.

$attachment_id

(int)Attachment post ID.


Top ↑

Source

File: wp-admin/includes/image.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.