big_image_size_threshold

過濾鉤子
apply_filters( 'big_image_size_threshold', 2560, $imagesize, $file, $attachment_id )
引數
  • (int) $threshold The threshold value in pixels. Default 2560.
    Required:
  • (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:
  • (string) $file Full path to the uploaded image file.
    Required:
  • (int) $attachment_id Attachment post ID.
    Required:
定義位置
相關勾子
image_size_names_choosesite_icon_image_sizesrestrict_manage_siteswp_get_missing_image_subsizesembed_thumbnail_image_size
相關方法
image_size_input_fields_wp_get_image_size_from_metaadd_image_sizeget_image_send_to_editorhas_image_size_prime_site_caches
引入
5.3.0
棄用
-

big_image_size_threshold: 這是WordPress的一個過濾鉤子,允許開發者修改被認為是”大”圖片的尺寸閾值。big_image_size_threshold鉤子將預設的尺寸閾值作為一個引數傳遞,鉤子函式可以返回一個修改後的尺寸閾值來代替使用。這對於調整”大”影象檢測的行為非常有用。

過濾"大影象"的閾值。

如果原始影象的寬度或高度高於閾值,它將被縮小。閾值用作最大寬度和最大高度。縮小後的影象將用作最大可用大小,包括_wp_attached_file後元值。

從過濾器的回撥中返回false將禁用縮放。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$threshold = (int) apply_filters( 'big_image_size_threshold', 2560, $imagesize, $file, $attachment_id );
$threshold = (int) apply_filters( 'big_image_size_threshold', 2560, $imagesize, $file, $attachment_id );
$threshold = (int) apply_filters( 'big_image_size_threshold', 2560, $imagesize, $file, $attachment_id );

常見問題

FAQs
檢視更多 >