mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Make a new function, wp_delete_file(). Use it.
Props scribu, wonderboymusic. Fixes #17864. git-svn-id: https://develop.svn.wordpress.org/trunk@31575 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -882,19 +882,11 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
|
||||
// Cleanup.
|
||||
$medium = str_replace( basename( $original ), 'midsize-' . basename( $original ), $original );
|
||||
if ( file_exists( $medium ) ) {
|
||||
/**
|
||||
* Filter the path of the file to delete.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @param string $medium Path to the file to delete.
|
||||
*/
|
||||
@unlink( apply_filters( 'wp_delete_file', $medium ) );
|
||||
wp_delete_file( $medium );
|
||||
}
|
||||
|
||||
if ( empty( $_POST['create-new-attachment'] ) && empty( $_POST['skip-cropping'] ) ) {
|
||||
/** This filter is documented in wp-admin/custom-header.php */
|
||||
@unlink( apply_filters( 'wp_delete_file', $original ) );
|
||||
wp_delete_file( $original );
|
||||
}
|
||||
|
||||
return $this->finished();
|
||||
|
||||
Reference in New Issue
Block a user