WordPress at Your Fingertips
filter is not described

image_sideload_extensions filter-hook . WP 5.6.0

Filters the list of allowed file extensions when sideloading an image from a URL.

The default allowed extensions are:

  • jpg
  • jpeg
  • jpe
  • png
  • gif

Usage

add_filter( 'image_sideload_extensions', 'filter_function_name_6197', 10, 2 );
function filter_function_name_6197( $allowed_extensions, $file ){
	// filter...

	return $allowed_extensions;
}
$allowed_extensions(string[])
Array of allowed file extensions.
$file(string)
The URL of the image to download.

Changelog

Since 5.6.0 Introduced.

Where the hook is called

media_sideload_image()
image_sideload_extensions
wp-admin/includes/media.php 1003
$allowed_extensions = apply_filters( 'image_sideload_extensions', $allowed_extensions, $file );

Where in WP core the hook is used WordPress

Usage not found.