Changeset 31575
- Timestamp:
- 02/27/2015 04:50:14 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/custom-header.php
r31134 r31575 883 883 $medium = str_replace( basename( $original ), 'midsize-' . basename( $original ), $original ); 884 884 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 ); 893 886 } 894 887 895 888 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 ); 898 890 } 899 891 -
trunk/src/wp-admin/includes/image-edit.php
r31554 r31575 617 617 // Delete only if it's edited image. 618 618 if ( preg_match('/-e[0-9]{13}\./', $parts['basename']) ) { 619 620 /** This filter is documented in wp-admin/custom-header.php */ 621 $delpath = apply_filters( 'wp_delete_file', $file ); 622 @unlink($delpath); 619 wp_delete_file( $file ); 623 620 } 624 621 } elseif ( isset( $meta['width'], $meta['height'] ) ) { … … 643 640 // Delete only if it's edited image 644 641 if ( preg_match('/-e[0-9]{13}-/', $meta['sizes'][$default_size]['file']) ) { 645 /** This filter is documented in wp-admin/custom-header.php */ 646 $delpath = apply_filters( 'wp_delete_file', path_join($parts['dirname'], $meta['sizes'][$default_size]['file']) ); 647 @unlink($delpath); 642 $delete_file = path_join( $parts['dirname'], $meta['sizes'][$default_size]['file'] ); 643 wp_delete_file( $delete_file ); 648 644 } 649 645 } else { … … 858 854 859 855 if ( $delete ) { 860 861 /** This filter is documented in wp-admin/custom-header.php */ 862 $delpath = apply_filters( 'wp_delete_file', $new_path ); 863 @unlink( $delpath ); 856 wp_delete_file( $new_path ); 864 857 } 865 858 -
trunk/src/wp-includes/functions.php
r31554 r31575 4814 4814 return (bool) $var; 4815 4815 } 4816 4817 /** 4818 * Delete a file 4819 * 4820 * @since 4.2.0 4821 * 4822 * @param string $file The path to the file to delete. 4823 */ 4824 function wp_delete_file( $file ) { 4825 /** 4826 * Filter the path of the file to delete. 4827 * 4828 * @since 2.1.0 4829 * 4830 * @param string $medium Path to the file to delete. 4831 */ 4832 $delete = apply_filters( 'wp_delete_file', $file ); 4833 if ( ! empty( $delete ) ) { 4834 @unlink( $delete ); 4835 } 4836 } -
trunk/src/wp-includes/post.php
r31496 r31575 4848 4848 if (! $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata' AND meta_value LIKE %s AND post_id <> %d", '%' . $wpdb->esc_like( $meta['thumb'] ) . '%', $post_id)) ) { 4849 4849 $thumbfile = str_replace(basename($file), $meta['thumb'], $file); 4850 /** This filter is documented in wp- admin/custom-header.php */4850 /** This filter is documented in wp-includes/functions.php */ 4851 4851 $thumbfile = apply_filters( 'wp_delete_file', $thumbfile ); 4852 4852 @ unlink( path_join($uploadpath['basedir'], $thumbfile) ); … … 4858 4858 foreach ( $meta['sizes'] as $size => $sizeinfo ) { 4859 4859 $intermediate_file = str_replace( basename( $file ), $sizeinfo['file'], $file ); 4860 /** This filter is documented in wp- admin/custom-header.php */4860 /** This filter is documented in wp-includes/functions.php */ 4861 4861 $intermediate_file = apply_filters( 'wp_delete_file', $intermediate_file ); 4862 4862 @ unlink( path_join( $uploadpath['basedir'], $intermediate_file ) ); … … 4867 4867 foreach ( $backup_sizes as $size ) { 4868 4868 $del_file = path_join( dirname($meta['file']), $size['file'] ); 4869 /** This filter is documented in wp- admin/custom-header.php */4869 /** This filter is documented in wp-includes/functions.php */ 4870 4870 $del_file = apply_filters( 'wp_delete_file', $del_file ); 4871 4871 @ unlink( path_join($uploadpath['basedir'], $del_file) ); … … 4873 4873 } 4874 4874 4875 /** This filter is documented in wp-admin/custom-header.php */ 4876 $file = apply_filters( 'wp_delete_file', $file ); 4877 4878 if ( ! empty($file) ) 4879 @ unlink($file); 4875 wp_delete_file( $file ); 4880 4876 4881 4877 clean_post_cache( $post );
Note: See TracChangeset
for help on using the changeset viewer.