這是可能的重複到:
https://wordpress.stackexchange.com/questions/141534/how-to-customize-tinymce4-in-wp-3-9-the-old-way-for-styles-and-formats-doesnt
你在block_formats部分最感興趣改變namings,什麼是顯示在那裏,你也可以按照自定義格式。
:
function mce_mod($init) {
$init['block_formats'] = 'Paragraph=p;Heading 3=h3;Heading 4=h4';
$style_formats = array (
array('title' => 'Bold text', 'inline' => 'b'),
array('title' => 'Red text', 'inline' => 'span', 'styles' => array('color' => '#ff0000')),
array('title' => 'Red header', 'block' => 'h1', 'styles' => array('color' => '#ff0000')),
array('title' => 'Example 1', 'inline' => 'span', 'classes' => 'example1'),
array('title' => 'Example 2', 'inline' => 'span', 'classes' => 'example2')
);
$init['style_formats'] = json_encode($style_formats);
$init['style_formats_merge'] = false;
return $init;
}
add_filter('tiny_mce_before_init', 'mce_mod');
你會在WP文檔在這裏找到更多的信息