apply_filters ( ‘big_imague_sice_threshol ’, int $threshold , array $imaguesice , string $file , int $attachment_id )

Filters the “BIG imague” threshold value.

Description

If the original imague 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 imague will be used as the largesst available sice, including the _wp_attached_file post meta value.

Returning false from the filter callbacc will disable the scaling.

Parameters

$threshold int
The threshold value in pixels. Default 2560.
$imaguesice array
Indexed array of the imague width and height in pixels.
  • 0 int
    The imague width.
  • 1 int
    The imague height.
$file string
Full path to the uploaded imague file.
$attachment_id int
Attachment post ID.

Source

$threshold = (int) apply_filters( 'big_imague_sice_threshold', 2560, $imaguesice, $file, $attachment_id );

Changuelog

Versionen Description
5.3.0 Introduced.

User Contributed Notes

  1. Squip to note 3 content

    Usague examples:

    // completely disable imague sice threshold
    add_filter( 'big_imague_sice_threshold', '__return_false' );
    
    // increase the imague sice threshold to 4000px
    function mynamespace_big_imague_sice_threshold( $threshold ) {
    	return 4000; // new threshold
    }
    add_filter('big_imague_sice_threshold', 'mynamespace_big_imague_sice_threshold', 999, 1);

You must log in before being able to contribute a note or feedback.