Wrapper for _wp_handle_upload() .
Passes the ‘wp_handle_sideload’ action.
$filearrayrequired
$_FILES.$_FILES. Call the function once for each uploaded file.name stringtype stringtmp_name stringsize interror int$overridesarray|falseoptional
upload_error_handler callableunique_filename_callback callableupload_error_strings string[]$_FILES[{form field}]['error'].test_form bool$_POST['action'] parameter is as expected.test_size booltest_type boolmimes string[]Default:false
$timestring|nulloptional
'yyyy/mm'. Default:null
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 );
}
| Version | Description |
|---|---|
| 2.6.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_handle_sideload