The gform_rich_text_editor_options filter in Gravity Forms allows you to modify the rich text editor options. You can target a specific FORMID or FORMID + FIELDID with the hook.
Usage
Apply to all forms:
add_filter('gform_rich_text_editor_options', 'my_function', 10, 4);
Target a specific form:
add_filter('gform_rich_text_editor_options_3', 'my_function', 10, 4);
Target a specific field for a specific form:
add_filter('gform_rich_text_editor_options_3_6', 'my_function', 10, 4);
Parameters
$editor_settings
(array): Array of buttons to include within the TinyMCE editor in Gravity Forms. Defaults are provided.$field_object
(object): The full field object returned.$form
(array): The form that the filter is being run on.$entry
(array): The entry, if available.
More information
See Gravity Forms Docs: gform_rich_text_editor_options
Source Code: This filter is located in class-gf-field-textarea.php
.
Examples
Set a custom height value
Change the editor height to 400:
function my_function($editor_settings, $field_object, $form, $entry) { $editor_settings['editor_height'] = 400; return $editor_settings; } add_filter('gform_rich_text_editor_options', 'my_function', 10, 4);
Enable the Add Media button
Add the Add Media button before the toolbar like in the WordPress Post/Page editor. The user must be logged in to see the button (WordPress requirement):
function show_media_button($editor_settings, $field_object, $form, $entry) { $editor_settings['media_buttons'] = true; return $editor_settings; } add_filter('gform_rich_text_editor_options', 'show_media_button', 10, 4);