media_sideload_image Wordpress function


Description:

Download an image from the specified URL and attach it to a post.


Syntax:


Arguments:

(string) $file The URL of the image to download
(int) $post_id The post ID the media is to be associated with
(string) $desc Optional. Description of the image


Return Type:

(string|WP_Error) Populated HTML img tag on success


Define At:

wp-admin/includes/media.php


Wordpress Reference URL:

http://codex.wordpress.org/Function_Reference/media_sideload_image


0 Flares Facebook 0 Google+ 0 0 Flares ×
Posted in: Wordpress functions
0 Flares Facebook 0 Pin It Share 0 Google+ 0 0 Flares ×