-
Notifications
You must be signed in to change notification settings - Fork 149
/
functions.php
112 lines (96 loc) · 2.65 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
/**
* This file adds functions to the Frost WordPress theme.
*
* @package Frost
* @author WP Engine
* @license GNU General Public License v3
* @link https://frostwp.com/
*/
if ( ! function_exists( 'frost_setup' ) ) {
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*
* @since 0.8.0
*
* @return void
*/
function frost_setup() {
// Make theme available for translation.
load_theme_textdomain( 'frost', get_template_directory() . '/languages' );
// Enqueue editor stylesheet.
add_editor_style( get_template_directory_uri() . '/style.css' );
// Remove core block patterns.
remove_theme_support( 'core-block-patterns' );
}
}
add_action( 'after_setup_theme', 'frost_setup' );
// Enqueue stylesheet.
add_action( 'wp_enqueue_scripts', 'frost_enqueue_stylesheet' );
function frost_enqueue_stylesheet() {
wp_enqueue_style( 'frost', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->get( 'Version' ) );
}
/**
* Register block styles.
*
* @since 0.9.2
*/
function frost_register_block_styles() {
$block_styles = array(
'core/columns' => array(
'columns-reverse' => __( 'Reverse', 'frost' ),
),
'core/group' => array(
'shadow-light' => __( 'Shadow', 'frost' ),
'shadow-solid' => __( 'Solid', 'frost' ),
),
'core/list' => array(
'no-disc' => __( 'No Disc', 'frost' ),
),
'core/quote' => array(
'shadow-light' => __( 'Shadow', 'frost' ),
'shadow-solid' => __( 'Solid', 'frost' ),
),
'core/social-links' => array(
'outline' => __( 'Outline', 'frost' ),
),
);
foreach ( $block_styles as $block => $styles ) {
foreach ( $styles as $style_name => $style_label ) {
register_block_style(
$block,
array(
'name' => $style_name,
'label' => $style_label,
)
);
}
}
}
add_action( 'init', 'frost_register_block_styles' );
/**
* Register block pattern categories.
*
* @since 1.0.4
*/
function frost_register_block_pattern_categories() {
register_block_pattern_category(
'frost-page',
array(
'label' => __( 'Page', 'frost' ),
'description' => __( 'Create a full page with multiple patterns that are grouped together.', 'frost' ),
)
);
register_block_pattern_category(
'frost-pricing',
array(
'label' => __( 'Pricing', 'frost' ),
'description' => __( 'Compare features for your digital products or service plans.', 'frost' ),
)
);
}
add_action( 'init', 'frost_register_block_pattern_categories' );