A WordPress-centric search engine for devs and theme authors



wp_handle_sideload ›

Since2.6.0
Deprecatedn/a
wp_handle_sideload ( $file, $overrides = false, $time = null )
Parameters: (3)
  • (array) $file An array similar to that of a PHP `$_FILES` POST array
    Required: Yes
  • (array|bool) $overrides Optional. An associative array of names=>values to override default variables. Default false.
    Required: No
    Default: false
  • (string) $time Optional. Time formatted in 'yyyy/mm'. Default null.
    Required: No
    Default: null
See:
Returns:
  • (array) On success, returns an associative array of file attributes. On failure, returns $overrides['upload_error_handler'](&$file, $message ) or array( 'error'=>$message ).
Defined at:
Codex:

Wrapper for _wp_handle_upload().

Passes the {@see 'wp_handle_sideload'} action.



Source

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