@@ -18,40 +18,40 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | // Check for shortcode overrides. |
| 20 | 20 | if ( null !== $shortcode_args ) { |
| 21 | - if ( isset( $shortcode_args['columns'] ) ) { |
|
| 22 | - $column_class = $shortcode_args['columns']; |
|
| 23 | - $column_class = \lsx_health_plan\functions\column_class( $column_class ); |
|
| 24 | - } |
|
| 25 | - if ( isset( $shortcode_args['link'] ) ) { |
|
| 26 | - $link_setting = $shortcode_args['link']; |
|
| 27 | - // Setup our link and content. |
|
| 28 | - switch ( $link_setting ) { |
|
| 29 | - case 'single': |
|
| 30 | - $link_html = '<a href="' . get_permalink( $group['connected_exercises'] ) . '">'; |
|
| 31 | - $link_close = '</a>'; |
|
| 32 | - break; |
|
| 21 | + if ( isset( $shortcode_args['columns'] ) ) { |
|
| 22 | + $column_class = $shortcode_args['columns']; |
|
| 23 | + $column_class = \lsx_health_plan\functions\column_class( $column_class ); |
|
| 24 | + } |
|
| 25 | + if ( isset( $shortcode_args['link'] ) ) { |
|
| 26 | + $link_setting = $shortcode_args['link']; |
|
| 27 | + // Setup our link and content. |
|
| 28 | + switch ( $link_setting ) { |
|
| 29 | + case 'single': |
|
| 30 | + $link_html = '<a href="' . get_permalink( $group['connected_exercises'] ) . '">'; |
|
| 31 | + $link_close = '</a>'; |
|
| 32 | + break; |
|
| 33 | 33 | |
| 34 | - case 'modal': |
|
| 35 | - $link_html = '<a class="btn border-btn" data-toggle="modal" href="#workout-exercise-modal-' . $group['connected_exercises'] . '">'; |
|
| 36 | - $link_close = '</a>'; |
|
| 37 | - $modal_content_setting = \lsx_health_plan\functions\get_option( 'workout_tab_modal_content', 'excerpt' ); |
|
| 38 | - $modal_args = array( |
|
| 39 | - 'modal_content' => $modal_content_setting, |
|
| 40 | - ); |
|
| 41 | - // We call the button to register the modal, but we do not output it. |
|
| 42 | - lsx_health_plan_workout_exercise_button( $group['connected_exercises'], $group, false, $modal_args ); |
|
| 43 | - break; |
|
| 34 | + case 'modal': |
|
| 35 | + $link_html = '<a class="btn border-btn" data-toggle="modal" href="#workout-exercise-modal-' . $group['connected_exercises'] . '">'; |
|
| 36 | + $link_close = '</a>'; |
|
| 37 | + $modal_content_setting = \lsx_health_plan\functions\get_option( 'workout_tab_modal_content', 'excerpt' ); |
|
| 38 | + $modal_args = array( |
|
| 39 | + 'modal_content' => $modal_content_setting, |
|
| 40 | + ); |
|
| 41 | + // We call the button to register the modal, but we do not output it. |
|
| 42 | + lsx_health_plan_workout_exercise_button( $group['connected_exercises'], $group, false, $modal_args ); |
|
| 43 | + break; |
|
| 44 | 44 | |
| 45 | - case 'none': |
|
| 46 | - default: |
|
| 47 | - $link_html = ''; |
|
| 48 | - $link_close = ''; |
|
| 49 | - break; |
|
| 50 | - } |
|
| 51 | - } |
|
| 52 | - if ( isset( $shortcode_args['description'] ) ) { |
|
| 53 | - $content_setting = $shortcode_args['description']; |
|
| 54 | - } |
|
| 45 | + case 'none': |
|
| 46 | + default: |
|
| 47 | + $link_html = ''; |
|
| 48 | + $link_close = ''; |
|
| 49 | + break; |
|
| 50 | + } |
|
| 51 | + } |
|
| 52 | + if ( isset( $shortcode_args['description'] ) ) { |
|
| 53 | + $content_setting = $shortcode_args['description']; |
|
| 54 | + } |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | ?> |
@@ -63,17 +63,17 @@ discard block |
||
| 63 | 63 | <div class="exercise-feature-img"> |
| 64 | 64 | <a href="<?php echo esc_url( get_permalink() ); ?>"> |
| 65 | 65 | <?php |
| 66 | - $featured_image = get_the_post_thumbnail(); |
|
| 67 | - if ( ! empty( $featured_image ) && '' !== $featured_image ) { |
|
| 68 | - the_post_thumbnail( 'medium', array( |
|
| 69 | - 'class' => 'aligncenter', |
|
| 70 | - ) ); |
|
| 71 | - } else { |
|
| 72 | - ?> |
|
| 66 | + $featured_image = get_the_post_thumbnail(); |
|
| 67 | + if ( ! empty( $featured_image ) && '' !== $featured_image ) { |
|
| 68 | + the_post_thumbnail( 'medium', array( |
|
| 69 | + 'class' => 'aligncenter', |
|
| 70 | + ) ); |
|
| 71 | + } else { |
|
| 72 | + ?> |
|
| 73 | 73 | <img loading="lazy" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>"> |
| 74 | 74 | <?php |
| 75 | - } |
|
| 76 | - ?> |
|
| 75 | + } |
|
| 76 | + ?> |
|
| 77 | 77 | </a> |
| 78 | 78 | </div> |
| 79 | 79 | <div class="content-box exercise-content-box white-bg"> |
@@ -82,19 +82,19 @@ discard block |
||
| 82 | 82 | <?php lsx_health_plan_exercise_data(); ?> |
| 83 | 83 | </div> |
| 84 | 84 | <?php |
| 85 | - if ( '' !== $content_setting && 'excerpt' === $content_setting ) { |
|
| 86 | - if ( ! has_excerpt() ) { |
|
| 87 | - $content = wp_trim_words( get_the_content(), 20 ); |
|
| 88 | - $content = '<p>' . $content . '</p>'; |
|
| 89 | - } else { |
|
| 90 | - $content = apply_filters( 'the_excerpt', get_the_excerpt() ); |
|
| 91 | - } |
|
| 92 | - echo wp_kses_post( $content ); |
|
| 93 | - } |
|
| 94 | - if ( '' !== $content_setting && 'full' === $content_setting ) { |
|
| 95 | - the_content(); |
|
| 96 | - } |
|
| 97 | - ?> |
|
| 85 | + if ( '' !== $content_setting && 'excerpt' === $content_setting ) { |
|
| 86 | + if ( ! has_excerpt() ) { |
|
| 87 | + $content = wp_trim_words( get_the_content(), 20 ); |
|
| 88 | + $content = '<p>' . $content . '</p>'; |
|
| 89 | + } else { |
|
| 90 | + $content = apply_filters( 'the_excerpt', get_the_excerpt() ); |
|
| 91 | + } |
|
| 92 | + echo wp_kses_post( $content ); |
|
| 93 | + } |
|
| 94 | + if ( '' !== $content_setting && 'full' === $content_setting ) { |
|
| 95 | + the_content(); |
|
| 96 | + } |
|
| 97 | + ?> |
|
| 98 | 98 | <a href="<?php echo esc_url( get_permalink() ); ?>" class="btn border-btn"><?php esc_html_e( 'See exercise', 'lsx-health-plan' ); ?></a> |
| 99 | 99 | </div> |
| 100 | 100 | <?php lsx_entry_bottom(); ?> |