钩子文档

http_origin

💡 云策文档标注

概述

http_origin 是一个 WordPress 过滤器,用于修改 HTTP 请求的来源(origin)。它允许开发者通过 apply_filters 钩子来调整或覆盖请求的 HTTP origin 值。

关键要点

  • http_origin 是一个过滤器钩子,用于改变 HTTP 请求的 origin。
  • 参数 $origin 是一个字符串,表示请求的 HTTP origin。
  • 该过滤器通过 apply_filters('http_origin', $origin) 调用,返回修改后的 origin 值。
  • WordPress 3.4.0 版本引入此过滤器。

相关函数

  • get_http_origin():位于 wp-includes/http.php,用于获取当前请求的 HTTP origin。

📄 原文内容

Changes the origin of an HTTP request.

Parameters

$originstring
The HTTP origin for the request.

Source

return apply_filters( 'http_origin', $origin );

Changelog

Version Description
3.4.0 Introduced.