作成日:2018-07-23, 更新日:2018-07-23
基本
テキストエリアに入れた改行ありの文字列をHTMLで整形するのが「wpautop()」ってヤツ。
「wp-includes/default-filters.php」の「add_filter("the_content", "wpautop");」が元。
コイツは「wp-includes/formatting.php」の中にいる「wpautop()」ってヤツ。
▼関係のある関数
・wpautop()
・wp_replace_in_html_tags()
・wp_html_split()
・get_html_split_regex()
・_autop_newline_preservation_helper()
あとは自分用に上記の各関数をコピればOK。
※scriptタグやphpの「<?」とかは独自で変換させる仕組みを用意してあげたほうが良いかも。