apply_filters( ‘image_sideload_extensions’, string[] $allowed_extensions, string $file )

In this article

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

Description

The default allowed extensions are:

  • jpg
  • jpeg
  • jpe
  • png
  • gif
  • webp

Parameters

$allowed_extensionsstring[]
Array of allowed file extensions.
$filestring
The URL of the image to download.

Source

$allowed_extensions = apply_filters( 'image_sideload_extensions', $allowed_extensions, $file );

Changelog

VersionDescription
5.8.0Added 'webp' to the default list of allowed file extensions.
5.6.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.