Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: image_downsize

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
134           return false;
135
136      $img_url = wp_get_attachment_url($id);
137      $meta = wp_get_attachment_metadata($id);
138      $width = $height = 0;
139      $is_intermediate = false;
140      $img_url_basename = wp_basename($img_url);
141
142      // plugins can use this to provide resize services
143      if ( $out = apply_filters('image_downsize', false, $id, $size) )
144           return $out;
145
146      // try for a new style intermediate size
147      if ( $intermediate = image_get_intermediate_size($id, $size) ) {
148           $img_url = str_replace($img_url_basename, $intermediate['file'], $img_url);
149           $width = $intermediate['width'];
150           $height = $intermediate['height'];
151           $is_intermediate = true;
152      }