Welcome, visitor! Log in
 

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.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: 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.

Source View

This hook occurs 2 times in this file.

Line Code
889           wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $cropped ) );
890
891           $width = $dst_width;
892           $height = $dst_height;
893           $this->set_header_image( compact( 'url', 'attachment_id', 'width', 'height' ) );
894
895           // cleanup
896           $medium = str_replace( basename( $original ), 'midsize-' . basename( $original ), $original );
897           if ( file_exists( $medium ) )
898                @unlink( apply_filters( 'wp_delete_file', $medium ) );
899           if ( empty( $_POST['create-new-attachment'] ) && empty( $_POST['skip-cropping'] ) )
900                @unlink( apply_filters( 'wp_delete_file', $original ) );
901
902           return $this->finished();
903      }
904
905      /**
906       * Display last step of custom header image page.
907       *
908       * @since 2.1.0
909       */