Ticket #32695: 32695.diff
File 32695.diff, 1.0 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/media.php
835 835 * @param string $file The URL of the image to download. 836 836 * @param int $post_id The post ID the media is to be associated with. 837 837 * @param string $desc Optional. Description of the image. 838 * @param string $return Optional. Accepts 'html' (image tag html) or 'src' (URL). Default 'html'.838 * @param string $return Optional. Accepts 'html' (image tag html), 'src' (URL), or 'id' (attachment ID). Default 'html'. 839 839 * @return string|WP_Error Populated HTML img tag on success, WP_Error object otherwise. 840 840 */ 841 841 function media_sideload_image( $file, $post_id, $desc = null, $return = 'html' ) { … … 872 872 return $src; 873 873 } 874 874 875 if ( $return === 'id' ) { 876 return $id; 877 } 878 875 879 $alt = isset( $desc ) ? esc_attr( $desc ) : ''; 876 880 $html = "<img src='$src' alt='$alt' />"; 877 881 return $html;