Controls the list of ports considered safe in HTTP API.
Description
Allows to change and allow external requests for the HTTP request.
Parameters
$allowed_ports
int[]- Array of integers for valid ports.
$host
string- Host name of the requested URL.
$url
string- Requested URL.
Source
$allowed_ports = apply_filters( 'http_allowed_safe_ports', array( 80, 443, 8080 ), $host, $url );
Changelog
Version | Description |
---|---|
5.9.0 | Introduced. |
By default, WordPress considers ports 80, 8080 and 443 as “safe”.
Example code snippet of changing allowed ports to 80, 8080, 443 and 3000: