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.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 303 | |
| 304 | // Update the attachment |
| 305 | wp_insert_attachment($object, $cropped); |
| 306 | wp_update_attachment_metadata( $_POST['attachment_id'], wp_generate_attachment_metadata( $_POST['attachment_id'], $cropped ) ); |
| 307 | |
| 308 | set_theme_mod('header_image', $url); |
| 309 | |
| 310 | // cleanup |
| 311 | $medium = str_replace(basename($original), 'midsize-'.basename($original), $original); |
| 312 | @unlink( apply_filters( 'wp_delete_file', $medium ) ); |
| 313 | @unlink( apply_filters( 'wp_delete_file', $original ) ); |
| 314 | |
| 315 | return $this->finished(); |
| 316 | } |
| 317 | |
| 318 | function finished() { |
| 319 | ?> |
| 320 | <div class="wrap"> |
| 321 | <h2><?php _e('Header complete!'); ?></h2> |
| 322 | |