Skip to content

Commit 18bdd59

Browse files
committed
Create new patterns.php file
1 parent e90e358 commit 18bdd59

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

functions.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @link https://developer.wordpress.org/themes/basics/theme-functions/
77
*
88
* @package Bootscore
9-
* @version 6.1.0
9+
* @version 6.1.1
1010
*/
1111

1212

@@ -47,6 +47,7 @@
4747
require_once('inc/navmenu.php'); // Register the nav menus
4848
require_once('inc/pagination.php'); // Pagination for loop and single posts
4949
require_once('inc/password-protected-form.php'); // Form if post or page is protected by password
50+
require_once('inc/patterns.php'); // Register pattern category and script to hide wp-block classes
5051
require_once('inc/template-tags.php'); // Meta information like author, date, comments, category and tags badges
5152
require_once('inc/template-functions.php'); // Functions which enhance the theme by hooking into WordPress
5253
require_once('inc/widgets.php'); // Register widget area and disables Gutenberg in widgets

inc/patterns.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
/**
4+
* Patterns
5+
*
6+
* @package Bootscore
7+
* @version 6.1.1
8+
*/
9+
10+
11+
// Exit if accessed directly
12+
defined('ABSPATH') || exit;
13+
14+
15+
16+
/*
17+
* Register pattern category
18+
*/
19+
function bootscore_pattern_category() {
20+
register_block_pattern_category(
21+
'bootscore',
22+
array( 'label' => __( 'Bootscore', 'bootscore' ) )
23+
);
24+
}
25+
add_action('init', 'bootscore_pattern_category');

inc/theme-setup.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,6 @@ function bootscore_setup() {
7575
* Add theme support for block template-parts.
7676
*/
7777
add_theme_support( 'block-template-parts' );
78-
79-
/*
80-
* Register pattern category
81-
*/
82-
register_block_pattern_category(
83-
'bootscore',
84-
array( 'label' => __( 'Bootscore', 'bootscore' ) )
85-
);
8678
}
8779
endif;
8880
add_action('after_setup_theme', 'bootscore_setup');

0 commit comments

Comments
 (0)