attachment_max_dims

attachment_max_dims

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.8

apply_filters('attachment_max_dims') is found 1 times:

  • /wp-includes/deprecated.php line 1951
    1948
    1949
    1950
    1951
    1952
    1953
    1954
    1955
    1956
    1957
    list($src, $src_file) = $src;
     
    // Do we need to constrain the image?
    if ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) {
     
        $imagesize = wp_getimagesize($src_file);
     
        if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) {
            $actual_aspect = $imagesize[0] / $imagesize[1];
            $desired_aspect = $max_dims[0] / $max_dims[1];