media_handle_sideload Wordpress function


This handles a sideloaded file in the same way as an uploaded file is handled by [email protected] media_handle_upload()}



(array) $file_array Array similar to a [email protected] $_FILES} upload array
(int) $post_id The post ID the media is associated with
(string) $desc Description of the sideloaded file
(array) $post_data allows you to overwrite some of the attachment

Return Type:

(int|object) The ID of the attachment or a WP_Error on failure

Define At:


Wordpress Reference URL:

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