Summery Summery

Wrapper for _wp_handle_upload().

Syntax Syntax

wp_handle_sideload( array $file, array|bool $overrides = false, string $time = null )

Description Description

Passes the ‘wp_handle_sideload’ action.

Parameters Parameters


(Required) Reference to a single element of $_FILES. Call the function once for each uploaded file.


(Optional) An associative array of names => values to override default variables.

Default value: false


(Optional) Time formatted in 'yyyy/mm'.

Default value: null

Return Return

(array) On success, returns an associative array of file attributes. On failure, returns $overrides['upload_error_handler']( &$file, $message ) or array( 'error' => $message ).

Source Source

File: wp-admin/includes/file.php

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 );


Changelog Changelog

Version Description
2.6.0 Introduced.

See also See also


Leave a Reply