@@ -70,7 +70,7 @@ |
||
| 70 | 70 | foreach( $callback as $cb ) { |
| 71 | 71 | $_data = $this->sanitize( $key, $cb ); |
| 72 | 72 | } |
| 73 | - }else{ |
|
| 73 | + } else{ |
|
| 74 | 74 | $_data = $this->sanitize( $key, $callback ); |
| 75 | 75 | } |
| 76 | 76 | |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | $callback = self::find_callback( strip_tags( $action ) ); |
| 37 | 37 | if ( is_int( $callback ) ) { |
| 38 | 38 | $code = $callback; |
| 39 | - }elseif( ! class_exists( $callback['class'] ) ) { |
|
| 39 | + } elseif( ! class_exists( $callback['class'] ) ) { |
|
| 40 | 40 | $code = 415; |
| 41 | - }else { |
|
| 41 | + } else { |
|
| 42 | 42 | $action = str_replace( '-', '_', $action ); |
| 43 | 43 | $callback_instance = new $callback['class']; |
| 44 | 44 | $auth = self::auth( $action, $callback_instance, $callback['method'] ); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - }else{ |
|
| 64 | + } else{ |
|
| 65 | 65 | $code = 401; |
| 66 | 66 | $response = __( 'Nonce not set.', 'lasso' ); |
| 67 | 67 | } |
@@ -167,9 +167,9 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | if ( is_string( $response ) ) { |
| 169 | 169 | $data[] = $response; |
| 170 | - }elseif( is_array( $response ) ) { |
|
| 170 | + } elseif( is_array( $response ) ) { |
|
| 171 | 171 | $data = $response; |
| 172 | - }else{ |
|
| 172 | + } else{ |
|
| 173 | 173 | $data[] = $code; |
| 174 | 174 | } |
| 175 | 175 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | nocache_headers(); |
| 178 | 178 | if ( 200 == $code ) { |
| 179 | 179 | wp_send_json_success( $data ); |
| 180 | - }else{ |
|
| 180 | + } else{ |
|
| 181 | 181 | wp_send_json_error( $data ); |
| 182 | 182 | } |
| 183 | 183 | |
@@ -105,8 +105,9 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | ob_start(); |
| 107 | 107 | |
| 108 | - if ( !lasso_user_can() ) |
|
| 109 | - return; |
|
| 108 | + if ( !lasso_user_can() ) { |
|
| 109 | + return; |
|
| 110 | + } |
|
| 110 | 111 | |
| 111 | 112 | // let users add custom css classes |
| 112 | 113 | $custom_classes = apply_filters( 'lasso_sidebar_classes', '' ); |
@@ -129,8 +130,9 @@ discard block |
||
| 129 | 130 | |
| 130 | 131 | ob_start(); |
| 131 | 132 | |
| 132 | - if ( !lasso_user_can() ) |
|
| 133 | - return; |
|
| 133 | + if ( !lasso_user_can() ) { |
|
| 134 | + return; |
|
| 135 | + } |
|
| 134 | 136 | |
| 135 | 137 | // check for lasso story engine and add a class doniting this |
| 136 | 138 | $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
@@ -195,8 +197,11 @@ discard block |
||
| 195 | 197 | <li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>" class="lasso-toolbar--component__document"></li> |
| 196 | 198 | <li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>" class="lasso-toolbar--component__collection"></li> |
| 197 | 199 | <li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>" class="lasso-toolbar--component__gallery"></li> |
| 198 | - <?php else: ?> |
|
| 199 | - <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
| 200 | + <?php else { |
|
| 201 | + : ?> |
|
| 202 | + <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' ); |
|
| 203 | +} |
|
| 204 | +?>" class="image lasso-toolbar--component__image"></li> |
|
| 200 | 205 | <li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li> |
| 201 | 206 | <?php endif; ?> |
| 202 | 207 | <?php do_action( 'lasso_toolbar_components' );?> |
@@ -219,8 +224,9 @@ discard block |
||
| 219 | 224 | |
| 220 | 225 | ob_start(); |
| 221 | 226 | |
| 222 | - if ( !lasso_user_can() ) |
|
| 223 | - return; |
|
| 227 | + if ( !lasso_user_can() ) { |
|
| 228 | + return; |
|
| 229 | + } |
|
| 224 | 230 | |
| 225 | 231 | // let users add custom css classes |
| 226 | 232 | $custom_classes = apply_filters( 'lasso_component_classes', '' ); |
@@ -246,8 +252,9 @@ discard block |
||
| 246 | 252 | |
| 247 | 253 | ob_start(); |
| 248 | 254 | |
| 249 | - if ( !lasso_user_can() ) |
|
| 250 | - return; |
|
| 255 | + if ( !lasso_user_can() ) { |
|
| 256 | + return; |
|
| 257 | + } |
|
| 251 | 258 | |
| 252 | 259 | // has post thumbnail |
| 253 | 260 | $has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false; |
@@ -275,8 +282,9 @@ discard block |
||
| 275 | 282 | |
| 276 | 283 | ob_start(); |
| 277 | 284 | |
| 278 | - if ( !lasso_user_can() ) |
|
| 279 | - return; |
|
| 285 | + if ( !lasso_user_can() ) { |
|
| 286 | + return; |
|
| 287 | + } |
|
| 280 | 288 | |
| 281 | 289 | global $post; |
| 282 | 290 | |
@@ -406,8 +414,9 @@ discard block |
||
| 406 | 414 | |
| 407 | 415 | ob_start(); |
| 408 | 416 | |
| 409 | - if ( !lasso_user_can('edit_posts') ) |
|
| 410 | - return; |
|
| 417 | + if ( !lasso_user_can('edit_posts') ) { |
|
| 418 | + return; |
|
| 419 | + } |
|
| 411 | 420 | |
| 412 | 421 | $status = get_post_status( get_the_ID() ); |
| 413 | 422 | |
@@ -530,8 +539,9 @@ discard block |
||
| 530 | 539 | |
| 531 | 540 | ob_start(); |
| 532 | 541 | |
| 533 | - if ( !lasso_user_can() ) |
|
| 534 | - return; |
|
| 542 | + if ( !lasso_user_can() ) { |
|
| 543 | + return; |
|
| 544 | + } |
|
| 535 | 545 | |
| 536 | 546 | // let users add custom css classes |
| 537 | 547 | $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
@@ -602,8 +612,9 @@ discard block |
||
| 602 | 612 | |
| 603 | 613 | $blob = array(); |
| 604 | 614 | |
| 605 | - if ( empty( $codes ) ) |
|
| 606 | - return; |
|
| 615 | + if ( empty( $codes ) ) { |
|
| 616 | + return; |
|
| 617 | + } |
|
| 607 | 618 | |
| 608 | 619 | foreach ( $codes as $slug => $shortcode ) { |
| 609 | 620 | $return = ''; |
@@ -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 |
@@ -149,13 +151,15 @@ discard block |
||
| 149 | 151 | */ |
| 150 | 152 | function lasso_get_post_objects( $postid = '', $taxonomy = 'category') { |
| 151 | 153 | |
| 152 | - if ( empty( $postid ) ) |
|
| 153 | - $postid = get_the_ID(); |
|
| 154 | + if ( empty( $postid ) ) { |
|
| 155 | + $postid = get_the_ID(); |
|
| 156 | + } |
|
| 154 | 157 | |
| 155 | 158 | $objects = 'category' == $taxonomy ? get_the_category( $postid ) : get_the_tags( $postid ); |
| 156 | 159 | |
| 157 | - if ( empty( $objects) ) |
|
| 158 | - return; |
|
| 160 | + if ( empty( $objects) ) { |
|
| 161 | + return; |
|
| 162 | + } |
|
| 159 | 163 | |
| 160 | 164 | $out = ''; |
| 161 | 165 | foreach( $objects as $object ) { |
@@ -176,8 +180,9 @@ discard block |
||
| 176 | 180 | |
| 177 | 181 | $objects = 'category' == $taxonomy ? get_categories(array('hide_empty' => 0)) : get_tags(array('hide_empty' => 0)); |
| 178 | 182 | |
| 179 | - if ( empty( $objects) ) |
|
| 180 | - return; |
|
| 183 | + if ( empty( $objects) ) { |
|
| 184 | + return; |
|
| 185 | + } |
|
| 181 | 186 | |
| 182 | 187 | $out = array(); |
| 183 | 188 | foreach( $objects as $object ) { |
@@ -264,8 +269,9 @@ discard block |
||
| 264 | 269 | */ |
| 265 | 270 | function lasso_clean_string( $string = '' ) { |
| 266 | 271 | |
| 267 | - if ( empty( $string ) ) |
|
| 268 | - return; |
|
| 272 | + if ( empty( $string ) ) { |
|
| 273 | + return; |
|
| 274 | + } |
|
| 269 | 275 | |
| 270 | 276 | return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) ); |
| 271 | 277 | } |
@@ -304,11 +310,13 @@ discard block |
||
| 304 | 310 | if ( !function_exists( 'lasso_user_can' ) ): |
| 305 | 311 | function lasso_user_can( $action = '', $postid = 0 ) { |
| 306 | 312 | |
| 307 | - if ( empty( $action ) ) |
|
| 308 | - $action = 'edit_posts'; |
|
| 313 | + if ( empty( $action ) ) { |
|
| 314 | + $action = 'edit_posts'; |
|
| 315 | + } |
|
| 309 | 316 | |
| 310 | - if ( empty( $postid ) ) |
|
| 311 | - $postid = get_the_ID(); |
|
| 317 | + if ( empty( $postid ) ) { |
|
| 318 | + $postid = get_the_ID(); |
|
| 319 | + } |
|
| 312 | 320 | |
| 313 | 321 | if ( is_user_logged_in() && current_user_can( $action, $postid ) ) { |
| 314 | 322 | |
@@ -121,8 +121,9 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | ob_start(); |
| 123 | 123 | |
| 124 | - if ( empty( $name ) || empty( $options ) || !is_array( $options ) ) |
|
| 125 | - return; |
|
| 124 | + if ( empty( $name ) || empty( $options ) || !is_array( $options ) ) { |
|
| 125 | + return; |
|
| 126 | + } |
|
| 126 | 127 | |
| 127 | 128 | $nonce = wp_create_nonce('lasso-process-post-meta'); |
| 128 | 129 | $key = sprintf('_lasso_%s_settings', $name ); |
@@ -160,8 +161,9 @@ discard block |
||
| 160 | 161 | $before = '<div class="lasso--postsettings__option">'; |
| 161 | 162 | $after = '</div>'; |
| 162 | 163 | |
| 163 | - if ( empty( $name ) || empty( $options ) ) |
|
| 164 | - return; |
|
| 164 | + if ( empty( $name ) || empty( $options ) ) { |
|
| 165 | + return; |
|
| 166 | + } |
|
| 165 | 167 | |
| 166 | 168 | foreach ( (array) $options as $option ) { |
| 167 | 169 | |
@@ -195,8 +197,9 @@ discard block |
||
| 195 | 197 | */ |
| 196 | 198 | function lasso_option_engine_option( $name = '', $option = '', $type = '') { |
| 197 | 199 | |
| 198 | - if ( empty( $type ) || empty( $option ) ) |
|
| 199 | - return; |
|
| 200 | + if ( empty( $type ) || empty( $option ) ) { |
|
| 201 | + return; |
|
| 202 | + } |
|
| 200 | 203 | |
| 201 | 204 | $id = isset( $option['id'] ) ? $option['id'] : false; |
| 202 | 205 | $id = $id ? lasso_clean_string( $id ) : false; |