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



_links_add_base ›

Since2.7.0
已弃用n/a
_links_add_base ( $m )
访问:
  • private
参数:
  • (string) $m The matched link.
    Required: Yes
返回:
  • (string) The processed link.
定义在:
文档:

Callback to add a base url to relative links in passed content.



源码

function _links_add_base( $m ) {
	global $_links_add_base;
	//1 = attribute name  2 = quotation mark  3 = URL
	return $m[1] . '=' . $m[2] .
		( preg_match( '#^(\w{1,20}):#', $m[3], $protocol ) && in_array( $protocol[1], wp_allowed_protocols() ) ?
			$m[3] :
			WP_Http::make_absolute_url( $m[3], $_links_add_base )
		)
		. $m[2];
}