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
863           $medium = str_replace( basename( $original ), 'midsize-' . basename( $original ), $original );
864           if ( file_exists( $medium ) ) {
865                /**
866                 * Filter the path of the file to delete.
867                 *
868                 * @since 2.1.0
869                 *
870                 * @param string $medium Path to the file to delete.
871                 */
872                @unlink( apply_filters( 'wp_delete_file', $medium ) );
873           }
874
875           if ( empty( $_POST['create-new-attachment'] ) && empty( $_POST['skip-cropping'] ) ) {
876                /** This filter is documented in wp-admin/custom-header.php */
877                @unlink( apply_filters( 'wp_delete_file', $original ) );
878           }
879
880           return $this->finished();
881      }
882
883      /**
884       * Display last step of custom header image page.
885       *
886       * @since 2.1.0