Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: big_image_size_threshold

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
264            * @param array  $imagesize     {
265            *     Indexed array of the image width and height in pixels.
266            *
267            *     @type int $0 The image width.
268            *     @type int $1 The image height.
269            * }
270            * @param string $file          Full path to the uploaded image file.
271            * @param int    $attachment_id Attachment post ID.
272            */
273           $threshold = (int) apply_filters( 'big_image_size_threshold', 2560, $imagesize, $file, $attachment_id );
274
275           // If the original image's dimensions are over the threshold,
276           // scale the image and use it as the "full" size.
277           if ( $threshold && ( $image_meta['width'] > $threshold || $image_meta['height'] > $threshold ) ) {
278                $editor = wp_get_image_editor( $file );
279
280                if ( is_wp_error( $editor ) ) {
281                     // This image cannot be edited.
282                     return $image_meta;