WordPress at a glance
filter is not described

wp_handle_upload filter-hook . WP 2.1.0

Filters the data array for the uploaded file.


add_filter( 'wp_handle_upload', 'filter_function_name_107', 10, 2 );
function filter_function_name_107( $upload, $context ){
	// filter...

	return $upload;

Array of upload data.

  • $file (string)
    Filename of the newly-uploaded file.

  • $url (string)
    URL of the uploaded file.

  • $type (string)
    File type.
The type of upload action. Values include 'upload' or 'sideload'.

Where the hook is called

wp-admin/includes/file.php 889-893
return apply_filters( 'wp_handle_upload', array(
	'file' => $new_file,
	'url'  => $url,
	'type' => $type
), 'wp_handle_sideload' === $action ? 'sideload' : 'upload' );
wp-includes/functions.php 2220
return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $wp_filetype['type'], 'error' => false ), 'sideload' );

Where the hook is used (in WP core)

Does not used.