Skip to content

Commit

Permalink
Add stripped down tinymce toolbars to acf wysiwyg field, T-19418
Browse files Browse the repository at this point in the history
  • Loading branch information
Tumppex committed Jan 24, 2025
1 parent c48379b commit cdc5ada
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Add debug function to print all available blocks
* Fix page including all allowed blocks by default (default: none)
* Fix cssnano stripping out font-family declarations
* Add tripped down tinymce toolbars to acf wysiwyg, T-19418

### 9.4.7: 2024-12-04

Expand Down
1 change: 1 addition & 0 deletions inc/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
require get_theme_file_path( 'inc/hooks/acf-blocks.php' );
add_filter( 'block_categories_all', __NAMESPACE__ . '\acf_blocks_add_category_in_gutenberg', 10, 2 );
add_action( 'acf/init', __NAMESPACE__ . '\acf_blocks_init' );
add_filter( 'acf/fields/wysiwyg/toolbars', __NAMESPACE__ . '\add_custom_tinymce_toolbars' );

/**
* Form related hooks
Expand Down
6 changes: 6 additions & 0 deletions inc/hooks/acf-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,9 @@ function get_acf_block_icon_str( $icon_path ) {
include $icon_path;
return ob_get_clean();
} // end get_acf_block_icon_str

function add_custom_tinymce_toolbars( $toolbars ) {
$toolbars['Small'][1] = [ 'bold', 'italic', 'underline', 'strikethrough', 'link', 'bullist', 'numlist', 'blockquote' ];
$toolbars['Mini'][1] = [ 'bold', 'italic', 'underline', 'strikethrough', 'link' ];
return $toolbars;
} // end add_custom_tinymce_toolbars

0 comments on commit cdc5ada

Please sign in to comment.