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



popuplinks › WordPress Function

Since0.71
已弃用4.5.0
popuplinks ( $text )
参数:
  • (string) $text Content to replace links to open in a new tab.
    Required: Yes
返回:
  • (string) Content that has filtered links.
定义在:
文档:

Adds element attributes to open links in new tabs.



源码

function popuplinks( $text ) {
	_deprecated_function( __FUNCTION__, '4.5.0' );
	$text = preg_replace('/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text);
	return $text;
}