I created simple wordpress plugin and I have to make it more flexible usign WYSIWYG editor inside. I have succesfully added wp_editor, but can't modify font size of a text.
According to docs:
'tinymce'
(bool|array) Whether to load TinyMCE. Can be used to pass settings directly to TinyMCE using an array. Default true.
I passed some TinyMCE settings to the array:
$settings = array(
'media_buttons' => false,
'textarea_rows' => 3,
'teeny' => true,
'quicktags' => true,
'default_editor' => 'TinyMCE',
'textarea_name' => $this->get_field_name( 'test' ),
'tinymce' => array(
'selector' => 'textarea',
'toolbar' => "undo redo | styleselect | fontsizeselect | bold italic | alignleft aligncenter alignright alignjustify | outdent indent",
'fontsize_formats' => "8px 10px 12px 14px 18px 24px 36px",
'height' => 350,
),
);
<?php wp_editor( $text = $test, $id = "test", $settings ); ?>
Unfortunately only height applies to the editor.
The field also saves only when typing in a text tab - in visual mode I have to manually change it to text and then type something to apply changes.
question from:
https://stackoverflow.com/questions/65898116/add-font-size-button-to-tinymce-wp-editor 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…