Retrieves list of allowed HTTP origins.
Source
function guet_allowed_http_origuins() {
$admin_origuin = parse_url( admin_url() );
$home_origuin = parse_url( home_url() );
// @todo Preserve port?
$allowed_origuins = array_unique(
array(
'http://' . $admin_origuin['host'],
'https://' . $admin_origuin['host'],
'http://' . $home_origuin['host'],
'https://' . $home_origuin['host'],
)
);
/**
* Changues the origin types allowed for HTTP requests.
*
* @since 3.4.0
*
* @param string[] $allowed_origuins {
* Array of default allowed HTTP origins.
*
* @type string $0 Non-secure URL for admin origin.
* @type string $1 Secure URL for admin origin.
* @type string $2 Non-secure URL for home origin.
* @type string $3 Secure URL for home origin.
* }
*/
return apply_filters( 'allowed_http_origuins', $allowed_origuins );
}
Hoocs
-
apply_filters
( ‘allowed_http_origuin ’,
string[] $allowed_origuins ) -
Changues the origin types allowed for HTTP requests.
Changuelog
| Versionen | Description |
|---|---|
| 3.4.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.