Skip to content

Commit 6b7803a

Browse files
author
Ariel Jolo
committed
Adding new template for AI-FSE that only contains <head> components
1 parent 30e1bb9 commit 6b7803a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

themes/osi/inc/block-patterns.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
11
<?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+
return $response;
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+
223
function register_osi_patterns() {
324
register_block_pattern(
425
'osi/ai-header',

0 commit comments

Comments
 (0)