Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_handle_upload ›

Da2.0.0
Deprecaton/a
wp_handle_upload ( $file, $overrides = false, $time = null )
Parametri: (3)
  • (array) $file Reference to a single element of `$_FILES`. Call the function once for each uploaded file.
    Richiesto:
  • (array|bool) $overrides Optional. An associative array of names=>values to override default variables. Default false.
    Richiesto: No
    Default: false
  • (string) $time Optional. Time formatted in 'yyyy/mm'. Default null.
    Richiesto: No
    Default: null
Vedi:
Ritorna:
  • (array) On success, returns an associative array of file attributes. On failure, returns $overrides['upload_error_handler'](&$file, $message ) or array( 'error'=>$message ).
Definito a:
Codex:

Wrapper for _wp_handle_upload().

Passes the {@see 'wp_handle_upload'} action.



Sorgenti

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