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
275            * @param array  $imagesize     {
276            *     Indexed array of the image width and height in pixels.
277            *
278            *     @type int $0 The image width.
279            *     @type int $1 The image height.
280            * }
281            * @param string $file          Full path to the uploaded image file.
282            * @param int    $attachment_id Attachment post ID.
283            */
284           $threshold = (int) apply_filters( 'big_image_size_threshold', 2560, $imagesize, $file, $attachment_id );
285
286           // If the original image's dimensions are over the threshold,
287           // scale the image and use it as the "full" size.
288           if ( $threshold && ( $image_meta['width'] > $threshold || $image_meta['height'] > $threshold ) ) {
289                $editor = wp_get_image_editor( $file );
290
291                if ( is_wp_error( $editor ) ) {
292                     // This image cannot be edited.
293                     return $image_meta;