Function Reference/media handle upload
Usage
<?php media_handle_upload( $file_id, $post_id, $post_data, $overrides ); ?>
Parameters
- $file_id
- (string) (required) Index into the {@link $_FILES} array of the upload
- Default: None
- $post_id
- (int) (required) The post ID the media is associated with
- Default: None
- $post_data
- (array) (optional) allows you to overwrite some of the attachment
- Default: array()
- $overrides
- (array) (optional) allows you to override the {@link wp_handle_upload()} behavior
- Default: array( )
Return Values
- (int)
- the ID of the attachment
Change Log
Since: 2.5
Source File
media_handle_upload() is located in wp-admin/includes/media.php