Description

The wpforms_richtext_get_toolbar1 filter lets you customize the first row of TinyMCE buttons for the Rich Text field on the Visual tab. Use it to choose exactly which formatting icons appear in the top toolbar.

When you customize this toolbar, you must return the complete list of buttons you want to show. Your list replaces the defaults. For the second-row toolbar, use wpforms_richtext_get_toolbar2.

parametertypedescription
$toolbarfrom_namearrayThe list of TinyMCE button identifiers to display in the top toolbar.
$field_idintThe Rich Text field ID.
$field_dataarrayField data and settings

Source

wpforms\src\Pro\Forms\Fields\Richtext\Field.php

Example

function wpf_dev_customize_tinymce_toolbar1( $toolbar, $field_id, $field_data ) {
    return [
        'bold',
        'italic',
        'bullist',
        'numlist',
        'link',
        'wp_adv', // Toggle second-row toolbar.
    ];
}
add_filter( 'wpforms_richtext_get_toolbar1', 'wpf_dev_customize_tinymce_toolbar1', 10, 3 );

Reference Article