Completed
Push — master ( 8f4a49...efac85 )
by
unknown
02:18
created
public/includes/helpers.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 		'public' => true,
244 244
 	), 'objects' );
245 245
 	$post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) );
246
-    unset( $post_types[ 'attachment' ] );
246
+	unset( $post_types[ 'attachment' ] );
247 247
 
248 248
 	/**
249 249
 	 * Set which post types are allowed
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 		'public' => true,
272 272
 	), 'names' );
273 273
 	//$post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) );
274
-    unset( $post_types[ 'attachment' ] );
274
+	unset( $post_types[ 'attachment' ] );
275 275
 
276 276
 	/**
277 277
 	 * Set which post types are allowed
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
  */
375 375
 if ( !function_exists( 'lasso_user_can' ) ):
376 376
 	function lasso_user_can( $action = '', $postid = 0 ) {
377
-        $result = false;
377
+		$result = false;
378 378
 		if ( empty( $action ) )
379 379
 			$action = 'edit_posts';
380 380
 
@@ -389,17 +389,17 @@  discard block
 block discarded – undo
389 389
 				$allowed_post_types = array_diff($allowed_post_types,array('page'));
390 390
 			}
391 391
 			
392
-            if (!empty($allowed_post_types) && !empty($postid)) {
392
+			if (!empty($allowed_post_types) && !empty($postid)) {
393 393
 				$type = get_post_type( $postid );
394
-                $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
394
+				$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
395 395
 				
396
-                if ( in_array( $type, $allowed_post_types ) ) {
396
+				if ( in_array( $type, $allowed_post_types ) ) {
397 397
 				   $result =  true;
398
-			    }
399
-            } else {
400
-                //we are not checking against a post, return true
398
+				}
399
+			} else {
400
+				//we are not checking against a post, return true
401 401
 				$result =  true;
402
-        	}
402
+			}
403 403
 		} else {
404 404
 			$result = false;
405 405
 		}
Please login to merge, or discard this 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 ) {
@@ -335,8 +340,9 @@  discard block
 block discarded – undo
335 340
 */
336 341
 function lasso_clean_string( $string = '' ) {
337 342
 
338
-	if ( empty( $string ) )
339
-		return;
343
+	if ( empty( $string ) ) {
344
+			return;
345
+	}
340 346
 
341 347
 	return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) );
342 348
 }
@@ -375,11 +381,13 @@  discard block
 block discarded – undo
375 381
 if ( !function_exists( 'lasso_user_can' ) ):
376 382
 	function lasso_user_can( $action = '', $postid = 0 ) {
377 383
         $result = false;
378
-		if ( empty( $action ) )
379
-			$action = 'edit_posts';
384
+		if ( empty( $action ) ) {
385
+					$action = 'edit_posts';
386
+		}
380 387
 
381
-		if ( empty( $postid ) )
382
-			$postid = get_the_ID();
388
+		if ( empty( $postid ) ) {
389
+					$postid = get_the_ID();
390
+		}
383 391
 
384 392
 		if ( is_user_logged_in() && current_user_can( $action, $postid ) ) {
385 393
 			// check against post types:
Please login to merge, or discard this patch.