WordPress at a glance

wp_handle_sideload() WP 1.0

Wrapper for _wp_handle_upload().

Passes the {@see 'wp_handle_sideload'} action.

Is the basis for: media_handle_sideload()
Works based on: _wp_handle_upload()

No Hooks.


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


wp_handle_sideload( $file, $overrides, $time );
$file(array) (required) (passed by reference — &)
An array similar to that of a PHP $_FILES POST array
An associative array of names=>values to override default variables.
Default: false
Time formatted in 'yyyy/mm'.
Default: null


  • See: _wp_handle_upload()


Since 2.6.0 Introduced.

Code of wp handle sideload: wp-admin/includes/file.php WP 5.4.2

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

Related Functions

From tag: upload download (file system)

No comments
        Log In . Register