Skip to content

Instantly share code, notes, and snippets.

@Crocoblock
Created February 20, 2025 14:35
Show Gist options
  • Save Crocoblock/3f33588881a09c0dd275f11aa00c973f to your computer and use it in GitHub Desktop.
Save Crocoblock/3f33588881a09c0dd275f11aa00c973f to your computer and use it in GitHub Desktop.
JetFormBuilder / How to customize Wysiwyg Field in JetFormBuilder & JetEngine Forms
<?php
$wysiwygConfig = function ( $wysiwyg_config ) {
/**
* You can find a list of all available plugins as folder names
* in wp-includes/js/tinymce/plugins
*/
$plugins = array(
'colorpicker',
'textcolor',
);
$toolbar_buttons = array(
'|',
'fontselect',
'fontsizeselect',
'|',
'forecolor',
'backcolor'
);
$wysiwyg_config['tinymce']['plugins'] .= ',' . implode( ',', $plugins );
$wysiwyg_config['tinymce']['toolbar1'] .= ',' . implode( ',', $toolbar_buttons );
$wysiwyg_config['media_buttons'] = true;
return $wysiwyg_config;
};
// for JetFormBuilder
add_filter( 'jet-form-builder/fields/wysiwyg-field/config', $wysiwygConfig );
// for JetEngine Forms
add_filter( 'jet-engine/forms/fields/wysiwyg-field/config', $wysiwygConfig );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment