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 8848113 commit e06b47d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions themes/osi/inc/block-patterns.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
<?php
add_filter('block_editor_rest_api_preload_paths', '__return_empty_array');

add_action('init', function () {
register_block_pattern_category(
'ai', // Unique slug for the category
['label' => __('AI', 'osi')] // Category label (visible in the editor)
);
});

function register_osi_patterns() {
register_block_pattern(
'osi/ai-header',
[
'title' => __('AI Header', 'osi'),
'description' => __('Reusable header for AI template.', 'osi'),
'categories' => ['ai'],
'content' => <<<HTML
<!-- wp:group {"align":"full"} -->
<div class="wp-block-group alignfull header-header-two">
Expand Down

0 comments on commit e06b47d

Please sign in to comment.