tribe-common icon indicating copy to clipboard operation
tribe-common copied to clipboard

[ET-1565] Common > Create Customizable WYSIWYG Editor

Open codingmusician opened this issue 1 year ago • 0 comments

Ticket

ET-1565

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',
		],
	]
];

codingmusician avatar Aug 10 '22 16:08 codingmusician