allowed_http_origins
Filter HookDescription
Changes the origin types allowed for HTTP requests. }Hook Information
File Location |
wp-includes/http.php
View on GitHub
|
Hook Type | Filter |
Line Number | 464 |
Hook Parameters
Type | Name | Description |
---|---|---|
string[]
|
$allowed_origins
|
{ Array of default allowed HTTP origins. |
Usage Examples
Basic Usage
<?php
// Hook into allowed_http_origins
add_filter('allowed_http_origins', 'my_custom_filter', 10, 1);
function my_custom_filter($allowed_origins) {
// Your custom filtering logic here
return $allowed_origins;
}
Source Code Context
wp-includes/http.php:464
- How this hook is used in WordPress core
<?php
459 * @type string $1 Secure URL for admin origin.
460 * @type string $2 Non-secure URL for home origin.
461 * @type string $3 Secure URL for home origin.
462 * }
463 */
464 return apply_filters( 'allowed_http_origins', $allowed_origins );
465 }
466
467 /**
468 * Determines if the HTTP origin is an authorized one.
469 *
PHP Documentation
<?php
/**
* Changes the origin types allowed for HTTP requests.
*
* @since 3.4.0
*
* @param string[] $allowed_origins {
* 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.
* }
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/http.php
Related Hooks
Related hooks will be displayed here in future updates.