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
檢視更多 >