allowed_http_origin

Change the allowed HTTP origin result.

Description

apply_filters( 'allowed_http_origin', (string) $origin, (string) $origin_arg ); 

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.
  1. $origin = apply_filters( 'allowed_http_origin', $origin, $origin_arg ); 
  2.  
  3. if ( !empty( $origin ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the allowed_http_origin callback 
  2. function filter_allowed_http_origin( $origin, $origin_arg ) { 
  3. // make filter magic happen here... 
  4. return $origin
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'allowed_http_origin', 'filter_allowed_http_origin', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. 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  
  1. return apply_filters( 'allowed_http_origin', $origin, $origin_arg );