﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
15432,media_handle_sideload() is not returning right value,acsnaterse,joostdevalk,"The media_handle_sideload() is not return the right value. Just like the media_handle_upload you would expect the $id as integer return value, but it returns the URL string.

This is happening in the last lines of the function:

{{{
// Save the attachment metadata
$id = wp_insert_attachment($attachment, $file, $post_id);
	
if ( !is_wp_error($id) ) {
	wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
	return $url;
}
return $id;
}}}

Also where this function is used ( in media_sideload_image() ) it is expecting the ID as return value.",defect (bug),closed,normal,3.1,Media,3.0.1,normal,fixed,has-patch,
