allowed_http_origin
Change the allowed HTTP origin result.
Description
Parameters (2)
- 0. $origin (string)
- Origin URL if allowed, empty string if not.
- 1. $origin_arg (string)
- Original origin string passed into is_allowed_http_origin function.
Usage
- To run the hook, copy the example below.
- $origin = apply_filters( 'allowed_http_origin', $origin, $origin_arg );
- if ( !empty( $origin ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the allowed_http_origin callback
- function filter_allowed_http_origin( $origin, $origin_arg ) {
- // make filter magic happen here...
- return $origin;
- };
- // add the filter
- add_filter( 'allowed_http_origin', 'filter_allowed_http_origin', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'allowed_http_origin', 'filter_allowed_http_origin', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/http.php
- return apply_filters( 'allowed_http_origin', $origin, $origin_arg );