Skip to content

Commit

Permalink
Merge pull request #171 from moderntribe/feature/MOOSE-175/disable-fo…
Browse files Browse the repository at this point in the history
…nt-library

[MOOSE-175]: Disable Font Library UI
  • Loading branch information
GeoffDusome authored Dec 16, 2024
2 parents cc9c5a8 + 64d510f commit da22dc2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
10 changes: 8 additions & 2 deletions wp-content/plugins/core/src/Blocks/Blocks_Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,16 @@ public function register(): void {
add_filter( 'should_load_remote_block_patterns', '__return_false' );

/**
* Disable openverse media category.
* Handle Block Editor Settings
*/
add_filter( 'block_editor_settings_all', function ( array $settings ): array {
return $this->container->get( Theme_Support::class )->disable_openverse_media_category( $settings );
// Disable openverse media category.
$settings = $this->container->get( Theme_Support::class )->disable_openverse_media_category( $settings );

// Disable the WP block editor font library.
$settings = $this->container->get( Theme_Support::class )->disable_font_library_ui( $settings );

return $settings;
} );
}

Expand Down
9 changes: 9 additions & 0 deletions wp-content/plugins/core/src/Theme_Config/Theme_Support.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ public function disable_openverse_media_category( array $settings ): array {
return $settings;
}

/**
* Dsiable the WP block editor font library
*/
public function disable_font_library_ui( array $settings ): array {
$settings['fontLibraryEnabled'] = false;

return $settings;
}

/**
* Disable Block Editor Widget Support
*/
Expand Down

0 comments on commit da22dc2

Please sign in to comment.