-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblock-pattern.php
More file actions
executable file
·191 lines (152 loc) · 4.6 KB
/
block-pattern.php
File metadata and controls
executable file
·191 lines (152 loc) · 4.6 KB
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<?php
// If this file is called directly, abort.
if (!defined('WPINC')) {
die;
}
/**
* Currently plugin version.
*/
define('LIL_BP_VERSION', '1.0.0');
/**
* Plugin URL
*/
define('LIL_BP_URL', plugin_dir_url(__FILE__)); //This include the trailing slash!
function raythompsonwebdev_plugin_editor_style()
{
add_editor_style('css/custom-editor-style.css');
}
add_action('admin_init', 'raythompsonwebdev_plugin_editor_style');
function raythompsonwebdev_plugin_enqueue_pattern_style()
{
wp_enqueue_style('raythompsonwebdev_plugin_pattern_style', plugins_url('css/blockpatterns.css', __FILE__));
}
add_action('wp_enqueue_scripts', 'raythompsonwebdev_plugin_enqueue_pattern_style');
function raythompsonwebdev_plugin_register_block_patterns()
{
if (class_exists('WP_Block_Patterns_Registry')) {
register_block_pattern_category(
'home-page-block-pattern',
array(
'label' => __('Home Page Pattern', 'raythompsonwebdev-com'),
)
);
register_block_pattern_category(
'about-page-block-pattern',
array(
'label' => __('About Page Pattern', 'raythompsonwebdev-com'),
)
);
register_block_pattern(
'raythompsonwebdev-com/home-page-pattern',
array(
'title' => __('Home Page Pattern', 'raythompsonwebdev-com'),
'description' => _x('Columns for making lists with image and header. ', 'Block pattern description', 'raythompsonwebdev-com'),
'content' => '<!-- wp:group {"align":"wide"} -->
<div class="wp-block-group alignwide">
<div class="wp-block-group__inner-container">
<!-- wp:columns {"align":"wide"} -->
<div class="wp-block-columns alignwide">
<!-- wp:column -->
<div class="wp-block-column">
<!-- wp:html -->
<span class="dashicons dashicons-html"></span>
<!-- /wp:html -->
<!-- wp:heading {"level":4} -->
<h4>Code</h4>
<!-- /wp:heading -->
<!-- wp:list -->
<ul>
<li>HTML & CSS</li>
<li>PHP & MYSQL</li>
<li>Javascript ES5/ES6</li>
</ul>
<!-- /wp:list -->
</div>
<!-- /wp:column -->
<!-- wp:column -->
<div class="wp-block-column">
<!-- wp:html -->
<span class="dashicons dashicons-images-alt"></span>
<!-- /wp:html -->
<!-- wp:heading {"level":4} -->
<h4>Optimisation</h4>
<!-- /wp:heading -->
<!-- wp:list -->
<ul>
<li>Video, Audio & Image</li>
<li>SQL Database</li>
<li>On-Site SEO</li>
</ul>
<!-- /wp:list -->
</div>
<!-- /wp:column -->
<!-- wp:column -->
<div class="wp-block-column">
<!-- wp:html -->
<span class="dashicons dashicons-wordpress"></span>
<!-- /wp:html -->
<!-- wp:heading {"level":4} -->
<h4>WordPress</h4>
<!-- /wp:heading -->
<!-- wp:list -->
<ul>
<li>Set Up & Installation</li>
<li>Themes & Plugins</li>
<li>Gutenberg Blocks</li>
</ul>
<!-- /wp:list -->
</div>
<!-- /wp:column -->
<!-- wp:column -->
<div class="wp-block-column">
<!-- wp:html -->
<span class="dashicons dashicons-admin-tools"></span>
<!-- /wp:html -->
<!-- wp:heading {"level":4} -->
<h4>Maintenance</h4>
<!-- /wp:heading -->
<!-- wp:list -->
<ul>
<li>Web Security</li>
<li>Database</li>
<li>Code Debugging</li>
</ul>
<!-- /wp:list -->
</div>
<!-- /wp:column -->
</div>
<!-- /wp:columns -->
</div>
</div>
<!-- /wp:group -->
',
'categories' => array('profile-page-block-pattern'),
)
);
register_block_pattern(
'raythompsonwebdev-com/about-page-pattern',
array(
'title' => __('About Page Pattern', 'raythompsonwebdev-com'),
'description' => _x('Layout for raythompsonwebdev portfolio about page.', 'Block pattern description', 'raythompsonwebdev-com'),
'content' => '<!-- wp:group {"align":"wide"} -->
<div class="wp-block-group alignwide" id="profile-container">
<div class="wp-block-group__inner-container">
<!-- wp:html -->
<article id="text-box-profile">
</article>
<!-- /wp:html -->
<!-- wp:shortcode /-->
<!-- wp:shortcode /-->
<!-- wp:html -->
<article id="text-box-profile-a">
</article>
<!-- /wp:html -->
</div>
</div>
<!-- /wp:group -->',
'categories' => array('about-page-block-pattern'),
)
);
}
}
add_action('init', 'raythompsonwebdev_plugin_register_block_patterns');