gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Filter to disable "downloadable block directory"

Open JoshuaDoshua opened this issue 4 years ago • 2 comments

What problem does this address?

I don't want to give my clients the ability to clog up their website with plugins and excessive blocks. I've developed blocks for them and other plugins could include blocks similar to those I've already developed leading to confusion. If a client has come to a developer to build a WordPress site, they shouldn't be proposed with decisions that could break the theme/design that's been developed specifically for them. Also, there's already a related filter for should_load_remote_block_patterns

What is your proposed solution?

Add a filter to disable suggestions for downloading blocks should_load_remote_block_directory

JoshuaDoshua avatar Jun 03 '22 09:06 JoshuaDoshua

Hi @JoshuaDoshua check out the remove_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' ); line from https://developer.wordpress.org/block-editor/reference-guides/filters/editor-filters/#block-directory. Hopefully that gives you what you need.

ALJ avatar Jun 05 '22 13:06 ALJ

Not sure how I missed that, it's right next to the patterns filter. 😂

JoshuaDoshua avatar Jun 05 '22 15:06 JoshuaDoshua