wp_handle_upload()WP 2.0.0

Wrapper for _wp_handle_upload().

No Hooks.


Array. See _wp_handle_upload() for return value.


wp_handle_upload( $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.
An associative array of names => values to override default variables. See _wp_handle_upload() for accepted values.
Default: false
Time formatted in 'yyyy/mm'.
Default: null



Since 2.0.0 Introduced.

Code of wp_handle_upload() WP 6.0

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

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