Skip to content

Commit

Permalink
[MOOSE-175]: move settings to not split locations
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoffDusome committed Dec 16, 2024
1 parent 1fbc89c commit 64d510f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 23 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
16 changes: 0 additions & 16 deletions wp-content/plugins/core/src/Theme_Config/Block_Editor.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ public function register(): void {
// Hide existing comments
add_filter( 'comments_array', '__return_empty_array', 10 );

// Disable font library
add_filter( 'block_editor_settings_all', function ( array $settings ): array {
return $this->container->get( Block_Editor::class )->disable_font_library_ui( $settings );
} );

// Remove comments page in menu
add_action( 'admin_menu', function (): void {
$this->container->get( Comment_Support::class )->remove_comments_menu_item();
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 64d510f

Please sign in to comment.