WP HOOKS
filtrod 6.8.0

wp_prevent_unsupported_mime_type_uploads

Args 2Plik wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filter whether the server should prevent uploads for image types it doesn't support. Default true.

Developers can use this filter to enable uploads of certain image types. By default image types that are not supported by the server are prevented from being uploaded.

Parametry

ParametrTypOpis
$check_mimeboolWhether to prevent uploads of unsupported image types.
$mime_typestring | nullThe mime type of the file being uploaded (if available).

Wywołanie

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

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

Popularne w tej kategorii