diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 7299dc247f..123054bf63 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -822,19 +822,20 @@ function wp_media_upload_handler() { } /** - * Download an image from the specified URL and attach it to a post. + * Downloads an image from the specified URL and attaches it to a post. * * @since 2.6.0 * @since 4.2.0 Introduced the `$return` parameter. * - * @param string $file The URL of the image to download - * @param int $post_id The post ID the media is to be associated with - * @param string $desc Optional. Description of the image - * @param string $return Optional. Accepts 'html' (image tag html) or 'src' (URL). Default 'html'. - * @return string|WP_Error Populated HTML img tag on success + * @param string $file The URL of the image to download. + * @param int $post_id The post ID the media is to be associated with. + * @param string $desc Optional. Description of the image. + * @param string $return Optional. Accepts 'html' (image tag html) or 'src' (URL). Default 'html'. + * @return string|WP_Error Populated HTML img tag on success, WP_Error object otherwise. */ function media_sideload_image( $file, $post_id, $desc = null, $return = 'html' ) { if ( ! empty( $file ) ) { + // Set variables for storage, fix file filename for query strings. preg_match( '/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches ); $file_array = array(); @@ -860,7 +861,7 @@ function media_sideload_image( $file, $post_id, $desc = null, $return = 'html' ) $src = wp_get_attachment_url( $id ); } - // Finally check to make sure the file has been saved, then return the HTML. + // Finally, check to make sure the file has been saved, then return the HTML. if ( ! empty( $src ) ) { if ( $return === 'src' ) { return $src; diff --git a/wp-includes/version.php b/wp-includes/version.php index 087667fc80..3ec1a63301 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32351'; +$wp_version = '4.3-alpha-32352'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.