Created
February 20, 2025 14:35
-
-
Save Crocoblock/3f33588881a09c0dd275f11aa00c973f to your computer and use it in GitHub Desktop.
JetFormBuilder / How to customize Wysiwyg Field in JetFormBuilder & JetEngine Forms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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