Ticket #32137: default-press-this-image-size.patch
File default-press-this-image-size.patch, 1.3 KB (added by , 10 years ago) |
---|
-
includes/class-wp-press-this.php
86 86 // Replace the POSTED content <img> with correct uploaded ones. 87 87 // Need to do it in two steps so we don't replace links to the original image if any. 88 88 $new_image = str_replace( $image_src, $new_src, $image ); 89 // Replace the full image size class name with default image size class name, 90 // if specified. 91 if (get_option('image_default_size') != '' && get_option('image_default_size') !== 'full') { 92 $new_image = str_replace( 'size-full', 'size-' . get_option('image_default_size'), $new_image ); 93 } 89 94 $content = str_replace( $image, $new_image, $content ); 90 95 } 91 96 } -
includes/media.php
856 856 return $id; 857 857 } 858 858 859 $src = wp_get_attachment_url( $id ); 859 $src_array = wp_get_attachment_image_src( $id, get_option('image_default_size') ); 860 $src = $src_array[0]; 860 861 } 861 862 862 863 // Finally check to make sure the file has been saved, then return the HTML.