apply_filters( 'wp_handle_upload', array $upload, string $context )
- Since
- 2.1.0
Filters the data array for the uploaded file.
Compatibility
- WordPress
- since 2.1.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$uploadarray- { Array of upload data.
@type string $file Filename of the newly-uploaded file.
@type string $url URL of the newly-uploaded file.
@type string $type Mime type of the newly-uploaded file.
}$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'.
Where this hook fires · 2
wp-admin/includes/file.php:1066_wp_handle_upload()wp-includes/functions.php:2980wp_upload_bits()
Source code
* @type string $file Filename of the newly-uploaded file. * @type string $url URL of the newly-uploaded file. * @type string $type Mime type of the newly-uploaded file. * } * @param string $context The type of upload action. Values include 'upload' or 'sideload'. */ return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type, ),Changelog
Introduced in 2.1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.9.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.