Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_delete_file

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
289           $parent_url = $parent->guid;
290
291           $url = str_replace(basename($parent_url), basename($header), $parent_url);
292
293           set_theme_mod('header_image', $url);
294
295           // cleanup
296           $file = get_attached_file( $_POST['attachment_id'] );
297           $medium = str_replace(basename($file), 'midsize-'.basename($file), $file);
298           @unlink( apply_filters( 'wp_delete_file', $medium ) );
299           wp_delete_attachment( $_POST['attachment_id'] );
300
301           return $this->finished();
302      }
303
304      function finished() {
305           ?>
306 <div class="wrap">
307 <h2><?php _e('Header complete!'); ?></h2>