<?php
/**
* TinyMCEのスタイルをカスタマイズ
*/
function custom_mce_before_init( $settings ) {
$style_formats = [
[
'title' => '段落',
'block' => 'p',
],
[
'title' => '大見出し',
'block' => 'h2',
],
[
'title' => '中見出し',
'block' => 'h3',
],
[
'title' => '小見出し',
'block' => 'h4',
],
[
'title' => '外部リンクアイコン',
'selector' => 'a',
'classes' => '',
]
];
$settings['style_formats'] = json_encode( $style_formats );
return $settings;
}
add_filter( 'tiny_mce_before_init', 'custom_mce_before_init' );