函数原型
get_http_origin(): string
函数描述
Get the HTTP Origin of the current request.
是否弃用
未弃用
函数参数
无
函数返回值
string URL of the origin. Empty string if no origin.
函数位置
File: wp-includes/http.php.
函数源码
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 );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.4.0 | Introduced. |

