get_http_origin()WP 3.4.0

Gets the HTTP Origin of the current request.

Hooks from the function

Return

String. URL of the origin. Empty string if no origin.

Usage

get_http_origin();

Changelog

Since 3.4.0 Introduced.

get_http_origin() code WP 6.7.1

function get_http_origin() {
	$origin = '';
	if ( ! empty( $_SERVER['HTTP_ORIGIN'] ) ) {
		$origin = $_SERVER['HTTP_ORIGIN'];
	}

	/**
	 * Changes the origin of an HTTP request.
	 *
	 * @since 3.4.0
	 *
	 * @param string $origin The original origin for the request.
	 */
	return apply_filters( 'http_origin', $origin );
}