Ticket #25443: 25443.diff
File 25443.diff, 2.6 KB (added by , 11 years ago) |
---|
-
src/wp-admin/custom-header.php
633 633 </table> 634 634 <?php endif; 635 635 636 /** 637 * Fires just before the submit button in the custom header options form. 638 * 639 * @since 3.1.0 640 */ 636 641 do_action( 'custom_header_options' ); 637 642 638 643 wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> … … 690 695 691 696 $this->set_header_image( compact( 'url', 'attachment_id', 'width', 'height' ) ); 692 697 693 do_action('wp_create_file_in_uploads', $file, $attachment_id); // For replication 698 /** 699 * Fires after the header image is set or an error is returned. 700 * 701 * @since 2.1.0 702 * 703 * @param string $file Path to the file. 704 * @param int $attachment_id Attachment ID. 705 */ 706 do_action( 'wp_create_file_in_uploads', $file, $attachment_id ); // For replication 707 694 708 return $this->finished(); 695 709 } elseif ( $width > $max_width ) { 696 710 $oitar = $width / $max_width; … … 698 712 if ( ! $image || is_wp_error( $image ) ) 699 713 wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) ); 700 714 701 $image = apply_filters('wp_create_file_in_uploads', $image, $attachment_id); // For replication 715 //duplicate_hook 716 $image = apply_filters( 'wp_create_file_in_uploads', $image, $attachment_id ); // For replication 702 717 703 718 $url = str_replace(basename($url), basename($image), $url); 704 719 $width = $width / $oitar; … … 839 854 if ( ! $cropped || is_wp_error( $cropped ) ) 840 855 wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) ); 841 856 842 $cropped = apply_filters('wp_create_file_in_uploads', $cropped, $attachment_id); // For replication 857 //duplicate_hook 858 $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication 843 859 844 860 $parent = get_post($attachment_id); 845 861 $parent_url = $parent->guid; … … 870 886 871 887 // cleanup 872 888 $medium = str_replace( basename( $original ), 'midsize-' . basename( $original ), $original ); 873 if ( file_exists( $medium ) ) 889 if ( file_exists( $medium ) ) { 890 //duplicate_hook 874 891 @unlink( apply_filters( 'wp_delete_file', $medium ) ); 875 if ( empty( $_POST['create-new-attachment'] ) && empty( $_POST['skip-cropping'] ) ) 892 } 893 894 if ( empty( $_POST['create-new-attachment'] ) && empty( $_POST['skip-cropping'] ) ) { 895 //duplicate_hook 876 896 @unlink( apply_filters( 'wp_delete_file', $original ) ); 897 } 877 898 878 899 return $this->finished(); 879 900 }