-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
77 lines (62 loc) · 1.58 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* Functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package Yumi
* @since 1.0
*/
/**
* Add theme support for block styles and editor style.
*
* @since 1.0
*
* @return void
*/
function yumi_support() {
// Enqueue editor styles.
add_editor_style( 'assets/build/css/style-editor.css' );
// Remove core block patterns.
remove_theme_support( 'core-block-patterns' );
}
add_action( 'after_setup_theme', 'yumi_support' );
/**
* Enqueue style.css file.
*/
if ( ! function_exists( 'yumi_styles' ) ) :
/**
* Enqueue styles.
*
* @return void
*/
function yumi_styles() {
// Register theme stylesheet.
wp_register_style(
'yumi-style',
get_stylesheet_directory_uri() . '/assets/build/css/style.css',
array(),
wp_get_theme()->get( 'Version' )
);
// Enqueue theme stylesheet.
wp_enqueue_style( 'yumi-style' );
}
endif;
add_action( 'wp_enqueue_scripts', 'yumi_styles' );
/**
* Registers pattern categories.
*
* @since 1.0
*/
function yumi_register_pattern_categories() {
$block_pattern_categories = array(
'headers' => array( 'label' => __( 'Headers', 'yumi' ) ),
'footers' => array( 'label' => __( 'Footers', 'yumi' ) ),
'page' => array( 'label' => __( 'Page', 'yumi' ) ),
);
$block_pattern_categories = apply_filters( 'yumi_block_pattern_categories', $block_pattern_categories );
foreach ( $block_pattern_categories as $name => $properties ) {
register_block_pattern_category( $name, $properties );
}
}
add_action( 'init', 'yumi_register_pattern_categories' );