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
862           wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $cropped ) );
863
864           $width = $dst_width;
865           $height = $dst_height;
866           $this->set_header_image( compact( 'url', 'attachment_id', 'width', 'height' ) );
867
868           // cleanup
869           $medium = str_replace( basename( $original ), 'midsize-' . basename( $original ), $original );
870           if ( file_exists( $medium ) )
871                @unlink( apply_filters( 'wp_delete_file', $medium ) );
872           if ( empty( $_POST['create-new-attachment'] ) && empty( $_POST['skip-cropping'] ) )
873                @unlink( apply_filters( 'wp_delete_file', $original ) );
874
875           return $this->finished();
876      }
877
878      /**
879       * Display last step of custom header image page.
880       *
881       * @since 2.1.0
882       */