@@ -15,8 +15,9 @@ discard block |
||
| 15 | 15 | if( !function_exists('lasso_editor_get_option')): |
| 16 | 16 | function lasso_editor_get_option( $option, $section, $default = '' ) { |
| 17 | 17 | |
| 18 | - if ( empty( $option ) ) |
|
| 19 | - return; |
|
| 18 | + if ( empty( $option ) ) { |
|
| 19 | + return; |
|
| 20 | + } |
|
| 20 | 21 | |
| 21 | 22 | if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
| 22 | 23 | |
@@ -46,11 +47,12 @@ discard block |
||
| 46 | 47 | |
| 47 | 48 | $q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) ); |
| 48 | 49 | |
| 49 | - if ( $q->have_posts() ) |
|
| 50 | - return true; |
|
| 51 | - else |
|
| 52 | - return false; |
|
| 53 | -} |
|
| 50 | + if ( $q->have_posts() ) { |
|
| 51 | + return true; |
|
| 52 | + } else { |
|
| 53 | + return false; |
|
| 54 | + } |
|
| 55 | + } |
|
| 54 | 56 | |
| 55 | 57 | /** |
| 56 | 58 | * Return a CSS class of an automatically supported theme |
@@ -196,8 +198,9 @@ discard block |
||
| 196 | 198 | */ |
| 197 | 199 | function lasso_get_post_objects( $postid, $taxonomy) { |
| 198 | 200 | |
| 199 | - if ( empty( $postid ) ) |
|
| 200 | - $postid = get_the_ID(); |
|
| 201 | + if ( empty( $postid ) ) { |
|
| 202 | + $postid = get_the_ID(); |
|
| 203 | + } |
|
| 201 | 204 | |
| 202 | 205 | if ('category' == $taxonomy) { |
| 203 | 206 | $objects = get_the_category( $postid ); |
@@ -207,8 +210,9 @@ discard block |
||
| 207 | 210 | $objects = get_the_terms( $postid, $taxonomy ); |
| 208 | 211 | } |
| 209 | 212 | |
| 210 | - if ( empty( $objects) ) |
|
| 211 | - return; |
|
| 213 | + if ( empty( $objects) ) { |
|
| 214 | + return; |
|
| 215 | + } |
|
| 212 | 216 | |
| 213 | 217 | $out = ''; |
| 214 | 218 | foreach( $objects as $object ) { |
@@ -238,8 +242,9 @@ discard block |
||
| 238 | 242 | )); |
| 239 | 243 | } |
| 240 | 244 | |
| 241 | - if ( empty( $objects) ) |
|
| 242 | - return; |
|
| 245 | + if ( empty( $objects) ) { |
|
| 246 | + return; |
|
| 247 | + } |
|
| 243 | 248 | |
| 244 | 249 | $out = ""; |
| 245 | 250 | foreach( $objects as $object ) { |
@@ -361,8 +366,9 @@ discard block |
||
| 361 | 366 | */ |
| 362 | 367 | function lasso_clean_string( $string = '' ) { |
| 363 | 368 | |
| 364 | - if ( empty( $string ) ) |
|
| 365 | - return; |
|
| 369 | + if ( empty( $string ) ) { |
|
| 370 | + return; |
|
| 371 | + } |
|
| 366 | 372 | |
| 367 | 373 | return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) ); |
| 368 | 374 | } |
@@ -401,11 +407,13 @@ discard block |
||
| 401 | 407 | if ( !function_exists( 'lasso_user_can' ) ): |
| 402 | 408 | function lasso_user_can( $action = '', $postid = 0 ) { |
| 403 | 409 | $result = false; |
| 404 | - if ( empty( $action ) ) |
|
| 405 | - $action = 'edit_posts'; |
|
| 410 | + if ( empty( $action ) ) { |
|
| 411 | + $action = 'edit_posts'; |
|
| 412 | + } |
|
| 406 | 413 | |
| 407 | - if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
| 408 | - $postid = get_the_ID(); |
|
| 414 | + if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') { |
|
| 415 | + $postid = get_the_ID(); |
|
| 416 | + } |
|
| 409 | 417 | |
| 410 | 418 | if ( is_user_logged_in() && current_user_can( $action, $postid ) ) { |
| 411 | 419 | // check against post types: |