forked from wpengine/frost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
85 lines (73 loc) · 1.9 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
<?php
/**
* This file adds functions to the Frost WordPress theme.
*
* @package Frost
* @author WP Engine
* @license GNU General Public License v2 or later
* @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 styles and fonts.
add_editor_style(
array(
'./style.css',
)
);
// Remove core block patterns.
remove_theme_support( 'core-block-patterns' );
}
}
add_action( 'after_setup_theme', 'frost_setup' );
// Enqueue style sheet.
add_action( 'wp_enqueue_scripts', 'frost_enqueue_style_sheet' );
function frost_enqueue_style_sheet() {
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/list' => array(
'no-disc' => __( 'No Disc', 'frost' ),
),
'core/navigation-link' => array(
'outline' => __( 'Outline', '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' );