tribe-common
tribe-common copied to clipboard
[ET-1565] Common > Create Customizable WYSIWYG Editor
Ticket
Description
This enhances the current WYSIWYG field to accept settings so that you can customize the features that WP Editor uses.
The settings can be found here: https://developer.wordpress.org/reference/classes/_WP_Editors/parse_settings/
It also adds the ability to pass in what buttons you'd like to show within the editor.
Example usage:
$wysiwyg_field = [
'type' => 'wysiwyg',
'label' => esc_html__( 'Field Label', 'event-tickets' ),
'tooltip' => esc_html__( 'This is the description of the field.', 'tribe-common' ),
'default' => '',
'validation_type' => 'html',
'settings' => [
'media_buttons' => false,
'quicktags' => false,
'editor_height' => 200,
'buttons' => [
'bold',
'italic',
'underline',
'strikethrough',
],
]
];