Using Gravity Forms ‘gform_rich_text_editor_buttons_row_three’ PHP action

The gform_rich_text_editor_buttons_row_three filter in Gravity Forms allows you to customize the buttons displayed in the third row within the Gravity Forms rich text editor.

Usage

add_filter('gform_rich_text_editor_buttons_row_three', 'my_function', 10, 2);

Parameters

  • $mce_buttons (array) – Array (empty by default) of third row buttons to include within the TinyMCE editor inside Gravity Forms.
  • $editor_id (string) – The HTML element ID for the field using the rich text editor.
  • $field_object (object) – Object containing information about the field.

More information

See Gravity Forms Docs: gform_rich_text_editor_buttons_row_three

Examples

Add a custom button to the third row of the rich text editor

Add a custom button called “MyButton” to the third row of the rich text editor.

function add_my_button($mce_buttons, $editor_id) {
  // Add custom button
  $mce_buttons[] = 'MyButton';
  return $mce_buttons;
}
add_filter('gform_rich_text_editor_buttons_row_three', 'add_my_button', 10, 2);

Add multiple buttons to the third row

Add multiple buttons to the third row of the rich text editor.

function add_multiple_buttons($mce_buttons, $editor_id) {
  // Add custom buttons
  $mce_buttons[] = 'Button1';
  $mce_buttons[] = 'Button2';
  $mce_buttons[] = 'Button3';
  return $mce_buttons;
}
add_filter('gform_rich_text_editor_buttons_row_three', 'add_multiple_buttons', 10, 2);

Add buttons to the third row for a specific form

Add custom buttons to the third row of the rich text editor for a specific form with form ID 2.

function add_buttons_specific_form($mce_buttons, $editor_id) {
  // Add custom buttons
  $mce_buttons[] = 'FormSpecificButton1';
  $mce_buttons[] = 'FormSpecificButton2';
  return $mce_buttons;
}
add_filter('gform_rich_text_editor_buttons_row_three_2', 'add_buttons_specific_form', 10, 2);

Add buttons to the third row for a specific field

Add custom buttons to the third row of the rich text editor for a specific field with form ID 2 and field ID 6.

function add_buttons_specific_field($mce_buttons, $editor_id) {
  // Add custom buttons
  $mce_buttons[] = 'FieldSpecificButton1';
  $mce_buttons[] = 'FieldSpecificButton2';
  return $mce_buttons;
}
add_filter('gform_rich_text_editor_buttons_row_three_2_6', 'add_buttons_specific_field', 10, 2);