forked from wpengine/frost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
120 lines (104 loc) · 2.79 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
113
114
115
116
117
118
119
120
<?php
/**
* This file adds functions to the Acost WordPress theme.
*
* @package Acost
* @author AppCubic
* @license GNU General Public License v2 or later
* @link https://appcubic.com/
*/
if ( ! function_exists( 'acost_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 acost_setup() {
// Make theme available for translation (localization).
load_theme_textdomain( 'acost', 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', 'acost_setup' );
// Enqueue style sheet.
add_action( 'wp_enqueue_scripts', 'acost_enqueue_style_sheet' );
function acost_enqueue_style_sheet() {
wp_enqueue_style( 'acost', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->get( 'Version' ) );
}
/**
* Register block styles.
*
* @since 0.9.2
*/
function acost_register_block_styles() {
$block_styles = array(
'core/columns' => array(
'columns-reverse' => __( 'Reverse', 'acost' ),
),
'core/group' => array(
'shadow-light' => __( 'Shadow', 'acost' ),
'shadow-solid' => __( 'Solid', 'acost' ),
),
'core/image' => array(
'shadow-light' => __( 'Shadow', 'acost' ),
'shadow-solid' => __( 'Solid', 'acost' ),
),
'core/list' => array(
'no-disc' => __( 'No Disc', 'acost' ),
),
'core/quote' => array(
'shadow-light' => __( 'Shadow', 'acost' ),
'shadow-solid' => __( 'Solid', 'acost' ),
),
'core/social-links' => array(
'outline' => __( 'Outline', 'acost' ),
),
);
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', 'acost_register_block_styles' );
/**
* Register block pattern categories.
*
* @since 1.0.4
*/
function acost_register_block_pattern_categories() {
register_block_pattern_category(
'page',
array(
'label' => __( 'Page', 'acost' ),
'description' => __( 'Create a full page with multiple patterns that are grouped together.', 'acost' ),
)
);
register_block_pattern_category(
'pricing',
array(
'label' => __( 'Pricing', 'acost' ),
'description' => __( 'Compare features for your digital products or service plans.', 'acost' ),
)
);
}
add_action( 'init', 'acost_register_block_pattern_categories' );