wp_handle_sideload()WP 2.6.0

Wrapper for _wp_handle_upload().

No Hooks.

Return

Array. See _wp_handle_upload() for return value.

Usage

wp_handle_sideload( $file, $overrides, $time );
$file(array) (required) (passed by reference — &)
Reference to a single element of $_FILES. Call the function once for each uploaded file. See _wp_handle_upload() for accepted values.
$overrides(array|false)
An associative array of names => values to override default variables. See _wp_handle_upload() for accepted values.
Default: false
$time(string)
Time formatted in 'yyyy/mm'.
Default: null

Notes

Changelog

Since 2.6.0 Introduced.

Code of wp_handle_sideload() WP 6.0

function wp_handle_sideload( &$file, $overrides = false, $time = null ) {
	/*
	 *  $_POST['action'] must be set and its value must equal $overrides['action']
	 *  or this:
	 */
	$action = 'wp_handle_sideload';
	if ( isset( $overrides['action'] ) ) {
		$action = $overrides['action'];
	}

	return _wp_handle_upload( $file, $overrides, $time, $action );
}