Passed
Pull Request — master (#351)
by Virginia
02:09
created
includes/gutenberg.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @subpackage Gutenberg
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
@@ -14,41 +14,41 @@  discard block
 block discarded – undo
14 14
  * Enqueue Admin styles on admin area
15 15
  */
16 16
 function load_gutenberg_admin_style() {
17
-	wp_enqueue_style( 'admin_css', get_template_directory_uri() . '/assets/css/admin/gutenberg-admin.css', false, '1.0.0' );
17
+	wp_enqueue_style('admin_css', get_template_directory_uri() . '/assets/css/admin/gutenberg-admin.css', false, '1.0.0');
18 18
 }
19
-add_action( 'admin_enqueue_scripts', 'load_gutenberg_admin_style' );
19
+add_action('admin_enqueue_scripts', 'load_gutenberg_admin_style');
20 20
 
21 21
 // Gutenberg Compatibility.
22
-require_once( get_template_directory() . '/lib/theme-support.php' );
22
+require_once(get_template_directory() . '/lib/theme-support.php');
23 23
 
24 24
 /**
25 25
  * Add custom class for Gutenberg Compatible template
26 26
  */
27
-function add_gutenberg_compatible_body_class( $classes ) {
27
+function add_gutenberg_compatible_body_class($classes) {
28 28
 	// if ( ! is_home() && ! is_front_page() ).
29
-	if ( is_page() || is_page_template() || is_single() )
29
+	if (is_page() || is_page_template() || is_single())
30 30
 		$classes[] = 'gutenberg-compatible-template';
31 31
 
32 32
 	// Add a class if the page is using the Content and Media block.
33 33
 	$post = get_post();
34
-	if ( function_exists( 'has_blocks' ) && isset( $post->post_content ) && has_blocks( $post->post_content ) && ( ! is_search() ) && ( ! is_archive() ) ) {
35
-		$blocks = parse_blocks( $post->post_content );
34
+	if (function_exists('has_blocks') && isset($post->post_content) && has_blocks($post->post_content) && ( ! is_search()) && ( ! is_archive())) {
35
+		$blocks = parse_blocks($post->post_content);
36 36
 
37
-		if ( 'core/media-text' === $blocks[0]['blockName'] ) {
37
+		if ('core/media-text' === $blocks[0]['blockName']) {
38 38
 			$classes[] = 'has-block-media-text';
39 39
 		}
40
-		if ( 'core/cover' === $blocks[0]['blockName'] ) {
40
+		if ('core/cover' === $blocks[0]['blockName']) {
41 41
 			$classes[] = 'has-block-cover';
42 42
 		}
43 43
 	}
44 44
 	return $classes;
45 45
 }
46 46
 
47
-add_filter( 'body_class', __NAMESPACE__ . '\add_gutenberg_compatible_body_class' );
47
+add_filter('body_class', __NAMESPACE__ . '\add_gutenberg_compatible_body_class');
48 48
 
49 49
 // Add custom class for templates that are using the Gutenberg editor.
50
-add_action('body_class', function( $classes ) {
51
-	if ( function_exists( 'has_blocks' ) && has_blocks( get_the_ID() ) && ( ! is_search() ) && ( ! is_archive() ) && ( ! is_singular( 'project' ) ) )
50
+add_action('body_class', function($classes) {
51
+	if (function_exists('has_blocks') && has_blocks(get_the_ID()) && ( ! is_search()) && ( ! is_archive()) && ( ! is_singular('project')))
52 52
 		$classes[] = 'using-gutenberg';
53 53
 	return $classes;
54 54
 });
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
  * @return void
60 60
  */
61 61
 function remove_lsx_page_banner_when_using_blocks() {
62
-	if ( function_exists( 'has_blocks' ) && ( ! class_exists( 'LSX_Banners' ) ) ) {
63
-		add_filter( 'lsx_page_banner_disable', '__return_true' );
62
+	if (function_exists('has_blocks') && ( ! class_exists('LSX_Banners'))) {
63
+		add_filter('lsx_page_banner_disable', '__return_true');
64 64
 	}
65 65
 }
66
-add_filter( 'init', 'remove_lsx_page_banner_when_using_blocks' );
66
+add_filter('init', 'remove_lsx_page_banner_when_using_blocks');
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,8 +26,9 @@  discard block
 block discarded – undo
26 26
  */
27 27
 function add_gutenberg_compatible_body_class( $classes ) {
28 28
 	// if ( ! is_home() && ! is_front_page() ).
29
-	if ( is_page() || is_page_template() || is_single() )
30
-		$classes[] = 'gutenberg-compatible-template';
29
+	if ( is_page() || is_page_template() || is_single() ) {
30
+			$classes[] = 'gutenberg-compatible-template';
31
+	}
31 32
 
32 33
 	// Add a class if the page is using the Content and Media block.
33 34
 	$post = get_post();
@@ -48,8 +49,9 @@  discard block
 block discarded – undo
48 49
 
49 50
 // Add custom class for templates that are using the Gutenberg editor.
50 51
 add_action('body_class', function( $classes ) {
51
-	if ( function_exists( 'has_blocks' ) && has_blocks( get_the_ID() ) && ( ! is_search() ) && ( ! is_archive() ) && ( ! is_singular( 'project' ) ) )
52
-		$classes[] = 'using-gutenberg';
52
+	if ( function_exists( 'has_blocks' ) && has_blocks( get_the_ID() ) && ( ! is_search() ) && ( ! is_archive() ) && ( ! is_singular( 'project' ) ) ) {
53
+			$classes[] = 'using-gutenberg';
54
+	}
53 55
 	return $classes;
54 56
 });
55 57
 
Please login to merge, or discard this patch.
includes/hooks.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @subpackage hooks
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  * This is the 1st action in the theme that fires after <head>.
15 15
  */
16 16
 function lsx_head_top() {
17
-	do_action( 'lsx_head_top' );
17
+	do_action('lsx_head_top');
18 18
 }
19 19
 
20 20
 /**
@@ -23,14 +23,14 @@  discard block
 block discarded – undo
23 23
  * @return void
24 24
  */
25 25
 function lsx_head_bottom() {
26
-	do_action( 'lsx_head_bottom' );
26
+	do_action('lsx_head_bottom');
27 27
 }
28 28
 
29 29
 /**
30 30
  * The 3rd action thta fires after <body>
31 31
  */
32 32
 function lsx_body_top() {
33
-	do_action( 'lsx_body_top' );
33
+	do_action('lsx_body_top');
34 34
 }
35 35
 
36 36
 /**
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
  * $lsx_supports[] = 'header';
40 40
  */
41 41
 function lsx_header_before() {
42
-	do_action( 'lsx_header_before' );
42
+	do_action('lsx_header_before');
43 43
 }
44 44
 
45 45
 /**
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
  * @return void
49 49
  */
50 50
 function lsx_header_top() {
51
-	do_action( 'lsx_header_top' );
51
+	do_action('lsx_header_top');
52 52
 }
53 53
 
54 54
 /**
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
  * @return void
58 58
  */
59 59
 function lsx_nav_before() {
60
-	do_action( 'lsx_nav_before' );
60
+	do_action('lsx_nav_before');
61 61
 }
62 62
 
63 63
 /**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
  * @return void
67 67
  */
68 68
 function lsx_nav_after() {
69
-	do_action( 'lsx_nav_after' );
69
+	do_action('lsx_nav_after');
70 70
 }
71 71
 
72 72
 /**
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
  * @return void
76 76
  */
77 77
 function lsx_header_bottom() {
78
-	do_action( 'lsx_header_bottom' );
78
+	do_action('lsx_header_bottom');
79 79
 }
80 80
 
81 81
 /**
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
  * @return void
85 85
  */
86 86
 function lsx_header_after() {
87
-	do_action( 'lsx_header_after' );
87
+	do_action('lsx_header_after');
88 88
 }
89 89
 
90 90
 /**
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
  * @return void
94 94
  */
95 95
 function lsx_header_wrap_after() {
96
-	do_action( 'lsx_header_wrap_after' );
96
+	do_action('lsx_header_wrap_after');
97 97
 }
98 98
 
99 99
 /**
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
  * @return void
103 103
  */
104 104
 function lsx_body_bottom() {
105
-	do_action( 'lsx_body_bottom' );
105
+	do_action('lsx_body_bottom');
106 106
 }
107 107
 
108 108
 /**
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
  * $lsx_supports[] = 'banner';
112 112
  */
113 113
 function lsx_banner_content() {
114
-	do_action( 'lsx_banner_content' );
114
+	do_action('lsx_banner_content');
115 115
 }
116 116
 
117 117
 /**
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
  * @return void
121 121
  */
122 122
 function lsx_banner_inner_top() {
123
-	do_action( 'lsx_banner_inner_top' );
123
+	do_action('lsx_banner_inner_top');
124 124
 }
125 125
 
126 126
 /**
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
  * @return void
130 130
  */
131 131
 function lsx_banner_inner_bottom() {
132
-	do_action( 'lsx_banner_inner_bottom' );
132
+	do_action('lsx_banner_inner_bottom');
133 133
 }
134 134
 
135 135
 /**
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
  * $lsx_supports[] = 'global_header';
139 139
  */
140 140
 function lsx_global_header_inner_bottom() {
141
-	do_action( 'lsx_global_header_inner_bottom' );
141
+	do_action('lsx_global_header_inner_bottom');
142 142
 }
143 143
 
144 144
 /**
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
  * $lsx_supports[] = 'content';
148 148
  */
149 149
 function lsx_content_wrap_before() {
150
-	do_action( 'lsx_content_wrap_before' );
150
+	do_action('lsx_content_wrap_before');
151 151
 }
152 152
 
153 153
 /**
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
  * @return void
157 157
  */
158 158
 function lsx_content_wrap_after() {
159
-	do_action( 'lsx_content_wrap_after' );
159
+	do_action('lsx_content_wrap_after');
160 160
 }
161 161
 
162 162
 /**
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
  * @return void
166 166
  */
167 167
 function lsx_content_before() {
168
-	do_action( 'lsx_content_before' );
168
+	do_action('lsx_content_before');
169 169
 }
170 170
 
171 171
 /**
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
  * @return void
175 175
  */
176 176
 function lsx_content_after() {
177
-	do_action( 'lsx_content_after' );
177
+	do_action('lsx_content_after');
178 178
 }
179 179
 
180 180
 /**
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
  * @return void
184 184
  */
185 185
 function lsx_content_top() {
186
-	do_action( 'lsx_content_top' );
186
+	do_action('lsx_content_top');
187 187
 }
188 188
 
189 189
 /**
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
  * @return void
193 193
  */
194 194
 function lsx_content_bottom() {
195
-	do_action( 'lsx_content_bottom' );
195
+	do_action('lsx_content_bottom');
196 196
 }
197 197
 
198 198
 /**
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
  * @return void
202 202
  */
203 203
 function lsx_content_post_tags() {
204
-	do_action( 'lsx_content_post_tags' );
204
+	do_action('lsx_content_post_tags');
205 205
 }
206 206
 
207 207
 /**
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
  * @return void
211 211
  */
212 212
 function lsx_content_sharing() {
213
-	do_action( 'lsx_content_sharing' );
213
+	do_action('lsx_content_sharing');
214 214
 }
215 215
 
216 216
 /**
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
  * $lsx_supports[] = 'entry';
220 220
  */
221 221
 function lsx_entry_before() {
222
-	do_action( 'lsx_entry_before' );
222
+	do_action('lsx_entry_before');
223 223
 }
224 224
 
225 225
 /**
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
  * @return void
229 229
  */
230 230
 function lsx_entry_after() {
231
-	do_action( 'lsx_entry_after' );
231
+	do_action('lsx_entry_after');
232 232
 }
233 233
 
234 234
 /**
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
  * @return void
238 238
  */
239 239
 function lsx_entry_top() {
240
-	do_action( 'lsx_entry_top' );
240
+	do_action('lsx_entry_top');
241 241
 }
242 242
 
243 243
 /**
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
  * @return void
247 247
  */
248 248
 function lsx_entry_inside_top() {
249
-	do_action( 'lsx_entry_inside_top' );
249
+	do_action('lsx_entry_inside_top');
250 250
 }
251 251
 
252 252
 /**
@@ -255,14 +255,14 @@  discard block
 block discarded – undo
255 255
  * @return void
256 256
  */
257 257
 function lsx_entry_bottom() {
258
-	do_action( 'lsx_entry_bottom' );
258
+	do_action('lsx_entry_bottom');
259 259
 }
260 260
 
261 261
 /**
262 262
  * Semantic <entry> hooks
263 263
  */
264 264
 function lsx_post_meta_top() {
265
-	do_action( 'lsx_post_meta_top' );
265
+	do_action('lsx_post_meta_top');
266 266
 }
267 267
 
268 268
 /**
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
  * $lsx_supports[] = 'entry';
272 272
  */
273 273
 function lsx_widget_entry_before() {
274
-	do_action( 'lsx_widget_entry_before' );
274
+	do_action('lsx_widget_entry_before');
275 275
 }
276 276
 
277 277
 /**
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
  * @return void
281 281
  */
282 282
 function lsx_widget_entry_after() {
283
-	do_action( 'lsx_widget_entry_after' );
283
+	do_action('lsx_widget_entry_after');
284 284
 }
285 285
 
286 286
 /**
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
  * @return void
290 290
  */
291 291
 function lsx_widget_entry_top() {
292
-	do_action( 'lsx_widget_entry_top' );
292
+	do_action('lsx_widget_entry_top');
293 293
 }
294 294
 
295 295
 /**
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
  * @return void
299 299
  */
300 300
 function lsx_widget_entry_bottom() {
301
-	do_action( 'lsx_widget_entry_bottom' );
301
+	do_action('lsx_widget_entry_bottom');
302 302
 }
303 303
 
304 304
 /**
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
  * @return void
308 308
  */
309 309
 function lsx_widget_entry_content_top() {
310
-	do_action( 'lsx_widget_entry_content_top' );
310
+	do_action('lsx_widget_entry_content_top');
311 311
 }
312 312
 
313 313
 /**
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
  * @return void
317 317
  */
318 318
 function lsx_widget_entry_content_bottom() {
319
-	do_action( 'lsx_widget_entry_content_bottom' );
319
+	do_action('lsx_widget_entry_content_bottom');
320 320
 }
321 321
 
322 322
 /**
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
  * $lsx_supports[] = 'comments';
326 326
  */
327 327
 function lsx_comments_before() {
328
-	do_action( 'lsx_comments_before' );
328
+	do_action('lsx_comments_before');
329 329
 }
330 330
 
331 331
 /**
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
  * @return void
335 335
  */
336 336
 function lsx_comments_after() {
337
-	do_action( 'lsx_comments_after' );
337
+	do_action('lsx_comments_after');
338 338
 }
339 339
 
340 340
 /**
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
  * $lsx_supports[] = 'sidebar';
344 344
  */
345 345
 function lsx_sidebars_before() {
346
-	do_action( 'lsx_sidebars_before' );
346
+	do_action('lsx_sidebars_before');
347 347
 }
348 348
 
349 349
 /**
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
  * @return void
353 353
  */
354 354
 function lsx_sidebars_after() {
355
-	do_action( 'lsx_sidebars_after' );
355
+	do_action('lsx_sidebars_after');
356 356
 }
357 357
 
358 358
 /**
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
  * @return void
362 362
  */
363 363
 function lsx_sidebar_top() {
364
-	do_action( 'lsx_sidebar_top' );
364
+	do_action('lsx_sidebar_top');
365 365
 }
366 366
 
367 367
 /**
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
  * @return void
371 371
  */
372 372
 function lsx_sidebar_bottom() {
373
-	do_action( 'lsx_sidebar_bottom' );
373
+	do_action('lsx_sidebar_bottom');
374 374
 }
375 375
 
376 376
 /**
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
  * $lsx_supports[] = 'footer';
380 380
  */
381 381
 function lsx_footer_before() {
382
-	do_action( 'lsx_footer_before' );
382
+	do_action('lsx_footer_before');
383 383
 }
384 384
 
385 385
 /**
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
  * @return void
389 389
  */
390 390
 function lsx_footer_after() {
391
-	do_action( 'lsx_footer_after' );
391
+	do_action('lsx_footer_after');
392 392
 }
393 393
 
394 394
 /**
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
  * @return void
398 398
  */
399 399
 function lsx_footer_top() {
400
-	do_action( 'lsx_footer_top' );
400
+	do_action('lsx_footer_top');
401 401
 }
402 402
 
403 403
 /**
@@ -406,5 +406,5 @@  discard block
 block discarded – undo
406 406
  * @return void
407 407
  */
408 408
 function lsx_footer_bottom() {
409
-	do_action( 'lsx_footer_bottom' );
409
+	do_action('lsx_footer_bottom');
410 410
 }
Please login to merge, or discard this patch.