
使用WP_Query的基础知识 + 代码示例
_autop_newline_preservation_helper ( $matches )
_autop_newline_preservation_helper: 这个函数被WordPress用来保留通过autop函数的文本中的换行。autop函数会自动给文本添加段落标签,但这个函数确保换行符也被保留下来。
换行保存wpautop()的帮助函数。
function _autop_newline_preservation_helper( $matches ) { return str_replace( "n", '<WPPreserveNewline />', $matches[0] ); }