wp_handle_upload

wp_handle_upload

Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: wordpress-5.0.3

do_action('wp_handle_upload') is found 2 times:

  • /wp-admin/includes/file.php line 889
    	 *     @type string $type File type.
    	 * }
    	 * @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
    	), 'wp_handle_sideload' === $action ? 'sideload' : 'upload' );
    }
    
    
  • /wp-includes/functions.php line 2220
    	// Compute the URL
    	$url = $upload['url'] . "/$filename";
    
    	/** This filter is documented in wp-admin/includes/file.php */
    	return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $wp_filetype['type'], 'error' => false ), 'sideload' );
    }
    
    /**
     * Retrieve the file type based on the extension name.
     *
     * @since 2.5.0
    

See this hook used in plugins: