_autop_newline_preservation_helper

函式
_autop_newline_preservation_helper ( $matches )
Access
Private
引數
  • (array) $matches preg_replace_callback matches array
    Required:
返回值
  • (string)
定義位置
相關方法
__checked_selected_helperwp_embed_register_handlerwpmu_log_new_registrations
引入
3.1.0
棄用
-

_autop_newline_preservation_helper: 這個函式被WordPress用來保留通過autop函式的文字中的換行。autop函式會自動給文字新增段落標籤,但這個函式確保換行符也被保留下來。

換行儲存wpautop()的幫助函式。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function _autop_newline_preservation_helper( $matches ) {
return str_replace( "n", '<WPPreserveNewline />', $matches[0] );
}
function _autop_newline_preservation_helper( $matches ) { return str_replace( "n", '<WPPreserveNewline />', $matches[0] ); }
function _autop_newline_preservation_helper( $matches ) {
	return str_replace( "n", '<WPPreserveNewline />', $matches[0] );
}

常見問題

FAQs
檢視更多 >