WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 19c75b0

Browse files
authored
Merge pull request #299 from 10up/feature/267-remove-block-directory
Remove third-party block suggestions from the block inserter
2 parents be82de5 + 71d76e6 commit 19c75b0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

themes/10up-block-theme/src/Blocks.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ public function register() {
4242
);
4343
add_action( 'init', [ $this, 'register_theme_blocks' ], 10, 0 );
4444
add_action( 'init', [ $this, 'enqueue_theme_block_styles' ], 10, 0 );
45+
46+
// Prevents third-party blocks from being suggested in the block inserter.
47+
remove_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' );
4548
}
4649

4750

themes/10up-theme/src/Blocks.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ public function register() {
4545
add_action( 'init', [ $this, 'register_theme_blocks' ] );
4646
add_action( 'init', [ $this, 'register_block_pattern_categories' ] );
4747
add_filter( 'should_load_separate_core_block_assets', '__return_true' );
48+
49+
// Prevents third-party blocks from being suggested in the block inserter.
50+
remove_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' );
4851
}
4952

5053
/**

0 commit comments

Comments
 (0)