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
2116
2117           if ( $max < 0 || $metadata['width'] * $metadata['height'] < $max ) {
2118                $max_side = apply_filters( 'wp_thumbnail_max_side_length', 128, $attachment_id, $file );
2119                $thumb = wp_create_thumbnail( $file, $max_side );
2120
2121                if ( @file_exists($thumb) )
2122                     $metadata['thumb'] = basename($thumb);
2123           }
2124      }
2125      return apply_filters( 'wp_generate_attachment_metadata', $metadata );
2126 }
2127
2128 function wp_create_thumbnail( $file, $max_side, $effect = '' ) {
2129
2130           // 1 = GIF, 2 = JPEG, 3 = PNG
2131
2132      if ( file_exists( $file ) ) {
2133           $type = getimagesize( $file );
2134