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