WP HOOKS
filtrod 5.9.0

http_allowed_safe_ports

Args 3Plik wp-includes/http.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Controls the list of ports considered safe in HTTP API.

Allows to change and allow external requests for the HTTP request.

Parametry

ParametrTypOpis
$allowed_portsint[]Array of integers for valid ports. Default allowed ports are 80, 443, and 8080.
$hoststringHost name of the requested URL.
$urlstringRequested URL.

Wywołanie

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

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