WordPress at a glance
filter is not described

(action)_prefilter filter-hook . WP 2.9.0

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

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

Usage

add_filter( '(action)_prefilter', 'filter_function_name_8291' );
function filter_function_name_8291( $file ){
	// filter...

	return $file;
}
$file(array)
An array of data for a single file.

Notes

  • Since 2.9.0 as 'wp_handle_upload_prefilter'.
  • Since 4.0.0 Converted to a dynamic hook with $action.

Where the hook is called

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

Where the hook is used (in WP core)

wp-includes/default-filters.php 101
add_filter( 'get_term_metadata', 'wp_check_term_meta_support_prefilter' );
wp-includes/default-filters.php 102
add_filter( 'add_term_metadata', 'wp_check_term_meta_support_prefilter' );
wp-includes/default-filters.php 103
add_filter( 'update_term_metadata', 'wp_check_term_meta_support_prefilter' );
wp-includes/default-filters.php 104
add_filter( 'delete_term_metadata', 'wp_check_term_meta_support_prefilter' );
wp-includes/default-filters.php 105
add_filter( 'get_term_metadata_by_mid', 'wp_check_term_meta_support_prefilter' );
wp-includes/default-filters.php 106
add_filter( 'update_term_metadata_by_mid', 'wp_check_term_meta_support_prefilter' );
wp-includes/default-filters.php 107
add_filter( 'delete_term_metadata_by_mid', 'wp_check_term_meta_support_prefilter' );
wp-includes/default-filters.php 108
add_filter( 'update_term_metadata_cache', 'wp_check_term_meta_support_prefilter' );
wp-admin/includes/ms-admin-filters.php 11
add_filter( 'wp_handle_upload_prefilter', 'check_upload_size' );