http_allowed_safe_ports WordPress Filter Hook

The http_allowed_safe_ports Wordpress hook allows you to add or remove ports from the list of allowed ports for the HTTP transport layer. This can be useful if you need to add or remove a port for security reasons, or if you want to allow or disallow a particular type of traffic.

apply_filters( 'http_allowed_safe_ports', array $allowed_ports, string $host, string $url ) #

Controls the list of ports considered safe in HTTP API.


Description

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


Top ↑

Parameters

$allowed_ports

(array)Array of integers for valid ports.

$host

(string)Host name of the requested URL.

$url

(string)Requested URL.


Top ↑

Source

File: wp-includes/http.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.