-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfunctions.php
81 lines (58 loc) · 2.75 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
78
79
80
81
<?php
/* -----------------------------------------------------------------------------------------------
THEME SUPPORTS
--------------------------------------------------------------------------------------------------- */
function beaumont_setup() {
add_editor_style( 'style.css' );
}
add_action( 'after_setup_theme', 'beaumont_setup' );
/* -----------------------------------------------------------------------------------------------
ENQUEUE STYLESHEETS
--------------------------------------------------------------------------------------------------- */
function beaumont_styles() {
wp_enqueue_style( 'beaumont-styles', get_template_directory_uri() . '/style.css', array(), wp_get_theme( 'beaumont' )->get( 'Version' ) );
}
add_action( 'wp_enqueue_scripts', 'beaumont_styles' );
/* -----------------------------------------------------------------------------------------------
BLOCK PATTERNS
Register theme specific block pattern categories. The patterns themselves are stored in /patterns/.
--------------------------------------------------------------------------------------------------- */
function beaumont_register_block_patterns() {
// The block pattern categories included in Beaumont.
$beaumont_block_pattern_categories = apply_filters( 'beaumont_block_pattern_categories', array(
'beaumont' => array(
'label' => esc_html__( 'Beaumont Patterns', 'beaumont' ),
)
) );
// Sort the block pattern categories alphabetically based on the label value, to ensure alphabetized order when the strings are localized.
uasort( $beaumont_block_pattern_categories, function( $a, $b ) {
return strcmp( $a["label"], $b["label"] ); }
);
// Register block pattern categories.
foreach ( $beaumont_block_pattern_categories as $slug => $settings ) {
register_block_pattern_category( $slug, $settings );
}
}
add_action( 'init', 'beaumont_register_block_patterns' );
/* -----------------------------------------------------------------------------------------------
BLOCK STYLES
Register theme specific block styles.
--------------------------------------------------------------------------------------------------- */
function beaumont_register_block_styles() {
// Pagination: Vertical Separators
register_block_style( 'core/query-pagination', array(
'name' => 'beaumont-vertical-separators',
'label' => esc_html__( 'Vertical Separators', 'beaumont' ),
) );
// Separator: Diamond
register_block_style( 'core/separator', array(
'name' => 'beaumont-diamond',
'label' => esc_html__( 'Diamond', 'beaumont' ),
) );
// Separator: Diamond Wide
register_block_style( 'core/separator', array(
'name' => 'beaumont-diamond-wide',
'label' => esc_html__( 'Diamond Wide', 'beaumont' ),
) );
}
add_action( 'init', 'beaumont_register_block_styles' );