Completed
Pull Request — master (#116)
by
unknown
02:26
created
internal-api/route.php 1 patch
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
 				$callback = self::find_callback( strip_tags( $action ) );
37 37
 				if ( is_int( $callback )  ) {
38 38
 					$code = $callback;
39
-				}elseif( ! class_exists( $callback['class'] ) ) {
39
+				} elseif( ! class_exists( $callback['class'] ) ) {
40 40
 					$code = 415;
41
-				}else {
41
+				} else {
42 42
 					$action = str_replace( '-', '_', $action );
43 43
 					$callback_instance = new $callback['class'];
44 44
 					$auth              = self::auth( $action, $callback_instance, $callback['method'] );
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
 				}
63 63
 
64
-			}else{
64
+			} else{
65 65
 				$code = 401;
66 66
 				$response = __( 'Nonce not set.', 'lasso' );
67 67
 			}
@@ -167,9 +167,9 @@  discard block
 block discarded – undo
167 167
 
168 168
 		if ( is_string( $response ) ) {
169 169
 			$data[] = $response;
170
-		}elseif( is_array( $response ) ) {
170
+		} elseif( is_array( $response ) ) {
171 171
 			$data = $response;
172
-		}else{
172
+		} else{
173 173
 			$data[] = $code;
174 174
 		}
175 175
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 		nocache_headers();
178 178
 		if ( 200 == $code ) {
179 179
 			wp_send_json_success( $data );
180
-		}else{
180
+		} else{
181 181
 			wp_send_json_error( $data );
182 182
 		}
183 183
 
Please login to merge, or discard this patch.
public/includes/helpers.php 1 patch
Braces   +27 added lines, -19 removed lines patch added patch discarded remove patch
@@ -14,8 +14,9 @@  discard block
 block discarded – undo
14 14
  */
15 15
 function lasso_editor_get_option( $option, $section, $default = '' ) {
16 16
 
17
-	if ( empty( $option ) )
18
-		return;
17
+	if ( empty( $option ) ) {
18
+			return;
19
+	}
19 20
 
20 21
 	if ( function_exists( 'is_multisite' ) && is_multisite() ) {
21 22
 
@@ -42,11 +43,12 @@  discard block
 block discarded – undo
42 43
 
43 44
 	$q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) );
44 45
 
45
-	if ( $q->have_posts() )
46
-		return true;
47
-	else
48
-		return false;
49
-}
46
+	if ( $q->have_posts() ) {
47
+			return true;
48
+	} else {
49
+			return false;
50
+	}
51
+	}
50 52
 
51 53
 /**
52 54
  * Return a CSS class of an automatically supported theme
@@ -149,13 +151,15 @@  discard block
 block discarded – undo
149 151
 */
150 152
 function lasso_get_post_objects( $postid = '', $taxonomy = 'category') {
151 153
 
152
-	if ( empty( $postid ) )
153
-		$postid = get_the_ID();
154
+	if ( empty( $postid ) ) {
155
+			$postid = get_the_ID();
156
+	}
154 157
 
155 158
 	$objects = 'category' == $taxonomy ? get_the_category( $postid ) : get_the_tags( $postid );
156 159
 
157
-	if ( empty( $objects) )
158
-		return;
160
+	if ( empty( $objects) ) {
161
+			return;
162
+	}
159 163
 
160 164
 	$out = '';
161 165
 	foreach( $objects as $object ) {
@@ -176,8 +180,9 @@  discard block
 block discarded – undo
176 180
 
177 181
 	$objects = 'category' == $taxonomy ? get_categories(array('hide_empty' => 0)) : get_tags(array('hide_empty' => 0));
178 182
 
179
-	if ( empty( $objects) )
180
-		return;
183
+	if ( empty( $objects) ) {
184
+			return;
185
+	}
181 186
 
182 187
 	$out = array();
183 188
 	foreach( $objects as $object ) {
@@ -264,8 +269,9 @@  discard block
 block discarded – undo
264 269
 */
265 270
 function lasso_clean_string( $string = '' ) {
266 271
 
267
-	if ( empty( $string ) )
268
-		return;
272
+	if ( empty( $string ) ) {
273
+			return;
274
+	}
269 275
 
270 276
 	return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) );
271 277
 }
@@ -304,11 +310,13 @@  discard block
 block discarded – undo
304 310
 if ( !function_exists( 'lasso_user_can' ) ):
305 311
 	function lasso_user_can( $action = '', $postid = 0 ) {
306 312
 
307
-		if ( empty( $action ) )
308
-			$action = 'edit_posts';
313
+		if ( empty( $action ) ) {
314
+					$action = 'edit_posts';
315
+		}
309 316
 
310
-		if ( empty( $postid ) )
311
-			$postid = get_the_ID();
317
+		if ( empty( $postid ) ) {
318
+					$postid = get_the_ID();
319
+		}
312 320
 
313 321
 		if ( is_user_logged_in() && current_user_can( $action, $postid ) ) {
314 322
 
Please login to merge, or discard this patch.
public/includes/option-engine.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -121,8 +121,9 @@  discard block
 block discarded – undo
121 121
 
122 122
 	ob_start();
123 123
 
124
-	if ( empty( $name ) || empty( $options ) || !is_array( $options ) )
125
-		return;
124
+	if ( empty( $name ) || empty( $options ) || !is_array( $options ) ) {
125
+			return;
126
+	}
126 127
 
127 128
 	$nonce = wp_create_nonce('lasso-process-post-meta');
128 129
 	$key   = sprintf('_lasso_%s_settings', $name );
@@ -160,8 +161,9 @@  discard block
 block discarded – undo
160 161
 	$before = '<div class="lasso--postsettings__option">';
161 162
 	$after 	= '</div>';
162 163
 
163
-	if ( empty( $name ) || empty( $options ) )
164
-		return;
164
+	if ( empty( $name ) || empty( $options ) ) {
165
+			return;
166
+	}
165 167
 
166 168
 	foreach ( (array) $options as $option ) {
167 169
 
@@ -195,8 +197,9 @@  discard block
 block discarded – undo
195 197
 */
196 198
 function lasso_option_engine_option( $name = '', $option = '', $type = '') {
197 199
 
198
-	if ( empty( $type ) || empty( $option ) )
199
-		return;
200
+	if ( empty( $type ) || empty( $option ) ) {
201
+			return;
202
+	}
200 203
 
201 204
 	$id = isset( $option['id'] ) ? $option['id'] : false;
202 205
 	$id = $id ? lasso_clean_string( $id ) : false;
Please login to merge, or discard this patch.
admin/includes/menus/welcome.php 1 patch
Braces   +8 added lines, -5 removed lines patch added patch discarded remove patch
@@ -71,23 +71,26 @@
 block discarded – undo
71 71
 			  				<p><?php _e( 'We will check the current theme on every site in your network and give you a quick status feedback here. You can see the status by visiting the Editus menu on each site.', 'lasso' );?></p>
72 72
 			  			</li>
73 73
 
74
-			  		<?php else :
74
+			  		<?php else {
75
+	:
75 76
 
76 77
 					$checks = self::lasso_preflight_check();
78
+}
77 79
 
78 80
 					if ( $checks && !defined( 'LASSO_AGENCY_MODE' ) ):
79 81
 
80 82
 						foreach ( (array) $checks as $key => $check ) {
81 83
 
82 84
 							echo $check;
83
-						}
84
-
85
-						else:
85
+						} else {
86
+							:
86 87
 
87 88
 							// pre-flight is go for flight
88 89
 						?>
89 90
 						<li class="success">
90
-							<h3><?php _e( 'You\'re Ready to Rock!', 'lasso' );?></h3>
91
+							<h3><?php _e( 'You\'re Ready to Rock!', 'lasso' );
92
+						}
93
+						?></h3>
91 94
 							<?php if ( lasso_get_supported_theme_class() ) { ?>
92 95
 							<p><?php _e( 'Your theme is automatically supported. No additional setup is needed.', 'lasso' );?></p>
93 96
 							<?php } ?>
Please login to merge, or discard this patch.
public/includes/wrap-shortcodes.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,9 +76,13 @@
 block discarded – undo
76 76
 
77 77
 /* a helper function */
78 78
 function strpos_arr($haystack, $needle) {
79
-    if(!is_array($needle)) $needle = array($needle);
79
+    if(!is_array($needle)) {
80
+    	$needle = array($needle);
81
+    }
80 82
     foreach($needle as $what) {
81
-        if(($pos = strpos($haystack, $what))!==false) return $pos;
83
+        if(($pos = strpos($haystack, $what))!==false) {
84
+        	return $pos;
85
+        }
82 86
     }
83 87
     return false;
84 88
 }
85 89
\ No newline at end of file
Please login to merge, or discard this patch.
public/includes/editor-modules.php 1 patch
Braces   +32 added lines, -20 removed lines patch added patch discarded remove patch
@@ -107,8 +107,9 @@  discard block
 block discarded – undo
107 107
 
108 108
 	ob_start();
109 109
 
110
-	if ( !lasso_user_can() )
111
-		return;
110
+	if ( !lasso_user_can() ) {
111
+			return;
112
+	}
112 113
 
113 114
 	// let users add custom css classes
114 115
 	$custom_classes = apply_filters( 'lasso_sidebar_classes', '' );
@@ -131,8 +132,9 @@  discard block
 block discarded – undo
131 132
 
132 133
 	ob_start();
133 134
 
134
-	if ( !lasso_user_can() )
135
-		return;
135
+	if ( !lasso_user_can() ) {
136
+			return;
137
+	}
136 138
 
137 139
 	// check for lasso story engine and add a class doniting this
138 140
 	$ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
@@ -205,8 +207,11 @@  discard block
 block discarded – undo
205 207
 						<?php if ( class_exists ('Aesop_GalleryPop') ) { ?>
206 208
 						     <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>"  class="lasso-toolbar--component__gallerypop"></li>
207 209
 						<?php }?>
208
-					<?php else: ?>
209
-						<li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li>
210
+					<?php else {
211
+	: ?>
212
+						<li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );
213
+}
214
+?>" class="image lasso-toolbar--component__image"></li>
210 215
 						<li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li>
211 216
 						<!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li-->
212 217
 					<?php endif; ?>
@@ -230,8 +235,9 @@  discard block
 block discarded – undo
230 235
 
231 236
 	ob_start();
232 237
 
233
-	if ( !lasso_user_can() )
234
-		return;
238
+	if ( !lasso_user_can() ) {
239
+			return;
240
+	}
235 241
 
236 242
 	// let users add custom css classes
237 243
 	$custom_classes = apply_filters( 'lasso_component_classes', '' );
@@ -257,8 +263,9 @@  discard block
 block discarded – undo
257 263
 
258 264
 	ob_start();
259 265
 
260
-	if ( !lasso_user_can() )
261
-		return;
266
+	if ( !lasso_user_can() ) {
267
+			return;
268
+	}
262 269
 
263 270
 	// has post thumbnail
264 271
 	$has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false;
@@ -286,8 +293,9 @@  discard block
 block discarded – undo
286 293
 
287 294
 	ob_start();
288 295
 
289
-	if ( !lasso_user_can() )
290
-		return;
296
+	if ( !lasso_user_can() ) {
297
+			return;
298
+	}
291 299
 
292 300
 	global $post;
293 301
 
@@ -417,8 +425,9 @@  discard block
 block discarded – undo
417 425
 
418 426
 	ob_start();
419 427
 
420
-	if ( !lasso_user_can('edit_posts') )
421
-		return;
428
+	if ( !lasso_user_can('edit_posts') ) {
429
+			return;
430
+	}
422 431
 
423 432
 	$status = get_post_status( get_the_ID() );
424 433
 
@@ -541,8 +550,9 @@  discard block
 block discarded – undo
541 550
 
542 551
 	ob_start();
543 552
 
544
-	if ( !lasso_user_can() )
545
-		return;
553
+	if ( !lasso_user_can() ) {
554
+			return;
555
+	}
546 556
 
547 557
 	// let users add custom css classes
548 558
 	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
@@ -562,8 +572,9 @@  discard block
 block discarded – undo
562 572
 
563 573
 	ob_start();
564 574
 
565
-	if ( !lasso_user_can() )
566
-		return;
575
+	if ( !lasso_user_can() ) {
576
+			return;
577
+	}
567 578
 
568 579
 	// let users add custom css classes
569 580
 	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
@@ -634,8 +645,9 @@  discard block
 block discarded – undo
634 645
 
635 646
 	$blob = array();
636 647
 
637
-	if ( empty( $codes ) )
638
-		return;
648
+	if ( empty( $codes ) ) {
649
+			return;
650
+	}
639 651
 
640 652
 	foreach ( $codes as $slug => $shortcode ) {
641 653
 		$return = '';
Please login to merge, or discard this patch.