WP HOOKS
filtrod 5.6.0

image_sideload_extensions

Args 2Plik wp-admin/includes/media.phpDokumentacja WP ↗

Opis — z kodu źródłowego

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

The default allowed extensions are:

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

Parametry

ParametrTypOpis
$allowed_extensionsstring[]Array of allowed file extensions.
$filestringThe URL of the image to download.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'image_sideload_extensions', 'twoja_funkcja', 10, 2 );

function twoja_funkcja($param_1, $param_2) {
	// Twój kod
}

Popularne w tej kategorii