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
256      return $destfilename;
257 }
258
259 // resize an image to make a thumbnail or intermediate size, and return metadata describing the new copy
260 // returns false if no image was created
261 function image_make_intermediate_size($file, $width, $height, $crop=false) {
262      if ( $width || $height ) {
263           $resized_file = image_resize($file, $width, $height, $crop);
264           if ( !is_wp_error($resized_file) && $resized_file && $info = getimagesize($resized_file) ) {
265                $resized_file = apply_filters('image_make_intermediate_size', $resized_file);
266                return array(
267                     'file' => basename( $resized_file ),
268                     'width' => $info[0],
269                     'height' => $info[1],
270                );
271           }
272      }
273      return false;
274 }