get_http_origin

函数


get_http_origin ( No parameters )
返回值
  • (string) URL of the origin. Empty string if no origin.
定义位置
  • wp-includes/http.php
    , line 396
引入
3.4.0
弃用

Get the HTTP Origin of the current request.

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

	/**
	 * Change 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 );
}