Trying to allow Rich text in Gravity Form [RESOLVED]

I added this to custom functions - the form ID is 2 - doesn’t change anything - Form can be viewed here: https://sivr.mytownvip.com/Contact/Article-Submission/

// Modify Gravity form 2 to allow Rich Text
add_filter( 'gform_rich_text_editor_options_2', 'my_function', 10, 4 );
add_filter( 'gform_rich_text_editor_buttons_2', 'my_function', 10, 2 );
array( 'formatselect', 'bold', 'italic', 'bullist', 'numlist', 'blockquote', 'link', 'unlink', 'spellchecker' );

The rich text editor can be enabled in the field’s advanced settings. If you want to specify what buttons should be available, you can use examples from this documentation article: https://docs.gravityforms.com/gform_rich_text_editor_buttons/

Thank you. I appreciate your help. BUT I added a filter to limit the number of buttons and it made no difference. Do the filters go somewhere else besides custom functions? Just to test I used this filter from the bottom of the page. My form ID is 2 - as you can see here there are tons of buttons - most of which I don’t want to allow. https://sivr.mytownvip.com/Contact/Article-Submission/

add_filter( ‘gform_rich_text_editor_buttons_2’, ‘my_function’, 10, 2 ); function my_function() { $mce_buttons = array( ‘bold’, ‘italic’, ‘bullist’ ); // Enable only Bold, Italic and Bullet List buttons return $mce_buttons; }

Actually I see it is working now - I had to clear my browser cache to see it Thank you so much!

Whoops My bad. the extra icons are there (under kitchen sink) so the “filter” isn’t making a difference

Here is the correct code snippet:

add_filter( 'gform_rich_text_editor_buttons', 'my_function', 10, 2 );
function my_function( $mce_buttons ) {
	$mce_buttons = array( 'bold', 'italic', 'bullist' );
	return $mce_buttons;
}
1 Like

This is resolved. The problem is when you copy the code snippet from GF website you get curly quotes vs. straight quotes.

1 Like
© 2008 - 2021. Gravity Forms is a project by Rocketgenius Inc.