wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_is_internal_link › WordPress Function

Since6.2.0
已弃用n/a
wp_is_internal_link ( $link )
参数:
  • (string) $link The URL to test.
    Required: Yes
查看:
返回:
  • (bool) Returns true for internal URLs and false for all other URLs.
定义在:
文档:

Determines whether or not the specified URL is of a host included in the internal hosts list.



源码

function wp_is_internal_link( $link ) {
	$link = strtolower( $link );
	if ( in_array( wp_parse_url( $link, PHP_URL_SCHEME ), wp_allowed_protocols(), true ) ) {
		return in_array( wp_parse_url( $link, PHP_URL_HOST ), wp_internal_hosts(), true );
	}
	return false;
}