函数文档

redirect_this_site()

💡 云策文档标注

概述

redirect_this_site() 函数用于确保当前站点的域名被包含在允许的重定向主机列表中。它返回一个包含当前站点域名的数组。

关键要点

  • 函数返回一个数组,包含当前站点的域名。
  • 参数 $deprecated 已弃用,无需使用。
  • 相关函数包括 wp_validate_redirect() 和 get_network()。

代码示例

function redirect_this_site( $deprecated = '' ) {
	return array( get_network()->domain );
}

注意事项

  • 该函数自 WordPress MU 3.0.0 版本引入。
  • 主要用于多站点网络环境。

📄 原文内容

Ensures that the current site’s domain is listed in the allowed redirect host list.

Description

See also

Parameters

$deprecatedarray|stringrequired
Not used.

Return

string[] An array containing the current site’s domain.

  • 0 string
    The current site’s domain.

Source

function redirect_this_site( $deprecated = '' ) {
	return array( get_network()->domain );
}

Changelog

Version Description
MU (3.0.0) Introduced.