(action)_overrides filter-hookWP 5.7.0

Filters the override parameters for a file before it is uploaded to WordPress.

The dynamic portion of the hook name, $action, refers to the post action.

Possible hook names include:

Usage

add_filter( '(action)_overrides', 'wp_kama_action_overrides_filter', 10, 2 );

/**
 * Function for `(action)_overrides` filter-hook.
 * 
 * @param array|false $overrides An array of override parameters for this file. Boolean false if none are provided. See {@see _wp_handle_upload()}.
 * @param array       $file      Reference to a single element from `$_FILES`.
 *
 * @return array|false
 */
function wp_kama_action_overrides_filter( $overrides, $file ){

	// filter...
	return $overrides;
}
$overrides(array|false)
An array of override parameters for this file. Boolean false if none are provided. See {@see _wp_handle_upload()}.
$file(array)

Reference to a single element from $_FILES.

  • name(string)
    The original name of the file on the client machine.

  • type(string)
    The mime type of the file, if the browser provided this information.

  • tmp_name(string)
    The temporary filename of the file in which the uploaded file was stored on the server.

  • size(int)
    The size, in bytes, of the uploaded file.

  • error(int)
    The error code associated with this file upload.

Changelog

Since 5.7.0 Introduced.

Where the hook is called

_wp_handle_upload()
(action)_overrides
wp-admin/includes/file.php 859
$overrides = apply_filters( "{$action}_overrides", $overrides, $file );

Where the hook is used in WordPress

Usage not found.