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 |
---|---|
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 | } |
160 | return apply_filters( 'wp_generate_attachment_metadata', $metadata ); |
161 | } |
162 |
|
163 | function wp_load_image( $file ) { |
164 | if ( ctype_digit( $file ) ) |
165 | $file = get_attached_file( $file ); |
166 |
|
167 | if ( !file_exists( $file ) ) |
168 | return sprintf(__("File '%s' doesn't exist?"), $file); |
169 |
|