Skip to content

Commit 6a0d462

Browse files
Merge pull request #41 from WebDevStudios/hotfix/restrict-patterns-to-theme
Hotfix - restrict patterns to theme only
2 parents 63c6a56 + 706f4fc commit 6a0d462

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

inc/hooks/restrict-block-patterns.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Restrict block patterns to theme-specific patterns only.
4+
*
5+
* @package wdsbt
6+
*/
7+
8+
namespace WebDevStudios\wdsbt;
9+
10+
/**
11+
* Restrict patterns from the Dotcom library by overriding the patterns source site.
12+
*
13+
* @return string The string to disable the Dotcom patterns source.
14+
*/
15+
function restrict_block_editor_patterns() {
16+
return 'disable-dotcom-patterns-source';
17+
}
18+
add_filter( 'a8c_override_patterns_source_site', __NAMESPACE__ . '\restrict_block_editor_patterns' );
19+
20+
// Disable the loading of remote patterns from the Dotorg pattern directory.
21+
add_filter( 'should_load_remote_block_patterns', '__return_false' );

0 commit comments

Comments
 (0)