On this page
apply_filters( 'wp_handle_upload', array $upload, string $context )
Filters the data array for the uploaded file.
Parameters
$uploadarray-
Array of upload data.
filestringFilename of the newly-uploaded file.urlstringURL of the newly-uploaded file.typestringMime type of the newly-uploaded file.
$contextstring-
The type of upload action. Values include
'upload'or'sideload'.
Source
File: wp-admin/includes/file.php. View all references
return apply_filters(
'wp_handle_upload',
array(
'file' => $new_file,
'url' => $url,
'type' => $type,
),
'wp_handle_sideload' === $action ? 'sideload' : 'upload'
);
Related
Used By
| Used By | Description |
|---|---|
| _wp_handle_upload() wp-admin/includes/file.php | Handles PHP uploads in WordPress. |
| wp_upload_bits() wp-includes/functions.php | Creates a file in the upload folder with given content. |
Changelog
| Version | Description |
|---|---|
| 2.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/wp_handle_upload