Adding New Google Font Options To The TinyMCE Editor
Important
This functionality was deprecated in Total 5.0 because it caused more harm than good. For example, customers would manually change fonts in the Editor instead of setting them globally in the Customizer, which then required reapplying those changes manually later. Additionally, this functionality required loading extra scripts in the WordPress admin, which negatively impacted performance.
It’s best to define your site fonts using the Customizer, WPBakery builder modules, or Gutenberg. This change is an optimization aimed at improving consistency and performance.
/**
* Example function for adding new Google Fonts to the TinyMCE
*/
add_filter( 'wpex_mce_fonts', function( $fonts ) {
$fonts[] = 'Roboto Sans'; // Add Roboto Sans
return $fonts;
} );All PHP snippets should be added via child theme's functions.php file or via a plugin.
We recommend Code Snippets (100% Free) or WPCode (sponsored)
We recommend Code Snippets (100% Free) or WPCode (sponsored)
Related Snippets