Controls the list of ports considered safe in HTTP API.
$allowed_portsint[]$hoststring$urlstringwp-includes/http.php:660wp_http_validate_url() * * @param int[] $allowed_ports Array of integers for valid ports. Default allowed ports * are 80, 443, and 8080. * @param string $host Host name of the requested URL. * @param string $url Requested URL. */ $allowed_ports = apply_filters( 'http_allowed_safe_ports', array( 80, 443, 8080 ), $host, $url ); if ( is_array( $allowed_ports ) && in_array( $port, $allowed_ports, true ) ) { return $url; } if ( $parsed_home && $same_host && isset( $parsed_home['port'] ) && $parsed_home['port'] === $port ) { return $url;Introduced in 5.9.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.