wpseek.com
A WordPress-centric search engine for devs and theme authors



is_allowed_http_origin › WordPress Function

Since3.4.0
Deprecatedn/a
is_allowed_http_origin ( $origin = null )
Parameters:
  • (string|null) $origin Origin URL. If not provided, the value of get_http_origin() is used.
    Required: No
    Default: null
Returns:
  • (string) Origin URL if allowed, empty string if not.
Defined at:
Codex:

Determines if the HTTP origin is an authorized one.



Source

function is_allowed_http_origin( $origin = null ) {
	$origin_arg = $origin;

	if ( null === $origin ) {
		$origin = get_http_origin();
	}

	if ( $origin && ! in_array( $origin, get_allowed_http_origins(), true ) ) {
		$origin = '';
	}

	/**
	 * Change the allowed HTTP origin result.
	 *
	 * @since 3.4.0
	 *
	 * @param string $origin     Origin URL if allowed, empty string if not.
	 * @param string $origin_arg Original origin string passed into is_allowed_http_origin function.
	 */
	return apply_filters( 'allowed_http_origin', $origin, $origin_arg );
}