We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 30e1bb9 commit 6b7803aCopy full SHA for 6b7803a
1 file changed
themes/osi/inc/block-patterns.php
@@ -1,4 +1,25 @@
1
<?php
2
+function disable_block_validation() {
3
+ // Disables the strict block validation.
4
+ add_filter('block_editor_rest_api_preload_paths', function ($preload_paths) {
5
+ return $preload_paths;
6
+ });
7
+
8
+ // Allows invalid block content.
9
+ add_filter('rest_request_before_callbacks', function ($response) {
10
+ return $response;
11
12
13
+ // Ensures blocks render even if invalid.
14
+ add_filter('rest_request_after_callbacks', function ($response) {
15
16
17
18
+ // Disable block validation in the REST API.
19
+ add_filter('block_editor_rest_api_preload_paths', '__return_empty_array');
20
+}
21
+add_action('init', 'disable_block_validation');
22
23
function register_osi_patterns() {
24
register_block_pattern(
25
'osi/ai-header',
0 commit comments