Completed
Push — master ( 8f4a49...efac85 )
by
unknown
02:18
created
public/includes/helpers.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
  * If we're on multsite we'll grab the site option which is stored in the main blogs site option tables, otherwise
7 7
  * we'll grab the option which is stored on the single blogs option tables
8 8
  *
9
- * @param unknown $option  string name of the option
10
- * @param unknown $section string name of the section
9
+ * @param string $option  string name of the option
10
+ * @param string $section string name of the section
11 11
  * @param unknown $default string/int default option value
12 12
  * @return the option value
13 13
  * @since 1.0
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
  *	Return an array of categories for autocomplete
215 215
  *
216 216
  *	@since 0.9.3
217
- *	@return array all categoiries
217
+ *	@return null|string all categoiries
218 218
 */
219 219
 function lasso_get_objects( $taxonomy = 'category' ) {
220 220
 
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 *	Used internally as a callback to build a tab or content area for modal addons
300 300
 *
301 301
 *	@param $tab object
302
-*	@param $type string tab or content
302
+*	@param string $type string tab or content
303 303
 *	@uses lasso_modal_addons()
304 304
 *	@since 0.9.4
305 305
 */
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.