Skip to content

Commit bbdb87c

Browse files
authored
Disable font library (#21)
1 parent 09dd080 commit bbdb87c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ All features are activated by default when the plugin is activated.
2828
- Disable comments feeds
2929
- Disable feeds
3030
- Disable attachment pages
31+
- Disable font library
3132
- Discourage search engines from indexing in non-production environments
3233
- Remove contributor, subscriber and author roles
3334
- Remove Gutenberg's front-end block styles

headache.php

+11
Original file line numberDiff line numberDiff line change
@@ -314,3 +314,14 @@ function sanitize_tiny_mce_html_content(array $config): array
314314
}
315315

316316
add_filter('tiny_mce_before_init', __NAMESPACE__ . '\\sanitize_tiny_mce_html_content');
317+
318+
// Disable the font library.
319+
// https://developer.wordpress.org/news/snippets/how-to-disable-the-font-library/
320+
function disable_font_library(array $settings): array
321+
{
322+
$settings['fontLibraryEnabled'] = false;
323+
324+
return $settings;
325+
}
326+
327+
add_filter('block_editor_settings_all', __NAMESPACE__ . '\\disable_font_library');

0 commit comments

Comments
 (0)