wpseek.com
WordPress开发者和主题制作者的搜索引擎



big_image_size_threshold › WordPress过滤钩子

Since5.3.0
已弃用n/a
apply_filters( 'big_image_size_threshold', 2560, $imagesize, $file, $attachment_id )
参数: (4)
  • (int) $threshold The threshold value in pixels. Default 2560.
    Required: Yes
  • (array) $imagesize { Indexed array of the image width and height in pixels. @type int $0 The image width. @type int $1 The image height. }
    Required: Yes
  • (string) $file Full path to the uploaded image file.
    Required: Yes
  • (int) $attachment_id Attachment post ID.
    Required: Yes
定义在:
文档:

Filters the "BIG image" threshold value.

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.





源码

$threshold = (int) apply_filters( 'big_image_size_threshold', 2560, $imagesize, $file, $attachment_id );