block_local_requests WordPress Filter Hook

The block_local_requests hook is used to prevent local requests from being made to a WordPress site. This is useful for sites that are behind a firewall or are not intended to be accessed by anyone other than the site owner.

apply_filters( 'block_local_requests', bool $block ) #

Filters whether to block local HTTP API requests.


Description

A local request is one to localhost or to the same host as the site itself.


Top ↑

Parameters

$block

(bool)Whether to block local requests. Default false.


Top ↑

Source

File: wp-includes/class-wp-http.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.8.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.