_wp_handle_upload


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

Access:
  • private
Parameters:
  • (string[]) $file Reference to a single element of `$_FILES`. Call the function once for each uploaded file.
  • (string[]|false) $overrides An associative array of names => values to override default variables. Default false.
  • (string) $time Time formatted in 'yyyy/mm'.
  • (string) $action Expected value for `$_POST['action']`.
See:
  • wp_handle_upload_error
Returns:
  • (string[]) On success, returns an associative array of file attributes. On failure, returns `$overrides['upload_error_handler'](&$file, $message )` or `array( 'error'=>$message )`.
Defined at:

Description

Handle PHP uploads in WordPress, sanitizing file names, checking extensions for mime type, and moving the file to the appropriate directory within the uploads directory.

Related Functions

wp_handle_upload, wp_handle_sideload, wp_import_handle_upload, media_handle_upload, wp_get_upload_dir

Top Google Results

User discussions

wpseek mobile