Ticket #16391: 16391.2.diff
File 16391.2.diff, 1.2 KB (added by , 12 years ago) |
---|
-
wp-includes/post.php
205 205 206 206 $file = apply_filters( 'update_attached_file', $file, $attachment_id ); 207 207 $file = _wp_relative_upload_path($file); 208 if ( $file ) 209 return update_post_meta( $attachment_id, '_wp_attached_file', $file ); 208 210 209 return update_post_meta( $attachment_id, '_wp_attached_file', $file );211 return false; 210 212 } 211 213 212 214 /** … … 3940 3942 return false; 3941 3943 3942 3944 $data = apply_filters( 'wp_update_attachment_metadata', $data, $post->ID ); 3945 if ( $data ) 3946 return update_post_meta( $post->ID, '_wp_attachment_metadata', $data ); 3943 3947 3944 return update_post_meta( $post->ID, '_wp_attachment_metadata', $data);3948 return false; 3945 3949 } 3946 3950 3947 3951 /** … … 5186 5190 $thumbnail_id = absint( $thumbnail_id ); 5187 5191 if ( $post && $thumbnail_id && get_post( $thumbnail_id ) ) { 5188 5192 $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' ); 5189 if ( ! empty( $thumbnail_html ) ) {5193 if ( $thumbnail_html ) 5190 5194 return update_post_meta( $post->ID, '_thumbnail_id', $thumbnail_id ); 5191 }5192 5195 } 5193 5196 return false; 5194 5197 }