| 1 |
<?php |
| 2 |
/** |
| 3 |
* WYSIWIG field template |
| 4 |
*/ |
| 5 |
if ( empty( $args['default'] ) ) { |
| 6 |
$args['default'] = ''; |
| 7 |
} |
| 8 |
|
| 9 |
$editor_id = 'wp_editor_' . $this->block_type->get_field_id( $args['name'] ); |
| 10 |
$editor = array( |
| 11 |
'textarea_name' => $this->block_type->get_field_name( $args['name'] ), |
| 12 |
'media_buttons' => false, |
| 13 |
'textarea_rows' => 8, |
| 14 |
'quicktags' => false, |
| 15 |
'tinymce' => array( |
| 16 |
'plugins' => 'lists,paste,tabfocus,wplink,wordpress', |
| 17 |
'paste_as_text' => true, |
| 18 |
'paste_auto_cleanup_on_paste' => true, |
| 19 |
'paste_remove_spans' => true, |
| 20 |
'paste_remove_styles' => true, |
| 21 |
'paste_remove_styles_if_webkit' => true, |
| 22 |
'paste_strip_class_attributes' => true, |
| 23 |
'toolbar1' => 'bold,italic,|,bullist,numlist,|,link,unlink,|,undo,redo', |
| 24 |
'toolbar2' => '', |
| 25 |
'toolbar3' => '', |
| 26 |
'toolbar4' => '' |
| 27 |
), |
| 28 |
); |
| 29 |
|
| 30 |
?> |
| 31 |
<div class="jet-form-builder__field" data-editor="<?php echo htmlspecialchars( json_encode( $editor ) ); ?>"><?php |
| 32 |
wp_editor( $args['default'], $editor_id, $editor ); |
| 33 |
?></div> |
| 34 |
|