Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_generate_attachment_metadata

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
2205
2206           if ( $max < 0 || $metadata['width'] * $metadata['height'] < $max ) {
2207                $max_side = apply_filters( 'wp_thumbnail_max_side_length', 128, $attachment_id, $file );
2208                $thumb = wp_create_thumbnail( $file, $max_side );
2209
2210                if ( @file_exists($thumb) )
2211                     $metadata['thumb'] = basename($thumb);
2212           }
2213      }
2214      return apply_filters( 'wp_generate_attachment_metadata', $metadata );
2215 }
2216
2217 function wp_create_thumbnail( $file, $max_side, $effect = '' ) {
2218
2219           // 1 = GIF, 2 = JPEG, 3 = PNG
2220
2221      if ( file_exists( $file ) ) {
2222           $type = getimagesize( $file );
2223