File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 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+
223function register_osi_patterns () {
324 register_block_pattern (
425 'osi/ai-header ' ,
You can’t perform that action at this time.
0 commit comments