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 |
|---|---|
| 325 | |
| 326 | $tmp_file = wp_tempnam($filename); |
| 327 | |
| 328 | // Move the file to the uploads dir |
| 329 | if ( false === @ move_uploaded_file( $file['tmp_name'], $tmp_file ) ) |
| 330 | return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) ); |
| 331 | |
| 332 | // If a resize was requested, perform the resize. |
| 333 | $image_resize = isset( $_POST['image_resize'] ) && 'true' == $_POST['image_resize']; |
| 334 | $do_resize = apply_filters( 'wp_upload_resize', $image_resize ); |
| 335 | $size = @getimagesize( $tmp_file ); |
| 336 | if ( $do_resize && $size ) { |
| 337 | $old_temp = $tmp_file; |
| 338 | $tmp_file = image_resize( $tmp_file, (int) get_option('large_size_w'), (int) get_option('large_size_h'), 0, 'resized'); |
| 339 | if ( ! is_wp_error($tmp_file) ) { |
| 340 | unlink($old_temp); |
| 341 | } else { |
| 342 | $tmp_file = $old_temp; |
| 343 | } |