@@ -14,8 +14,9 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 ) { |
@@ -219,8 +223,9 @@ discard block |
||
| 219 | 223 | |
| 220 | 224 | $objects = 'category' == $taxonomy ? get_categories(array('hide_empty' => 0)) : get_tags(array('hide_empty' => 0)); |
| 221 | 225 | |
| 222 | - if ( empty( $objects) ) |
|
| 223 | - return; |
|
| 226 | + if ( empty( $objects) ) { |
|
| 227 | + return; |
|
| 228 | + } |
|
| 224 | 229 | |
| 225 | 230 | $out = array(); |
| 226 | 231 | foreach( $objects as $object ) { |
@@ -331,8 +336,9 @@ discard block |
||
| 331 | 336 | */ |
| 332 | 337 | function lasso_clean_string( $string = '' ) { |
| 333 | 338 | |
| 334 | - if ( empty( $string ) ) |
|
| 335 | - return; |
|
| 339 | + if ( empty( $string ) ) { |
|
| 340 | + return; |
|
| 341 | + } |
|
| 336 | 342 | |
| 337 | 343 | return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) ); |
| 338 | 344 | } |
@@ -371,11 +377,13 @@ discard block |
||
| 371 | 377 | if ( !function_exists( 'lasso_user_can' ) ): |
| 372 | 378 | function lasso_user_can( $action = '', $postid = 0 ) { |
| 373 | 379 | $result = false; |
| 374 | - if ( empty( $action ) ) |
|
| 375 | - $action = 'edit_posts'; |
|
| 380 | + if ( empty( $action ) ) { |
|
| 381 | + $action = 'edit_posts'; |
|
| 382 | + } |
|
| 376 | 383 | |
| 377 | - if ( empty( $postid ) ) |
|
| 378 | - $postid = get_the_ID(); |
|
| 384 | + if ( empty( $postid ) ) { |
|
| 385 | + $postid = get_the_ID(); |
|
| 386 | + } |
|
| 379 | 387 | |
| 380 | 388 | if ( is_user_logged_in() && current_user_can( $action, $postid ) ) { |
| 381 | 389 | // check against post types: |