generated from imagewize/moiraine-child
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
33 lines (29 loc) · 1.14 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
add_action( 'wp_enqueue_scripts', 'moiraine_child_enqueue_styles' );
/**
* Enqueue Moiraine Child styles.
*
* @return void
*/
function moiraine_child_enqueue_styles(): void {
wp_enqueue_style( 'moiraine-child-style', get_stylesheet_uri(), array( 'moiraine' ), wp_get_theme()->get( 'Version' ) );
}
/**
* Register pattern categories including parent theme categories.
*/
function spa_theme_register_pattern_categories() {
// Define all pattern categories in a single array
$pattern_categories = array(
'moiraine/features' => __('Features', 'velora-spa'),
'moiraine/posts' => __('Posts', 'velora-spa'),
'moiraine/call-to-action' => __('Call To Action', 'velora-spa'),
'moiraine/testimonials' => __('Testimonials', 'velora-spa'),
'moiraine/hero' => __('Hero', 'velora-spa'),
// You can easily add more categories here as needed
);
// Register all categories in a single loop
foreach ($pattern_categories as $category => $label) {
register_block_pattern_category($category, array('label' => $label));
}
}
add_action('init', 'spa_theme_register_pattern_categories', 5);