Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Enable required core patterns for compatibility with 6.7.x #363

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions lib/blocks.php
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
<?php

add_action( 'init', function () {
add_action('init', function () {
// Register custom blocks from Advanced Custom Fields
register_block_type( get_template_directory() . '/blocks/main-nav' );
register_block_type( get_template_directory() . '/blocks/breadcrumbs' );
register_block_type(get_template_directory() . '/blocks/main-nav');
register_block_type(get_template_directory() . '/blocks/breadcrumbs');

// Remove core block patterns
remove_theme_support( 'core-block-patterns' );

// Remove included patterns that line 8 doesn't remove
unregister_block_pattern( 'core/social-links-shared-background-color' );
unregister_block_pattern( 'core/query-large-title-posts' );
// Remove core block patterns
remove_theme_support('core-block-patterns');

// Register Block Categories
register_block_pattern_category(
'page_layout',
array( 'label' => __( 'Page Layout', 'ucsc' ) )
array('label' => __('Page Layout', 'ucsc'))
);

register_block_pattern_category(
'text_layout',
array( 'label' => __( 'Text Layout', 'ucsc' ) )
array('label' => __('Text Layout', 'ucsc'))
);

register_block_pattern_category(
'banner',
array( 'label' => __( 'Banner', 'ucsc' ) )
array('label' => __('Banner', 'ucsc'))
);

register_block_pattern_category(
'grid',
array( 'label' => __( 'Grid', 'ucsc' ) )
array('label' => __('Grid', 'ucsc'))
);
} );
});