Completed
Push — master ( 9f9e0e...869e28 )
by
unknown
01:48
created
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
@@ -192,13 +194,15 @@  discard block
 block discarded – undo
192 194
 */
193 195
 function lasso_get_post_objects( $postid = '', $taxonomy = 'category') {
194 196
 
195
-	if ( empty( $postid ) )
196
-		$postid = get_the_ID();
197
+	if ( empty( $postid ) ) {
198
+			$postid = get_the_ID();
199
+	}
197 200
 
198 201
 	$objects = 'category' == $taxonomy ? get_the_category( $postid ) : get_the_tags( $postid );
199 202
 
200
-	if ( empty( $objects) )
201
-		return;
203
+	if ( empty( $objects) ) {
204
+			return;
205
+	}
202 206
 
203 207
 	$out = '';
204 208
 	foreach( $objects as $object ) {
@@ -220,8 +224,9 @@  discard block
 block discarded – undo
220 224
 
221 225
 	$objects = 'category' == $taxonomy ? get_categories(array('hide_empty' => 0)) : get_tags(array('hide_empty' => 0));
222 226
 
223
-	if ( empty( $objects) )
224
-		return;
227
+	if ( empty( $objects) ) {
228
+			return;
229
+	}
225 230
 
226 231
 	$out = "";
227 232
 	foreach( $objects as $object ) {
@@ -343,8 +348,9 @@  discard block
 block discarded – undo
343 348
 */
344 349
 function lasso_clean_string( $string = '' ) {
345 350
 
346
-	if ( empty( $string ) )
347
-		return;
351
+	if ( empty( $string ) ) {
352
+			return;
353
+	}
348 354
 
349 355
 	return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) );
350 356
 }
@@ -383,11 +389,13 @@  discard block
 block discarded – undo
383 389
 if ( !function_exists( 'lasso_user_can' ) ):
384 390
 	function lasso_user_can( $action = '', $postid = 0 ) {
385 391
         $result = false;
386
-		if ( empty( $action ) )
387
-			$action = 'edit_posts';
392
+		if ( empty( $action ) ) {
393
+					$action = 'edit_posts';
394
+		}
388 395
 
389
-		if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts')
390
-			$postid = get_the_ID();
396
+		if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') {
397
+					$postid = get_the_ID();
398
+		}
391 399
 
392 400
 		if ( is_user_logged_in() && current_user_can( $action, $postid ) ) {
393 401
 			// check against post types:
Please login to merge, or discard this patch.