@@ -61,6 +61,10 @@ |
||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
| 64 | +/** |
|
| 65 | + * @param string $option |
|
| 66 | + * @param string $section |
|
| 67 | + */ |
|
| 64 | 68 | function lasso_editor_get_option( $option, $section, $default = '' ) { |
| 65 | 69 | |
| 66 | 70 | if ( empty( $option ) ) |
@@ -63,8 +63,9 @@ |
||
| 63 | 63 | |
| 64 | 64 | function lasso_editor_get_option( $option, $section, $default = '' ) { |
| 65 | 65 | |
| 66 | - if ( empty( $option ) ) |
|
| 67 | - return; |
|
| 66 | + if ( empty( $option ) ) { |
|
| 67 | + return; |
|
| 68 | + } |
|
| 68 | 69 | |
| 69 | 70 | if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
| 70 | 71 | |
@@ -13,6 +13,11 @@ discard block |
||
| 13 | 13 | * @since 1.0 |
| 14 | 14 | */ |
| 15 | 15 | if( !function_exists('lasso_editor_get_option')): |
| 16 | + |
|
| 17 | + /** |
|
| 18 | + * @param string $option |
|
| 19 | + * @param string $section |
|
| 20 | + */ |
|
| 16 | 21 | function lasso_editor_get_option( $option, $section, $default = '' ) { |
| 17 | 22 | |
| 18 | 23 | if ( empty( $option ) ) |
@@ -216,7 +221,7 @@ discard block |
||
| 216 | 221 | * Return an array of categories for autocomplete |
| 217 | 222 | * |
| 218 | 223 | * @since 0.9.3 |
| 219 | - * @return array all categoiries |
|
| 224 | + * @return null|string all categoiries |
|
| 220 | 225 | */ |
| 221 | 226 | function lasso_get_objects( $taxonomy = 'category' ) { |
| 222 | 227 | |
@@ -309,7 +314,7 @@ discard block |
||
| 309 | 314 | * Used internally as a callback to build a tab or content area for modal addons |
| 310 | 315 | * |
| 311 | 316 | * @param $tab object |
| 312 | -* @param $type string tab or content |
|
| 317 | +* @param string $type string tab or content |
|
| 313 | 318 | * @uses lasso_modal_addons() |
| 314 | 319 | * @since 0.9.4 |
| 315 | 320 | */ |
@@ -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 | |
@@ -44,11 +45,12 @@ discard block |
||
| 44 | 45 | |
| 45 | 46 | $q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) ); |
| 46 | 47 | |
| 47 | - if ( $q->have_posts() ) |
|
| 48 | - return true; |
|
| 49 | - else |
|
| 50 | - return false; |
|
| 51 | -} |
|
| 48 | + if ( $q->have_posts() ) { |
|
| 49 | + return true; |
|
| 50 | + } else { |
|
| 51 | + return false; |
|
| 52 | + } |
|
| 53 | + } |
|
| 52 | 54 | |
| 53 | 55 | /** |
| 54 | 56 | * Return a CSS class of an automatically supported theme |
@@ -194,13 +196,15 @@ discard block |
||
| 194 | 196 | */ |
| 195 | 197 | function lasso_get_post_objects( $postid = '', $taxonomy = 'category') { |
| 196 | 198 | |
| 197 | - if ( empty( $postid ) ) |
|
| 198 | - $postid = get_the_ID(); |
|
| 199 | + if ( empty( $postid ) ) { |
|
| 200 | + $postid = get_the_ID(); |
|
| 201 | + } |
|
| 199 | 202 | |
| 200 | 203 | $objects = 'category' == $taxonomy ? get_the_category( $postid ) : get_the_tags( $postid ); |
| 201 | 204 | |
| 202 | - if ( empty( $objects) ) |
|
| 203 | - return; |
|
| 205 | + if ( empty( $objects) ) { |
|
| 206 | + return; |
|
| 207 | + } |
|
| 204 | 208 | |
| 205 | 209 | $out = ''; |
| 206 | 210 | foreach( $objects as $object ) { |
@@ -222,8 +226,9 @@ discard block |
||
| 222 | 226 | |
| 223 | 227 | $objects = 'category' == $taxonomy ? get_categories(array('hide_empty' => 0)) : get_tags(array('hide_empty' => 0)); |
| 224 | 228 | |
| 225 | - if ( empty( $objects) ) |
|
| 226 | - return; |
|
| 229 | + if ( empty( $objects) ) { |
|
| 230 | + return; |
|
| 231 | + } |
|
| 227 | 232 | |
| 228 | 233 | $out = ""; |
| 229 | 234 | foreach( $objects as $object ) { |
@@ -345,8 +350,9 @@ discard block |
||
| 345 | 350 | */ |
| 346 | 351 | function lasso_clean_string( $string = '' ) { |
| 347 | 352 | |
| 348 | - if ( empty( $string ) ) |
|
| 349 | - return; |
|
| 353 | + if ( empty( $string ) ) { |
|
| 354 | + return; |
|
| 355 | + } |
|
| 350 | 356 | |
| 351 | 357 | return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) ); |
| 352 | 358 | } |
@@ -385,11 +391,13 @@ discard block |
||
| 385 | 391 | if ( !function_exists( 'lasso_user_can' ) ): |
| 386 | 392 | function lasso_user_can( $action = '', $postid = 0 ) { |
| 387 | 393 | $result = false; |
| 388 | - if ( empty( $action ) ) |
|
| 389 | - $action = 'edit_posts'; |
|
| 394 | + if ( empty( $action ) ) { |
|
| 395 | + $action = 'edit_posts'; |
|
| 396 | + } |
|
| 390 | 397 | |
| 391 | - if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
| 392 | - $postid = get_the_ID(); |
|
| 398 | + if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') { |
|
| 399 | + $postid = get_the_ID(); |
|
| 400 | + } |
|
| 393 | 401 | |
| 394 | 402 | if ( is_user_logged_in() && current_user_can( $action, $postid ) ) { |
| 395 | 403 | // check against post types: |