popuplinks

函数
popuplinks ( $text )
参数
  • (string) $text Content to replace links to open in a new tab.
    Required:
返回值
  • (string) Content that has filtered links.
定义位置
相关方法
populate_optionscomments_popup_linkwp_paused_pluginspost_permalinkwp_update_link
引入
0.71
弃用
4.5.0

popuplinks: 这个函数用来给所有在新窗口打开的链接添加”弹出”类。

添加元素属性以在新标签中打开链接。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function popuplinks( $text ) {
_deprecated_function( __FUNCTION__, '4.5.0' );
$text = preg_replace('/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text);
return $text;
}
function popuplinks( $text ) { _deprecated_function( __FUNCTION__, '4.5.0' ); $text = preg_replace('/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text); return $text; }
function popuplinks( $text ) {
	_deprecated_function( __FUNCTION__, '4.5.0' );
	$text = preg_replace('/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text);
	return $text;
}

常见问题

FAQs
查看更多 >