-
Notifications
You must be signed in to change notification settings - Fork 9
/
functions.php
105 lines (97 loc) · 2.09 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
<?php
declare( strict_types=1 );
namespace Blockify\Theme;
use function add_action;
use function function_exists;
use function is_readable;
use const DIRECTORY_SEPARATOR;
const NS = __NAMESPACE__ . '\\';
const DS = DIRECTORY_SEPARATOR;
// Allow file to be autoloaded without affecting phpcs and phpstan.
if ( function_exists( 'add_action' ) ) {
add_action( 'after_setup_theme', NS . 'setup', 8 );
}
/**
* Setup theme.
*
* @since 0.0.1
*
* @return void
*/
function setup(): void {
$files = [
'utility/array',
'utility/color',
'utility/css',
'utility/dom',
'utility/icon',
'utility/image',
'utility/string',
'utility/theme',
'api/block-extensions',
'api/block-styles',
'api/block-supports',
'extensions/animation',
'extensions/counter',
'extensions/copy-to-clipboard',
'extensions/dark-mode',
'extensions/gradient',
'extensions/grid',
'extensions/icon',
'extensions/inline-color',
'extensions/onclick',
'extensions/placeholder',
'extensions/shadow',
'extensions/svg',
'extensions/template-tags',
'common/fonts',
'common/patterns',
'common/scripts',
'common/styles',
'common/templates',
'blocks/avatar',
'blocks/button',
'blocks/buttons',
'blocks/calendar',
'blocks/code',
'blocks/columns',
'blocks/cover',
'blocks/details',
'blocks/group',
'blocks/heading',
'blocks/image',
'blocks/list',
'blocks/navigation',
'blocks/page-list',
'blocks/pagination',
'blocks/paragraph',
'blocks/pattern',
'blocks/post-author',
'blocks/post-comments-form',
'blocks/post-content',
'blocks/post-date',
'blocks/post-excerpt',
'blocks/post-featured-image',
'blocks/post-template',
'blocks/post-terms',
'blocks/post-title',
'blocks/query-pagination',
'blocks/query-title',
'blocks/query',
'blocks/search',
'blocks/shortcode',
'blocks/social-link',
'blocks/social-links',
'blocks/spacer',
'blocks/table-of-contents',
'blocks/tag-cloud',
'blocks/template-part',
'blocks/video',
];
foreach ( $files as $file ) {
$path = __DIR__ . "/includes/$file.php";
if ( is_readable( $path ) ) {
require_once $path;
}
}
}