WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
141 | $metadata = array(); |
142 | if ( preg_match('!^image/!', get_post_mime_type( $attachment )) ) { |
143 | $imagesize = getimagesize($file); |
144 | $metadata['width'] = $imagesize['0']; |
145 | $metadata['height'] = $imagesize['1']; |
146 | list($uwidth, $uheight) = get_udims($metadata['width'], $metadata['height']); |
147 | $metadata['hwstring_small'] = "height='$uheight' width='$uwidth'"; |
148 | $metadata['file'] = $file; |
149 |
|
150 | $max = apply_filters( 'wp_thumbnail_creation_size_limit', 3 * 1024 * 1024, $attachment_id, $file ); |
151 |
|
152 | if ( $max < 0 || $metadata['width'] * $metadata['height'] < $max ) { |
153 | $max_side = apply_filters( 'wp_thumbnail_max_side_length', 128, $attachment_id, $file ); |
154 | $thumb = wp_create_thumbnail( $file, $max_side ); |
155 |
|
156 | if ( @file_exists($thumb) ) |
157 | $metadata['thumb'] = basename($thumb); |
158 | } |
159 | } |