AI Summary
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
.
parameter | type | description |
---|---|---|
$toolbarfrom_name | array | The list of TinyMCE button identifiers to display in the top toolbar. |
$field_id | int | The Rich Text field ID. |
$field_data | array | Field 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 );