Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: image_make_intermediate_size

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
477  * @param int $width Image width.
478  * @param int $height Image height.
479  * @param bool $crop Optional, default is false. Whether to crop image to specified height and width or resize.
480  * @return bool|array False, if no image was created. Metadata array on success.
481  */
482 function image_make_intermediate_size($file, $width, $height, $crop=false) {
483      if ( $width || $height ) {
484           $resized_file = image_resize($file, $width, $height, $crop);
485           if ( !is_wp_error($resized_file) && $resized_file && $info = getimagesize($resized_file) ) {
486                $resized_file = apply_filters('image_make_intermediate_size', $resized_file);
487                return array(
488                     'file' => basename( $resized_file ),
489                     'width' => $info[0],
490                     'height' => $info[1],
491                );
492           }
493      }
494      return false;
495 }