bookmark_bordergform_rich_text_editor_buttons

Description

Filters the buttons displayed within the Gravity Forms rich text editor.

Usage

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

Parameters

  • $mce_buttons array
    Array of buttons to include within the TinyMCE editor inside Gravity Forms
array( 'formatselect', 'bold', 'italic', 'bullist', 'numlist', 'blockquote', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'spellchecker' );
  • $editor_id string
    The HTML element ID for the field using the rich text editor.

  • $field_object object
    Object containing information about the field.

Examples

This example shows how you can add another button.

function my_function( $mce_buttons ) {
    $mce_buttons[] = 'wp_more';
    return $mce_buttons;
}
add_filter( 'gform_rich_text_editor_buttons', 'my_function', 10, 2 );

This example shows how you can remove the majority of the buttons.

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

Source Code

This filter hook is located in class-gf-field-textarea.php