media_handle_sideload ( $file_array, $post_id, $desc = null, $post_data = array() )
- (array) $file_array Array similar to a `$_FILES` upload array.
- (int) $post_id The post ID the media is associated with.
- (string) $desc Optional. Description of the side-loaded file. Default null.
- (array) $post_data Optional. Post data to override. Default empty array.
- (int|object) The ID of the attachment or a WP_Error on failure.
- Introduced in WordPress: 2.6.0
- Deprecated in WordPress: —
Handles a side-loaded file in the same way as an uploaded file is handled by media_handle_upload().