@@ -71,23 +71,26 @@ |
||
| 71 | 71 | <p><?php _e( 'We will check the current theme on every site in your network and give you a quick status feedback here. You can see the status by visiting the Editus menu on each site.', 'lasso' );?></p> |
| 72 | 72 | </li> |
| 73 | 73 | |
| 74 | - <?php else : |
|
| 74 | + <?php else { |
|
| 75 | + : |
|
| 75 | 76 | |
| 76 | 77 | $checks = self::lasso_preflight_check(); |
| 78 | +} |
|
| 77 | 79 | |
| 78 | 80 | if ( $checks && !defined( 'LASSO_AGENCY_MODE' ) ): |
| 79 | 81 | |
| 80 | 82 | foreach ( (array) $checks as $key => $check ) { |
| 81 | 83 | |
| 82 | 84 | echo $check; |
| 83 | - } |
|
| 84 | - |
|
| 85 | - else: |
|
| 85 | + } else { |
|
| 86 | + : |
|
| 86 | 87 | |
| 87 | 88 | // pre-flight is go for flight |
| 88 | 89 | ?> |
| 89 | 90 | <li class="success"> |
| 90 | - <h3><?php _e( 'You\'re Ready to Rock!', 'lasso' );?></h3> |
|
| 91 | + <h3><?php _e( 'You\'re Ready to Rock!', 'lasso' ); |
|
| 92 | + } |
|
| 93 | + ?></h3> |
|
| 91 | 94 | <?php if ( lasso_get_supported_theme_class() ) { ?> |
| 92 | 95 | <p><?php _e( 'Your theme is automatically supported. No additional setup is needed.', 'lasso' );?></p> |
| 93 | 96 | <?php } ?> |
@@ -76,9 +76,13 @@ |
||
| 76 | 76 | |
| 77 | 77 | /* a helper function */ |
| 78 | 78 | function strpos_arr($haystack, $needle) { |
| 79 | - if(!is_array($needle)) $needle = array($needle); |
|
| 79 | + if(!is_array($needle)) { |
|
| 80 | + $needle = array($needle); |
|
| 81 | + } |
|
| 80 | 82 | foreach($needle as $what) { |
| 81 | - if(($pos = strpos($haystack, $what))!==false) return $pos; |
|
| 83 | + if(($pos = strpos($haystack, $what))!==false) { |
|
| 84 | + return $pos; |
|
| 85 | + } |
|
| 82 | 86 | } |
| 83 | 87 | return false; |
| 84 | 88 | } |
| 85 | 89 | \ No newline at end of file |
@@ -144,8 +144,7 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
| 147 | - } |
|
| 148 | - else { |
|
| 147 | + } else { |
|
| 149 | 148 | //remove all terms from post |
| 150 | 149 | $result = wp_set_object_terms( $postid, null, $taxonomy ); |
| 151 | 150 | |
@@ -153,7 +152,7 @@ discard block |
||
| 153 | 152 | |
| 154 | 153 | if ( ! is_wp_error( $result ) ) { |
| 155 | 154 | return true; |
| 156 | - }else{ |
|
| 155 | + } else{ |
|
| 157 | 156 | return false; |
| 158 | 157 | } |
| 159 | 158 | |
@@ -45,8 +45,9 @@ discard block |
||
| 45 | 45 | function process_settings() { |
| 46 | 46 | |
| 47 | 47 | // bail out if current user isn't and administrator and they are not logged in |
| 48 | - if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() ) |
|
| 49 | - return; |
|
| 48 | + if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() ) { |
|
| 49 | + return; |
|
| 50 | + } |
|
| 50 | 51 | |
| 51 | 52 | if ( isset( $_POST['action'] ) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer( 'nonce', 'lasso_editor_settings' ) ) { |
| 52 | 53 | |
@@ -86,8 +87,9 @@ discard block |
||
| 86 | 87 | */ |
| 87 | 88 | function lasso_editor_settings_form() { |
| 88 | 89 | |
| 89 | - if ( !is_user_logged_in() ) |
|
| 90 | - return; |
|
| 90 | + if ( !is_user_logged_in() ) { |
|
| 91 | + return; |
|
| 92 | + } |
|
| 91 | 93 | |
| 92 | 94 | $article_object = lasso_editor_get_option( 'article_class', 'lasso_editor' ); |
| 93 | 95 | $featImgClass = lasso_editor_get_option( 'featimg_class', 'lasso_editor' ); |
@@ -137,7 +139,9 @@ discard block |
||
| 137 | 139 | $post_types = get_post_types( $args, 'objects' ); |
| 138 | 140 | |
| 139 | 141 | foreach ( $post_types as $post_type ) { |
| 140 | - if ($post_type->name == 'attachment') continue; |
|
| 142 | + if ($post_type->name == 'attachment') { |
|
| 143 | + continue; |
|
| 144 | + } |
|
| 141 | 145 | $checked =""; |
| 142 | 146 | if ( in_array( $post_type->name, $allowed_post_types ) ) { |
| 143 | 147 | $checked = 'checked="checked"'; |
@@ -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 ) { |
@@ -220,8 +224,9 @@ discard block |
||
| 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 ) { |
@@ -343,8 +348,9 @@ discard block |
||
| 343 | 348 | */ |
| 344 | 349 | function lasso_clean_string( $string = '' ) { |
| 345 | 350 | |
| 346 | - if ( empty( $string ) ) |
|
| 347 | - return; |
|
| 351 | + if ( empty( $string ) ) { |
|
| 352 | + return; |
|
| 353 | + } |
|
| 348 | 354 | |
| 349 | 355 | return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) ); |
| 350 | 356 | } |
@@ -383,11 +389,13 @@ discard block |
||
| 383 | 389 | if ( !function_exists( 'lasso_user_can' ) ): |
| 384 | 390 | function lasso_user_can( $action = '', $postid = 0 ) { |
| 385 | 391 | $result = false; |
| 386 | - if ( empty( $action ) ) |
|
| 387 | - $action = 'edit_posts'; |
|
| 392 | + if ( empty( $action ) ) { |
|
| 393 | + $action = 'edit_posts'; |
|
| 394 | + } |
|
| 388 | 395 | |
| 389 | - if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
| 390 | - $postid = get_the_ID(); |
|
| 396 | + if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') { |
|
| 397 | + $postid = get_the_ID(); |
|
| 398 | + } |
|
| 391 | 399 | |
| 392 | 400 | if ( is_user_logged_in() && current_user_can( $action, $postid ) ) { |
| 393 | 401 | // check against post types: |
@@ -316,44 +316,34 @@ |
||
| 316 | 316 | if ($code == "aesop_video") { |
| 317 | 317 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
| 318 | 318 | echo aesop_video_shortcode($atts); |
| 319 | - } |
|
| 320 | - else if ($code == "aesop_image") { |
|
| 319 | + } else if ($code == "aesop_image") { |
|
| 321 | 320 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
| 322 | 321 | echo aesop_image_shortcode($atts); |
| 323 | - } |
|
| 324 | - else if ($code == "aesop_quote") { |
|
| 322 | + } else if ($code == "aesop_quote") { |
|
| 325 | 323 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
| 326 | 324 | echo aesop_quote_shortcode($atts); |
| 327 | - } |
|
| 328 | - else if ($code == "aesop_parallax") { |
|
| 325 | + } else if ($code == "aesop_parallax") { |
|
| 329 | 326 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
| 330 | 327 | echo aesop_parallax_shortcode($atts); |
| 331 | - } |
|
| 332 | - else if ($code == "aesop_character") { |
|
| 328 | + } else if ($code == "aesop_character") { |
|
| 333 | 329 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
| 334 | 330 | echo aesop_character_shortcode($atts); |
| 335 | - } |
|
| 336 | - else if ($code == "aesop_collection") { |
|
| 331 | + } else if ($code == "aesop_collection") { |
|
| 337 | 332 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
| 338 | 333 | echo aesop_collection_shortcode($atts); |
| 339 | - } |
|
| 340 | - else if ($code == "aesop_chapter") { |
|
| 334 | + } else if ($code == "aesop_chapter") { |
|
| 341 | 335 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
| 342 | 336 | echo aesop_chapter_shortcode($atts); |
| 343 | - } |
|
| 344 | - else if ($code == "aesop_content") { |
|
| 337 | + } else if ($code == "aesop_content") { |
|
| 345 | 338 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
| 346 | 339 | echo aesop_content_shortcode($atts, $atts['content_data']); |
| 347 | - } |
|
| 348 | - else if ($code == "aesop_gallery") { |
|
| 340 | + } else if ($code == "aesop_gallery") { |
|
| 349 | 341 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
| 350 | 342 | echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
| 351 | - } |
|
| 352 | - else if ($code == "aesop_audio") { |
|
| 343 | + } else if ($code == "aesop_audio") { |
|
| 353 | 344 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
| 354 | 345 | echo aesop_audio_shortcode($atts); |
| 355 | - } |
|
| 356 | - else { |
|
| 346 | + } else { |
|
| 357 | 347 | $code = '['.$code.' '; |
| 358 | 348 | foreach ($atts as $key => $value) { |
| 359 | 349 | $code = ''.$key.'="'.$value.'" '; |
@@ -109,8 +109,9 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | ob_start(); |
| 111 | 111 | |
| 112 | - if ( !lasso_user_can() ) |
|
| 113 | - return; |
|
| 112 | + if ( !lasso_user_can() ) { |
|
| 113 | + return; |
|
| 114 | + } |
|
| 114 | 115 | |
| 115 | 116 | // let users add custom css classes |
| 116 | 117 | $custom_classes = apply_filters( 'lasso_sidebar_classes', '' ); |
@@ -133,8 +134,9 @@ discard block |
||
| 133 | 134 | |
| 134 | 135 | ob_start(); |
| 135 | 136 | |
| 136 | - if ( !lasso_user_can() ) |
|
| 137 | - return; |
|
| 137 | + if ( !lasso_user_can() ) { |
|
| 138 | + return; |
|
| 139 | + } |
|
| 138 | 140 | |
| 139 | 141 | $is_mobile = wp_is_mobile(); |
| 140 | 142 | |
@@ -208,8 +210,11 @@ discard block |
||
| 208 | 210 | <?php if ( class_exists ('Aesop_Events') ) { ?> |
| 209 | 211 | <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>" class="lasso-toolbar--component__event"></li> |
| 210 | 212 | <?php }?> |
| 211 | - <?php else: ?> |
|
| 212 | - <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
| 213 | + <?php else { |
|
| 214 | + : ?> |
|
| 215 | + <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' ); |
|
| 216 | +} |
|
| 217 | +?>" class="image lasso-toolbar--component__image"></li> |
|
| 213 | 218 | <li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li> |
| 214 | 219 | <!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li--> |
| 215 | 220 | <?php endif; ?> |
@@ -277,8 +282,9 @@ discard block |
||
| 277 | 282 | |
| 278 | 283 | ob_start(); |
| 279 | 284 | |
| 280 | - if ( !lasso_user_can() ) |
|
| 281 | - return; |
|
| 285 | + if ( !lasso_user_can() ) { |
|
| 286 | + return; |
|
| 287 | + } |
|
| 282 | 288 | |
| 283 | 289 | // let users add custom css classes |
| 284 | 290 | $custom_classes = apply_filters( 'lasso_component_classes', '' ); |
@@ -304,8 +310,9 @@ discard block |
||
| 304 | 310 | |
| 305 | 311 | ob_start(); |
| 306 | 312 | |
| 307 | - if ( !lasso_user_can() ) |
|
| 308 | - return; |
|
| 313 | + if ( !lasso_user_can() ) { |
|
| 314 | + return; |
|
| 315 | + } |
|
| 309 | 316 | |
| 310 | 317 | // has post thumbnail |
| 311 | 318 | $has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false; |
@@ -333,8 +340,9 @@ discard block |
||
| 333 | 340 | |
| 334 | 341 | ob_start(); |
| 335 | 342 | |
| 336 | - if ( !lasso_user_can() ) |
|
| 337 | - return; |
|
| 343 | + if ( !lasso_user_can() ) { |
|
| 344 | + return; |
|
| 345 | + } |
|
| 338 | 346 | |
| 339 | 347 | global $post; |
| 340 | 348 | |
@@ -480,8 +488,9 @@ discard block |
||
| 480 | 488 | |
| 481 | 489 | ob_start(); |
| 482 | 490 | |
| 483 | - if ( !lasso_user_can('edit_posts') ) |
|
| 484 | - return; |
|
| 491 | + if ( !lasso_user_can('edit_posts') ) { |
|
| 492 | + return; |
|
| 493 | + } |
|
| 485 | 494 | |
| 486 | 495 | $status = get_post_status( get_the_ID() ); |
| 487 | 496 | |
@@ -613,8 +622,9 @@ discard block |
||
| 613 | 622 | |
| 614 | 623 | ob_start(); |
| 615 | 624 | |
| 616 | - if ( !lasso_user_can() ) |
|
| 617 | - return; |
|
| 625 | + if ( !lasso_user_can() ) { |
|
| 626 | + return; |
|
| 627 | + } |
|
| 618 | 628 | |
| 619 | 629 | // let users add custom css classes |
| 620 | 630 | $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
@@ -634,8 +644,9 @@ discard block |
||
| 634 | 644 | |
| 635 | 645 | ob_start(); |
| 636 | 646 | |
| 637 | - if ( !lasso_user_can() ) |
|
| 638 | - return; |
|
| 647 | + if ( !lasso_user_can() ) { |
|
| 648 | + return; |
|
| 649 | + } |
|
| 639 | 650 | |
| 640 | 651 | // let users add custom css classes |
| 641 | 652 | $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
@@ -706,8 +717,9 @@ discard block |
||
| 706 | 717 | |
| 707 | 718 | $blob = array(); |
| 708 | 719 | |
| 709 | - if ( empty( $codes ) ) |
|
| 710 | - return; |
|
| 720 | + if ( empty( $codes ) ) { |
|
| 721 | + return; |
|
| 722 | + } |
|
| 711 | 723 | |
| 712 | 724 | foreach ( $codes as $slug => $shortcode ) { |
| 713 | 725 | $return = ''; |