Skip to content

Commit

Permalink
Adding patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariel Jolo committed Jan 24, 2025
1 parent 6b7803a commit 8848113
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions themes/osi/inc/block-patterns.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
<?php
function disable_block_validation() {
// Disables the strict block validation.
add_filter('block_editor_rest_api_preload_paths', function ($preload_paths) {
return $preload_paths;
});

// Allows invalid block content.
add_filter('rest_request_before_callbacks', function ($response) {
return $response;
});

// Ensures blocks render even if invalid.
add_filter('rest_request_after_callbacks', function ($response) {
return $response;
});

// Disable block validation in the REST API.
add_filter('block_editor_rest_api_preload_paths', '__return_empty_array');
}
add_action('init', 'disable_block_validation');
add_filter('block_editor_rest_api_preload_paths', '__return_empty_array');

function register_osi_patterns() {
register_block_pattern(
Expand All @@ -29,6 +10,7 @@ function register_osi_patterns() {
'content' => <<<HTML
<!-- wp:group {"align":"full"} -->
<div class="wp-block-group alignfull header-header-two">
<!-- wp:html -->
<div class="header-two-solari header-top">
<div class="container">
<div class="row">
Expand Down Expand Up @@ -59,6 +41,7 @@ function register_osi_patterns() {
</div>
</div>
</div>
<!-- /wp:html -->
</div>
<!-- /wp:group -->
HTML,
Expand Down

0 comments on commit 8848113

Please sign in to comment.