Make WordPress Core


Ignore:
Timestamp:
02/27/2015 04:50:14 PM (9 years ago)
Author:
wonderboymusic
Message:

Make a new function, wp_delete_file(). Use it.

Props scribu, wonderboymusic.
Fixes #17864.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/custom-header.php

    r31134 r31575  
    883883        $medium = str_replace( basename( $original ), 'midsize-' . basename( $original ), $original );
    884884        if ( file_exists( $medium ) ) {
    885             /**
    886              * Filter the path of the file to delete.
    887              *
    888              * @since 2.1.0
    889              *
    890              * @param string $medium Path to the file to delete.
    891              */
    892             @unlink( apply_filters( 'wp_delete_file', $medium ) );
     885            wp_delete_file( $medium );
    893886        }
    894887
    895888        if ( empty( $_POST['create-new-attachment'] ) && empty( $_POST['skip-cropping'] ) ) {
    896             /** This filter is documented in wp-admin/custom-header.php */
    897             @unlink( apply_filters( 'wp_delete_file', $original ) );
     889            wp_delete_file( $original );
    898890        }
    899891
Note: See TracChangeset for help on using the changeset viewer.