image_sideload_extensions WordPress Filter Hook

The image_sideload_extensions filter hook is used to add custom file extensions to the list of allowed file extensions for image uploads in WordPress. This hook is useful for allowing custom image file formats to be uploaded and used in WordPress.

apply_filters( 'image_sideload_extensions', string[] $allowed_extensions, string $file ) #

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

Top ↑

Parameters

$allowed_extensions

(string[])Array of allowed file extensions.

$file

(string)The URL of the image to download.


Top ↑

Source

File: wp-admin/includes/media.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More