
WordPressで書き始めて最初の苦難が、Enterキーを押すと<P>になり、行間が開き過ぎることである。Shift+EnterでBr 改行となる仕様となっている。Windows Live Editor も同じ方式だった。
Blogger では、Enter キーで、 <br>である。それが自然ではなかろうか。
使用頻度は<br> の方が高いのであれば、より簡単な操作で実現可能にしたいのが人情である。
そこでこの操作を入れ替えてみる。
functions.php に次のように追記するだけである。
/* Filter Tiny MCE Default Settings */
add_filter( 'tiny_mce_before_init', 'my_switch_tinymce_p_br' );
/**
* Switch Default Behaviour in TinyMCE to use "<br>"
* On Enter instead of "<p>"
*
* @link https://shellcreeper.com/?p=1041
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/tiny_mce_before_init
* @link http://www.tinymce.com/wiki.php/Configuration:forced_root_block
*/
function my_switch_tinymce_p_br( $settings ) {
$settings['forced_root_block'] = false;
return $settings;
}今のところ順調に機能している。楽である。


