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

This hook occurs 2 times in this file.

Line Code
748           // Update the attachment
749           wp_insert_attachment($object, $cropped);
750           wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $cropped ) );
751           update_post_meta( $attachment_id, '_wp_attachment_is_custom_header', get_option('stylesheet' ) );
752
753           set_theme_mod('header_image', $url);
754
755           // cleanup
756           $medium = str_replace(basename($original), 'midsize-'.basename($original), $original);
757           @unlink( apply_filters( 'wp_delete_file', $medium ) );
758           @unlink( apply_filters( 'wp_delete_file', $original ) );
759
760           return $this->finished();
761      }
762
763      /**
764       * Display last step of custom header image page.
765       *
766       * @since 2.1.0
767       */