@@ -17,26 +17,26 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | <div class="entry-content"> |
| 19 | 19 | <?php |
| 20 | - wp_link_pages( |
|
| 21 | - array( |
|
| 22 | - 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
|
| 23 | - 'after' => '</div></div>', |
|
| 24 | - 'link_before' => '<span>', |
|
| 25 | - 'link_after' => '</span>', |
|
| 26 | - ) |
|
| 27 | - ); |
|
| 28 | - ?> |
|
| 20 | + wp_link_pages( |
|
| 21 | + array( |
|
| 22 | + 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
|
| 23 | + 'after' => '</div></div>', |
|
| 24 | + 'link_before' => '<span>', |
|
| 25 | + 'link_after' => '</span>', |
|
| 26 | + ) |
|
| 27 | + ); |
|
| 28 | + ?> |
|
| 29 | 29 | <div class="single-plan-inner workout-content"> |
| 30 | 30 | <?php |
| 31 | - if ( ! is_singular( 'workout' ) ) { ?> |
|
| 31 | + if ( ! is_singular( 'workout' ) ) { ?> |
|
| 32 | 32 | <div class="single-plan-section-title workout"> |
| 33 | 33 | <?php lsx_get_svg_icon( 'work.svg' ); ?> |
| 34 | 34 | <h2 class="title-lined"><?php esc_html_e( 'My Workout', 'lsx-health-plan' ); ?> <span class="blue-title"><?php the_title(); ?></span></h2> |
| 35 | 35 | </div> |
| 36 | 36 | <?php } ?> |
| 37 | 37 | <?php |
| 38 | - if ( lsx_health_plan_has_warmup() && ( ! is_singular( 'workout' ) ) ) { |
|
| 39 | - ?> |
|
| 38 | + if ( lsx_health_plan_has_warmup() && ( ! is_singular( 'workout' ) ) ) { |
|
| 39 | + ?> |
|
| 40 | 40 | <div class="workout-instructions"> |
| 41 | 41 | <div class="row"> |
| 42 | 42 | <div class="col-md-6"> |
@@ -46,13 +46,13 @@ discard block |
||
| 46 | 46 | <div class="col-md-6"> |
| 47 | 47 | <div class="single-plan-inner-buttons"> |
| 48 | 48 | <?php |
| 49 | - $download = \lsx_health_plan\functions\get_option( 'download_page', false ); |
|
| 50 | - if ( ! empty( $download ) ) { |
|
| 51 | - ?> |
|
| 49 | + $download = \lsx_health_plan\functions\get_option( 'download_page', false ); |
|
| 50 | + if ( ! empty( $download ) ) { |
|
| 51 | + ?> |
|
| 52 | 52 | <div class="complete-plan-btn"> |
| 53 | 53 | <?php |
| 54 | - echo wp_kses_post( do_shortcode( '[download id="' . $download . '"]' ) ); |
|
| 55 | - ?> |
|
| 54 | + echo wp_kses_post( do_shortcode( '[download id="' . $download . '"]' ) ); |
|
| 55 | + ?> |
|
| 56 | 56 | </div> |
| 57 | 57 | <?php } ?> |
| 58 | 58 | <div class="back-plan-btn"> |
@@ -63,8 +63,8 @@ discard block |
||
| 63 | 63 | </div> |
| 64 | 64 | </div> |
| 65 | 65 | <?php |
| 66 | - } |
|
| 67 | - ?> |
|
| 66 | + } |
|
| 67 | + ?> |
|
| 68 | 68 | <!-- Pre Workout--> |
| 69 | 69 | <?php lsx_workout_snacks( 'pre' ); ?> |
| 70 | 70 | |
@@ -82,19 +82,19 @@ discard block |
||
| 82 | 82 | <?php lsx_content_post_tags(); ?> |
| 83 | 83 | |
| 84 | 84 | <?php |
| 85 | - if ( class_exists( 'LSX_Sharing' ) ) { |
|
| 86 | - lsx_content_sharing(); |
|
| 87 | - } else { |
|
| 88 | - if ( function_exists( 'sharing_display' ) ) { |
|
| 89 | - sharing_display( '', true ); |
|
| 90 | - } |
|
| 85 | + if ( class_exists( 'LSX_Sharing' ) ) { |
|
| 86 | + lsx_content_sharing(); |
|
| 87 | + } else { |
|
| 88 | + if ( function_exists( 'sharing_display' ) ) { |
|
| 89 | + sharing_display( '', true ); |
|
| 90 | + } |
|
| 91 | 91 | |
| 92 | - if ( class_exists( 'Jetpack_Likes' ) ) { |
|
| 93 | - $custom_likes = new Jetpack_Likes(); |
|
| 94 | - echo wp_kses_post( $custom_likes->post_likes( '' ) ); |
|
| 95 | - } |
|
| 96 | - } |
|
| 97 | - ?> |
|
| 92 | + if ( class_exists( 'Jetpack_Likes' ) ) { |
|
| 93 | + $custom_likes = new Jetpack_Likes(); |
|
| 94 | + echo wp_kses_post( $custom_likes->post_likes( '' ) ); |
|
| 95 | + } |
|
| 96 | + } |
|
| 97 | + ?> |
|
| 98 | 98 | <?php endif ?> |
| 99 | 99 | </footer><!-- .footer-meta --> |
| 100 | 100 | |
@@ -10,8 +10,8 @@ discard block |
||
| 10 | 10 | <?php lsx_content_wrap_before(); ?> |
| 11 | 11 | |
| 12 | 12 | <?php |
| 13 | - $page_id = get_the_ID(); |
|
| 14 | - $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id; |
|
| 13 | + $page_id = get_the_ID(); |
|
| 14 | + $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id; |
|
| 15 | 15 | ?> |
| 16 | 16 | |
| 17 | 17 | <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | <!-- Begining restricted content --> |
| 22 | 22 | <?php |
| 23 | - if ( current_user_can( 'wc_memberships_view_restricted_post_content', $post_id ) ) { |
|
| 24 | - ?> |
|
| 23 | + if ( current_user_can( 'wc_memberships_view_restricted_post_content', $post_id ) ) { |
|
| 24 | + ?> |
|
| 25 | 25 | <main id="main" role="main"> |
| 26 | 26 | |
| 27 | 27 | <?php lsx_content_top(); ?> |
@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | <div class="row"> |
| 31 | 31 | <?php if ( have_posts() ) : ?> |
| 32 | 32 | <?php |
| 33 | - while ( have_posts() ) : |
|
| 34 | - the_post(); |
|
| 35 | - ?> |
|
| 33 | + while ( have_posts() ) : |
|
| 34 | + the_post(); |
|
| 35 | + ?> |
|
| 36 | 36 | |
| 37 | 37 | <?php include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-recipe.php'; ?> |
| 38 | 38 | |
@@ -51,11 +51,11 @@ discard block |
||
| 51 | 51 | </main><!-- #main --> |
| 52 | 52 | |
| 53 | 53 | <?php |
| 54 | - } else { |
|
| 55 | - wp_redirect( $redirect ); |
|
| 56 | - exit; |
|
| 57 | - } |
|
| 58 | - ?> |
|
| 54 | + } else { |
|
| 55 | + wp_redirect( $redirect ); |
|
| 56 | + exit; |
|
| 57 | + } |
|
| 58 | + ?> |
|
| 59 | 59 | |
| 60 | 60 | <?php lsx_content_after(); ?> |
| 61 | 61 | |
@@ -30,19 +30,19 @@ |
||
| 30 | 30 | <?php lsx_content_post_tags(); ?> |
| 31 | 31 | |
| 32 | 32 | <?php |
| 33 | - if ( class_exists( 'LSX_Sharing' ) ) { |
|
| 34 | - lsx_content_sharing(); |
|
| 35 | - } else { |
|
| 36 | - if ( function_exists( 'sharing_display' ) ) { |
|
| 37 | - sharing_display( '', true ); |
|
| 38 | - } |
|
| 39 | - |
|
| 40 | - if ( class_exists( 'Jetpack_Likes' ) ) { |
|
| 41 | - $custom_likes = new Jetpack_Likes(); |
|
| 42 | - echo wp_kses_post( $custom_likes->post_likes( '' ) ); |
|
| 43 | - } |
|
| 44 | - } |
|
| 45 | - ?> |
|
| 33 | + if ( class_exists( 'LSX_Sharing' ) ) { |
|
| 34 | + lsx_content_sharing(); |
|
| 35 | + } else { |
|
| 36 | + if ( function_exists( 'sharing_display' ) ) { |
|
| 37 | + sharing_display( '', true ); |
|
| 38 | + } |
|
| 39 | + |
|
| 40 | + if ( class_exists( 'Jetpack_Likes' ) ) { |
|
| 41 | + $custom_likes = new Jetpack_Likes(); |
|
| 42 | + echo wp_kses_post( $custom_likes->post_likes( '' ) ); |
|
| 43 | + } |
|
| 44 | + } |
|
| 45 | + ?> |
|
| 46 | 46 | <?php endif ?> |
| 47 | 47 | </footer><!-- .footer-meta --> |
| 48 | 48 | |
@@ -9,47 +9,47 @@ |
||
| 9 | 9 | <table class="exercise-table"> |
| 10 | 10 | <tbody> |
| 11 | 11 | <?php |
| 12 | - if ( ! empty( $type ) ) { |
|
| 13 | - ?> |
|
| 12 | + if ( ! empty( $type ) ) { |
|
| 13 | + ?> |
|
| 14 | 14 | <tr class="types"> |
| 15 | 15 | <td><?php esc_html_e( 'Type:', 'lsx-health-plan' ); ?> </td> |
| 16 | 16 | <td> |
| 17 | 17 | <?php |
| 18 | - echo wp_kses_post( $type ); |
|
| 19 | - ?> |
|
| 18 | + echo wp_kses_post( $type ); |
|
| 19 | + ?> |
|
| 20 | 20 | </td> |
| 21 | 21 | </tr> |
| 22 | 22 | <?php |
| 23 | - } |
|
| 24 | - ?> |
|
| 23 | + } |
|
| 24 | + ?> |
|
| 25 | 25 | <?php |
| 26 | - if ( ! empty( $muscle_group ) ) { |
|
| 27 | - ?> |
|
| 26 | + if ( ! empty( $muscle_group ) ) { |
|
| 27 | + ?> |
|
| 28 | 28 | <tr class="muscle-group"> |
| 29 | 29 | <td><?php esc_html_e( 'Muscle Group:', 'lsx-health-plan' ); ?> </td> |
| 30 | 30 | <td> |
| 31 | 31 | <?php |
| 32 | - echo wp_kses_post( $muscle_group ); |
|
| 33 | - ?> |
|
| 32 | + echo wp_kses_post( $muscle_group ); |
|
| 33 | + ?> |
|
| 34 | 34 | </td> |
| 35 | 35 | </tr> |
| 36 | 36 | <?php |
| 37 | - } |
|
| 38 | - ?> |
|
| 37 | + } |
|
| 38 | + ?> |
|
| 39 | 39 | <?php |
| 40 | - if ( ! empty( $equipment ) ) { |
|
| 41 | - ?> |
|
| 40 | + if ( ! empty( $equipment ) ) { |
|
| 41 | + ?> |
|
| 42 | 42 | <tr class="equipment"> |
| 43 | 43 | <td><?php esc_html_e( 'Equipment:', 'lsx-health-plan' ); ?> </td> |
| 44 | 44 | <td> |
| 45 | 45 | <?php |
| 46 | - echo wp_kses_post( $equipment ); |
|
| 47 | - ?> |
|
| 46 | + echo wp_kses_post( $equipment ); |
|
| 47 | + ?> |
|
| 48 | 48 | </td> |
| 49 | 49 | </tr> |
| 50 | 50 | <?php |
| 51 | - } |
|
| 52 | - ?> |
|
| 51 | + } |
|
| 52 | + ?> |
|
| 53 | 53 | </tbody> |
| 54 | 54 | </table> |
| 55 | 55 | <?php } ?> |
@@ -20,63 +20,63 @@ discard block |
||
| 20 | 20 | <?php } ?> |
| 21 | 21 | <tbody> |
| 22 | 22 | <?php |
| 23 | - if ( 1 >= (int) $serves ) { |
|
| 24 | - $serves = '1'; |
|
| 25 | - $serves_label = __( 'Person', 'lsx-health-plan' ); |
|
| 26 | - } else { |
|
| 27 | - $serves_label = __( 'People', 'lsx-health-plan' ); |
|
| 28 | - } |
|
| 29 | - ?> |
|
| 23 | + if ( 1 >= (int) $serves ) { |
|
| 24 | + $serves = '1'; |
|
| 25 | + $serves_label = __( 'Person', 'lsx-health-plan' ); |
|
| 26 | + } else { |
|
| 27 | + $serves_label = __( 'People', 'lsx-health-plan' ); |
|
| 28 | + } |
|
| 29 | + ?> |
|
| 30 | 30 | <tr class="serves"> |
| 31 | 31 | <td><?php esc_html_e( 'Serves:', 'lsx-health-plan' ); ?> </td> |
| 32 | 32 | <td> |
| 33 | 33 | <?php |
| 34 | - echo wp_kses_post( $serves ) . ' ' . esc_html( $serves_label ); |
|
| 35 | - ?> |
|
| 34 | + echo wp_kses_post( $serves ) . ' ' . esc_html( $serves_label ); |
|
| 35 | + ?> |
|
| 36 | 36 | </td> |
| 37 | 37 | </tr> |
| 38 | 38 | <?php |
| 39 | - if ( ! empty( $prep_time ) ) { |
|
| 40 | - ?> |
|
| 39 | + if ( ! empty( $prep_time ) ) { |
|
| 40 | + ?> |
|
| 41 | 41 | <tr class="prep-time"> |
| 42 | 42 | <td><?php esc_html_e( 'Prep time: ', 'lsx-health-plan' ); ?> </td> |
| 43 | 43 | <td> |
| 44 | 44 | <?php |
| 45 | - echo wp_kses_post( $prep_time ); |
|
| 46 | - ?> |
|
| 45 | + echo wp_kses_post( $prep_time ); |
|
| 46 | + ?> |
|
| 47 | 47 | </td> |
| 48 | 48 | </tr> |
| 49 | 49 | <?php |
| 50 | - } |
|
| 51 | - ?> |
|
| 50 | + } |
|
| 51 | + ?> |
|
| 52 | 52 | <?php |
| 53 | - if ( ! empty( $cooking_time ) ) { |
|
| 54 | - ?> |
|
| 53 | + if ( ! empty( $cooking_time ) ) { |
|
| 54 | + ?> |
|
| 55 | 55 | <tr class="cooking-time"> |
| 56 | 56 | <td><?php esc_html_e( 'Cooking time: ', 'lsx-health-plan' ); ?> </td> |
| 57 | 57 | <td> |
| 58 | 58 | <?php |
| 59 | - echo wp_kses_post( $cooking_time ); |
|
| 60 | - ?> |
|
| 59 | + echo wp_kses_post( $cooking_time ); |
|
| 60 | + ?> |
|
| 61 | 61 | </td> |
| 62 | 62 | </tr> |
| 63 | 63 | <?php |
| 64 | - } |
|
| 65 | - ?> |
|
| 64 | + } |
|
| 65 | + ?> |
|
| 66 | 66 | <?php |
| 67 | - if ( ! empty( $portion ) ) { |
|
| 68 | - ?> |
|
| 67 | + if ( ! empty( $portion ) ) { |
|
| 68 | + ?> |
|
| 69 | 69 | <tr class="portion-size"> |
| 70 | 70 | <td><?php esc_html_e( 'Portion size: ', 'lsx-health-plan' ); ?> </td> |
| 71 | 71 | <td> |
| 72 | 72 | <?php |
| 73 | - echo wp_kses_post( $portion ); |
|
| 74 | - ?> |
|
| 73 | + echo wp_kses_post( $portion ); |
|
| 74 | + ?> |
|
| 75 | 75 | </td> |
| 76 | 76 | </tr> |
| 77 | 77 | <?php |
| 78 | - } |
|
| 79 | - ?> |
|
| 78 | + } |
|
| 79 | + ?> |
|
| 80 | 80 | </tbody> |
| 81 | 81 | </table> |
| 82 | 82 | <?php } ?> |
@@ -89,75 +89,75 @@ discard block |
||
| 89 | 89 | </thead> |
| 90 | 90 | <tbody> |
| 91 | 91 | <?php |
| 92 | - if ( ! empty( $energy ) ) { |
|
| 93 | - ?> |
|
| 92 | + if ( ! empty( $energy ) ) { |
|
| 93 | + ?> |
|
| 94 | 94 | <tr class="energy"> |
| 95 | 95 | <td><?php esc_html_e( 'Energy: ', 'lsx-health-plan' ); ?> </td> |
| 96 | 96 | <td> |
| 97 | 97 | <?php |
| 98 | - echo wp_kses_post( $energy ); |
|
| 99 | - ?> |
|
| 98 | + echo wp_kses_post( $energy ); |
|
| 99 | + ?> |
|
| 100 | 100 | </td> |
| 101 | 101 | </tr> |
| 102 | 102 | <?php |
| 103 | - } |
|
| 104 | - ?> |
|
| 103 | + } |
|
| 104 | + ?> |
|
| 105 | 105 | <?php |
| 106 | - if ( ! empty( $protein ) ) { |
|
| 107 | - ?> |
|
| 106 | + if ( ! empty( $protein ) ) { |
|
| 107 | + ?> |
|
| 108 | 108 | <tr class="protein"> |
| 109 | 109 | <td><?php esc_html_e( 'Protein: ', 'lsx-health-plan' ); ?> </td> |
| 110 | 110 | <td> |
| 111 | 111 | <?php |
| 112 | - echo wp_kses_post( $protein ); |
|
| 113 | - ?> |
|
| 112 | + echo wp_kses_post( $protein ); |
|
| 113 | + ?> |
|
| 114 | 114 | </td> |
| 115 | 115 | </tr> |
| 116 | 116 | <?php |
| 117 | - } |
|
| 118 | - ?> |
|
| 117 | + } |
|
| 118 | + ?> |
|
| 119 | 119 | <?php |
| 120 | - if ( ! empty( $carbohydrates ) ) { |
|
| 121 | - ?> |
|
| 120 | + if ( ! empty( $carbohydrates ) ) { |
|
| 121 | + ?> |
|
| 122 | 122 | <tr class="carbohydrates"> |
| 123 | 123 | <td><?php esc_html_e( 'Carbohydrates: ', 'lsx-health-plan' ); ?> </td> |
| 124 | 124 | <td> |
| 125 | 125 | <?php |
| 126 | - echo wp_kses_post( $carbohydrates ); |
|
| 127 | - ?> |
|
| 126 | + echo wp_kses_post( $carbohydrates ); |
|
| 127 | + ?> |
|
| 128 | 128 | </td> |
| 129 | 129 | </tr> |
| 130 | 130 | <?php |
| 131 | - } |
|
| 132 | - ?> |
|
| 131 | + } |
|
| 132 | + ?> |
|
| 133 | 133 | <?php |
| 134 | - if ( ! empty( $fibre ) ) { |
|
| 135 | - ?> |
|
| 134 | + if ( ! empty( $fibre ) ) { |
|
| 135 | + ?> |
|
| 136 | 136 | <tr class="fibre"> |
| 137 | 137 | <td><?php esc_html_e( 'Fibre: ', 'lsx-health-plan' ); ?> </td> |
| 138 | 138 | <td> |
| 139 | 139 | <?php |
| 140 | - echo wp_kses_post( $fibre ); |
|
| 141 | - ?> |
|
| 140 | + echo wp_kses_post( $fibre ); |
|
| 141 | + ?> |
|
| 142 | 142 | </td> |
| 143 | 143 | </tr> |
| 144 | 144 | <?php |
| 145 | - } |
|
| 146 | - ?> |
|
| 145 | + } |
|
| 146 | + ?> |
|
| 147 | 147 | <?php |
| 148 | - if ( ! empty( $fat ) ) { |
|
| 149 | - ?> |
|
| 148 | + if ( ! empty( $fat ) ) { |
|
| 149 | + ?> |
|
| 150 | 150 | <tr class="fat"> |
| 151 | 151 | <td><?php esc_html_e( 'Fat: ', 'lsx-health-plan' ); ?> </td> |
| 152 | 152 | <td> |
| 153 | 153 | <?php |
| 154 | - echo wp_kses_post( $fat ); |
|
| 155 | - ?> |
|
| 154 | + echo wp_kses_post( $fat ); |
|
| 155 | + ?> |
|
| 156 | 156 | </td> |
| 157 | 157 | </tr> |
| 158 | 158 | <?php |
| 159 | - } |
|
| 160 | - ?> |
|
| 159 | + } |
|
| 160 | + ?> |
|
| 161 | 161 | </tbody> |
| 162 | 162 | </table> |
| 163 | 163 | <?php } ?> |
@@ -10,42 +10,42 @@ |
||
| 10 | 10 | <ul class="nav nav-pills"> |
| 11 | 11 | <li class="<?php lsx_health_plan_nav_class( '' ); ?>"><a class="overview-tab" href="<?php the_permalink(); ?>"><?php lsx_get_svg_icon( 'eye.svg' ); ?> <?php esc_html_e( 'Overview', 'lsx-health-plan' ); ?></a></li> |
| 12 | 12 | <?php |
| 13 | - if ( lsx_health_plan_has_warmup() ) { |
|
| 14 | - $warm_up = \lsx_health_plan\functions\get_option( 'endpoint_warm_up', false ); |
|
| 15 | - if ( false === $warm_up ) { |
|
| 16 | - $warm_up = 'warm-up'; |
|
| 17 | - } |
|
| 18 | - ?> |
|
| 13 | + if ( lsx_health_plan_has_warmup() ) { |
|
| 14 | + $warm_up = \lsx_health_plan\functions\get_option( 'endpoint_warm_up', false ); |
|
| 15 | + if ( false === $warm_up ) { |
|
| 16 | + $warm_up = 'warm-up'; |
|
| 17 | + } |
|
| 18 | + ?> |
|
| 19 | 19 | <li class="<?php lsx_health_plan_nav_class( 'warm-up' ); ?>"><a class="warm-up-tab" href="<?php the_permalink(); ?><?php echo esc_attr( $warm_up ); ?>/"><?php lsx_get_svg_icon( 'warm.svg' ); ?> <?php esc_html_e( 'Warm-up', 'lsx-health-plan' ); ?></a></li> |
| 20 | 20 | <?php |
| 21 | - } |
|
| 22 | - if ( lsx_health_plan_has_workout() ) { |
|
| 23 | - $workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', false ); |
|
| 24 | - if ( false === $workout ) { |
|
| 25 | - $workout = 'workout'; |
|
| 26 | - } |
|
| 27 | - ?> |
|
| 21 | + } |
|
| 22 | + if ( lsx_health_plan_has_workout() ) { |
|
| 23 | + $workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', false ); |
|
| 24 | + if ( false === $workout ) { |
|
| 25 | + $workout = 'workout'; |
|
| 26 | + } |
|
| 27 | + ?> |
|
| 28 | 28 | <li class="<?php lsx_health_plan_nav_class( 'workout' ); ?>"><a class="workout-tab" href="<?php the_permalink(); ?><?php echo esc_attr( $workout ); ?>/"><?php lsx_get_svg_icon( 'work.svg' ); ?> <?php esc_html_e( 'Workout', 'lsx-health-plan' ); ?></a></li> |
| 29 | 29 | <?php |
| 30 | - } |
|
| 31 | - if ( lsx_health_plan_has_meal() ) { |
|
| 32 | - $meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', false ); |
|
| 33 | - if ( false === $meal ) { |
|
| 34 | - $meal = 'meal'; |
|
| 35 | - } |
|
| 36 | - ?> |
|
| 30 | + } |
|
| 31 | + if ( lsx_health_plan_has_meal() ) { |
|
| 32 | + $meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', false ); |
|
| 33 | + if ( false === $meal ) { |
|
| 34 | + $meal = 'meal'; |
|
| 35 | + } |
|
| 36 | + ?> |
|
| 37 | 37 | <li class="<?php lsx_health_plan_nav_class( 'meal' ); ?>"><a class="meal-plan-tab" href="<?php the_permalink(); ?><?php echo esc_attr( $meal ); ?>/"><?php lsx_get_svg_icon( 'meal.svg' ); ?> <?php esc_html_e( 'Meal Plan', 'lsx-health-plan' ); ?></a></li> |
| 38 | 38 | <?php |
| 39 | - } |
|
| 40 | - if ( lsx_health_plan_has_recipe() ) { |
|
| 41 | - $recipe = \lsx_health_plan\functions\get_option( 'endpoint_recipe', false ); |
|
| 42 | - if ( false === $recipe ) { |
|
| 43 | - $recipe = 'recipes'; |
|
| 44 | - } |
|
| 45 | - ?> |
|
| 39 | + } |
|
| 40 | + if ( lsx_health_plan_has_recipe() ) { |
|
| 41 | + $recipe = \lsx_health_plan\functions\get_option( 'endpoint_recipe', false ); |
|
| 42 | + if ( false === $recipe ) { |
|
| 43 | + $recipe = 'recipes'; |
|
| 44 | + } |
|
| 45 | + ?> |
|
| 46 | 46 | <li class="<?php lsx_health_plan_nav_class( 'recipes' ); ?>"><a class="recipes-tab" href="<?php the_permalink(); ?><?php echo esc_attr( $recipe ); ?>/"><?php lsx_get_svg_icon( 'recipes.svg' ); ?> <?php esc_html_e( 'Recipes', 'lsx-health-plan' ); ?></a></li> |
| 47 | 47 | <?php |
| 48 | - } |
|
| 49 | - ?> |
|
| 48 | + } |
|
| 49 | + ?> |
|
| 50 | 50 | </ul> |
| 51 | 51 | </div> |
@@ -13,13 +13,13 @@ discard block |
||
| 13 | 13 | * @return string |
| 14 | 14 | */ |
| 15 | 15 | function restricted_content() { |
| 16 | - $content = ''; |
|
| 17 | - if ( ! is_user_logged_in() ) { |
|
| 18 | - ob_start(); |
|
| 19 | - echo do_shortcode( '[woocommerce_my_account]' ); |
|
| 20 | - $content = ob_get_clean(); |
|
| 21 | - } |
|
| 22 | - return $content; |
|
| 16 | + $content = ''; |
|
| 17 | + if ( ! is_user_logged_in() ) { |
|
| 18 | + ob_start(); |
|
| 19 | + echo do_shortcode( '[woocommerce_my_account]' ); |
|
| 20 | + $content = ob_get_clean(); |
|
| 21 | + } |
|
| 22 | + return $content; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -28,10 +28,10 @@ discard block |
||
| 28 | 28 | * @return void |
| 29 | 29 | */ |
| 30 | 30 | function my_profile_tabs() { |
| 31 | - ob_start(); |
|
| 32 | - echo lsx_health_plan_my_profile_tabs(); // WPCS: XSS OK. |
|
| 33 | - $content = ob_get_clean(); |
|
| 34 | - return $content; |
|
| 31 | + ob_start(); |
|
| 32 | + echo lsx_health_plan_my_profile_tabs(); // WPCS: XSS OK. |
|
| 33 | + $content = ob_get_clean(); |
|
| 34 | + return $content; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -40,10 +40,10 @@ discard block |
||
| 40 | 40 | * @return void |
| 41 | 41 | */ |
| 42 | 42 | function my_profile_box() { |
| 43 | - ob_start(); |
|
| 44 | - echo lsx_health_plan_my_profile_box(); // WPCS: XSS OK. |
|
| 45 | - $content = ob_get_clean(); |
|
| 46 | - return $content; |
|
| 43 | + ob_start(); |
|
| 44 | + echo lsx_health_plan_my_profile_box(); // WPCS: XSS OK. |
|
| 45 | + $content = ob_get_clean(); |
|
| 46 | + return $content; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -52,19 +52,19 @@ discard block |
||
| 52 | 52 | * @return void |
| 53 | 53 | */ |
| 54 | 54 | function day_plan_box( $args = array() ) { |
| 55 | - $defaults = array( |
|
| 56 | - 'week_view' => false, |
|
| 57 | - 'show_downloads' => false, |
|
| 58 | - ); |
|
| 59 | - $args = wp_parse_args( $args, $defaults ); |
|
| 60 | - ob_start(); |
|
| 61 | - if ( false === $args['week_view'] ) { |
|
| 62 | - echo lsx_health_plan_day_plan_block(); // WPCS: XSS OK. |
|
| 63 | - } else { |
|
| 64 | - echo lsx_health_plan_week_plan_block( $args ); // WPCS: XSS OK. |
|
| 65 | - } |
|
| 66 | - $content = ob_get_clean(); |
|
| 67 | - return $content; |
|
| 55 | + $defaults = array( |
|
| 56 | + 'week_view' => false, |
|
| 57 | + 'show_downloads' => false, |
|
| 58 | + ); |
|
| 59 | + $args = wp_parse_args( $args, $defaults ); |
|
| 60 | + ob_start(); |
|
| 61 | + if ( false === $args['week_view'] ) { |
|
| 62 | + echo lsx_health_plan_day_plan_block(); // WPCS: XSS OK. |
|
| 63 | + } else { |
|
| 64 | + echo lsx_health_plan_week_plan_block( $args ); // WPCS: XSS OK. |
|
| 65 | + } |
|
| 66 | + $content = ob_get_clean(); |
|
| 67 | + return $content; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -74,29 +74,29 @@ discard block |
||
| 74 | 74 | * @return void |
| 75 | 75 | */ |
| 76 | 76 | function exercise_box( $args = array() ) { |
| 77 | - $defaults = array( |
|
| 78 | - 'include' => '', |
|
| 79 | - 'term' => '', |
|
| 80 | - 'taxonomy' => '', |
|
| 81 | - 'view_more' => false, |
|
| 82 | - 'columns' => 3, |
|
| 83 | - 'limit' => 4, |
|
| 84 | - 'post_type' => 'exercise', |
|
| 85 | - 'orderby' => 'date', |
|
| 86 | - 'order' => 'DESC', |
|
| 87 | - 'description' => 'none', |
|
| 88 | - 'link' => 'item', |
|
| 89 | - 'link_class' => 'btn border-btn', |
|
| 90 | - 'layout' => 'grid', |
|
| 91 | - 'image_size' => 'lsx-thumbnail-square', |
|
| 92 | - 'parent' => false, |
|
| 93 | - 'modal_content' => 'excerpt', |
|
| 94 | - ); |
|
| 95 | - $args = wp_parse_args( $args, $defaults ); |
|
| 96 | - ob_start(); |
|
| 97 | - echo lsx_health_plan_items( $args ); // WPCS: XSS OK. |
|
| 98 | - $content = ob_get_clean(); |
|
| 99 | - return $content; |
|
| 77 | + $defaults = array( |
|
| 78 | + 'include' => '', |
|
| 79 | + 'term' => '', |
|
| 80 | + 'taxonomy' => '', |
|
| 81 | + 'view_more' => false, |
|
| 82 | + 'columns' => 3, |
|
| 83 | + 'limit' => 4, |
|
| 84 | + 'post_type' => 'exercise', |
|
| 85 | + 'orderby' => 'date', |
|
| 86 | + 'order' => 'DESC', |
|
| 87 | + 'description' => 'none', |
|
| 88 | + 'link' => 'item', |
|
| 89 | + 'link_class' => 'btn border-btn', |
|
| 90 | + 'layout' => 'grid', |
|
| 91 | + 'image_size' => 'lsx-thumbnail-square', |
|
| 92 | + 'parent' => false, |
|
| 93 | + 'modal_content' => 'excerpt', |
|
| 94 | + ); |
|
| 95 | + $args = wp_parse_args( $args, $defaults ); |
|
| 96 | + ob_start(); |
|
| 97 | + echo lsx_health_plan_items( $args ); // WPCS: XSS OK. |
|
| 98 | + $content = ob_get_clean(); |
|
| 99 | + return $content; |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
@@ -105,13 +105,13 @@ discard block |
||
| 105 | 105 | * @return void |
| 106 | 106 | */ |
| 107 | 107 | function feature_video_box() { |
| 108 | - ob_start(); |
|
| 109 | - echo lsx_health_plan_featured_video_block(); // WPCS: XSS OK. |
|
| 110 | - $content = ob_get_clean(); |
|
| 108 | + ob_start(); |
|
| 109 | + echo lsx_health_plan_featured_video_block(); // WPCS: XSS OK. |
|
| 110 | + $content = ob_get_clean(); |
|
| 111 | 111 | |
| 112 | - wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true ); |
|
| 113 | - wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true ); |
|
| 114 | - return $content; |
|
| 112 | + wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true ); |
|
| 113 | + wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true ); |
|
| 114 | + return $content; |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
@@ -120,12 +120,12 @@ discard block |
||
| 120 | 120 | * @return void |
| 121 | 121 | */ |
| 122 | 122 | function feature_recipes_box() { |
| 123 | - ob_start(); |
|
| 124 | - echo lsx_health_plan_featured_recipes_block(); // WPCS: XSS OK. |
|
| 125 | - $content = ob_get_clean(); |
|
| 126 | - wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true ); |
|
| 127 | - wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true ); |
|
| 128 | - return $content; |
|
| 123 | + ob_start(); |
|
| 124 | + echo lsx_health_plan_featured_recipes_block(); // WPCS: XSS OK. |
|
| 125 | + $content = ob_get_clean(); |
|
| 126 | + wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true ); |
|
| 127 | + wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true ); |
|
| 128 | + return $content; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
@@ -134,12 +134,12 @@ discard block |
||
| 134 | 134 | * @return void |
| 135 | 135 | */ |
| 136 | 136 | function feature_tips_box() { |
| 137 | - ob_start(); |
|
| 138 | - echo lsx_health_plan_featured_tips_block(); // WPCS: XSS OK. |
|
| 139 | - $content = ob_get_clean(); |
|
| 140 | - wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true ); |
|
| 141 | - wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true ); |
|
| 142 | - return $content; |
|
| 137 | + ob_start(); |
|
| 138 | + echo lsx_health_plan_featured_tips_block(); // WPCS: XSS OK. |
|
| 139 | + $content = ob_get_clean(); |
|
| 140 | + wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true ); |
|
| 141 | + wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true ); |
|
| 142 | + return $content; |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /** |
@@ -148,9 +148,9 @@ discard block |
||
| 148 | 148 | * @return string |
| 149 | 149 | */ |
| 150 | 150 | function account_notices() { |
| 151 | - $content = ''; |
|
| 152 | - if ( function_exists( 'wc_print_notices' ) ) { |
|
| 153 | - $content = wc_print_notices( true ); |
|
| 154 | - } |
|
| 155 | - return $content; |
|
| 151 | + $content = ''; |
|
| 152 | + if ( function_exists( 'wc_print_notices' ) ) { |
|
| 153 | + $content = wc_print_notices( true ); |
|
| 154 | + } |
|
| 155 | + return $content; |
|
| 156 | 156 | } |
@@ -11,25 +11,25 @@ discard block |
||
| 11 | 11 | * @return void |
| 12 | 12 | */ |
| 13 | 13 | function lsx_health_plan_warmup_box() { |
| 14 | - ?> |
|
| 14 | + ?> |
|
| 15 | 15 | <div class="col-md-4" > |
| 16 | 16 | <div class="lsx-health-plan-box"> |
| 17 | 17 | <h3 class="title warm-up-title title-lined"><?php esc_html_e( 'Your Warm-up', 'lsx-health-plan' ); ?><?php lsx_get_svg_icon( 'warm.svg' ); ?></h3> |
| 18 | 18 | <div class="spacer"></div> |
| 19 | 19 | <?php |
| 20 | - $intro_text = \lsx_health_plan\functions\get_option( 'warmup_intro', false ); |
|
| 21 | - if ( false !== $intro_text ) { |
|
| 22 | - ?> |
|
| 20 | + $intro_text = \lsx_health_plan\functions\get_option( 'warmup_intro', false ); |
|
| 21 | + if ( false !== $intro_text ) { |
|
| 22 | + ?> |
|
| 23 | 23 | <div class="excerpt"> |
| 24 | 24 | <p><?php echo wp_kses_post( $intro_text ); ?></p> |
| 25 | 25 | </div> |
| 26 | 26 | <?php |
| 27 | - } |
|
| 28 | - $warm_up = \lsx_health_plan\functions\get_option( 'endpoint_warm_up', false ); |
|
| 29 | - if ( false === $warm_up ) { |
|
| 30 | - $warm_up = 'warm-up'; |
|
| 31 | - } |
|
| 32 | - ?> |
|
| 27 | + } |
|
| 28 | + $warm_up = \lsx_health_plan\functions\get_option( 'endpoint_warm_up', false ); |
|
| 29 | + if ( false === $warm_up ) { |
|
| 30 | + $warm_up = 'warm-up'; |
|
| 31 | + } |
|
| 32 | + ?> |
|
| 33 | 33 | <a href="<?php the_permalink(); ?><?php echo esc_attr( $warm_up ); ?>/" class="btn"><?php esc_html_e( 'Start your warm-up', 'lsx-health-plan' ); ?></a> |
| 34 | 34 | </div> |
| 35 | 35 | </div> |
@@ -42,28 +42,28 @@ discard block |
||
| 42 | 42 | * @return void |
| 43 | 43 | */ |
| 44 | 44 | function lsx_health_plan_workout_box() { |
| 45 | - if ( ! post_type_exists( 'workout' ) ) { |
|
| 46 | - return; |
|
| 47 | - } |
|
| 48 | - ?> |
|
| 45 | + if ( ! post_type_exists( 'workout' ) ) { |
|
| 46 | + return; |
|
| 47 | + } |
|
| 48 | + ?> |
|
| 49 | 49 | <div class="col-md-4" > |
| 50 | 50 | <div class="lsx-health-plan-box"> |
| 51 | 51 | <h3 class="title work-out-title title-lined"><?php esc_html_e( 'Your Workout', 'lsx-health-plan' ); ?><?php lsx_get_svg_icon( 'work.svg' ); ?></h3> |
| 52 | 52 | <div class="spacer"></div> |
| 53 | 53 | <?php |
| 54 | - $intro_text = \lsx_health_plan\functions\get_option( 'workout_intro', false ); |
|
| 55 | - if ( false !== $intro_text ) { |
|
| 56 | - ?> |
|
| 54 | + $intro_text = \lsx_health_plan\functions\get_option( 'workout_intro', false ); |
|
| 55 | + if ( false !== $intro_text ) { |
|
| 56 | + ?> |
|
| 57 | 57 | <div class="excerpt"> |
| 58 | 58 | <p><?php echo wp_kses_post( $intro_text ); ?></p> |
| 59 | 59 | </div> |
| 60 | 60 | <?php |
| 61 | - } |
|
| 62 | - $workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', false ); |
|
| 63 | - if ( false === $workout ) { |
|
| 64 | - $workout = 'workout'; |
|
| 65 | - } |
|
| 66 | - ?> |
|
| 61 | + } |
|
| 62 | + $workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', false ); |
|
| 63 | + if ( false === $workout ) { |
|
| 64 | + $workout = 'workout'; |
|
| 65 | + } |
|
| 66 | + ?> |
|
| 67 | 67 | <a href="<?php the_permalink(); ?><?php echo esc_attr( $workout ); ?>/" class="btn"><?php esc_html_e( 'Start your workout', 'lsx-health-plan' ); ?></a> |
| 68 | 68 | </div> |
| 69 | 69 | </div> |
@@ -76,28 +76,28 @@ discard block |
||
| 76 | 76 | * @return void |
| 77 | 77 | */ |
| 78 | 78 | function lsx_health_plan_meal_box() { |
| 79 | - if ( ! post_type_exists( 'meal' ) ) { |
|
| 80 | - return; |
|
| 81 | - } |
|
| 82 | - ?> |
|
| 79 | + if ( ! post_type_exists( 'meal' ) ) { |
|
| 80 | + return; |
|
| 81 | + } |
|
| 82 | + ?> |
|
| 83 | 83 | <div class="col-md-4" > |
| 84 | 84 | <div class="lsx-health-plan-box"> |
| 85 | 85 | <h3 class="title meal-plan-title title-lined"><?php esc_html_e( 'Your Meal Plan', 'lsx-health-plan' ); ?><?php lsx_get_svg_icon( 'meal.svg' ); ?></h3> |
| 86 | 86 | <div class="spacer"></div> |
| 87 | 87 | <?php |
| 88 | - $intro_text = \lsx_health_plan\functions\get_option( 'meal_plan_intro', false ); |
|
| 89 | - if ( false !== $intro_text ) { |
|
| 90 | - ?> |
|
| 88 | + $intro_text = \lsx_health_plan\functions\get_option( 'meal_plan_intro', false ); |
|
| 89 | + if ( false !== $intro_text ) { |
|
| 90 | + ?> |
|
| 91 | 91 | <div class="excerpt"> |
| 92 | 92 | <p><?php echo wp_kses_post( $intro_text ); ?></p> |
| 93 | 93 | </div> |
| 94 | 94 | <?php |
| 95 | - } |
|
| 96 | - $meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', false ); |
|
| 97 | - if ( false === $meal ) { |
|
| 98 | - $meal = 'meal'; |
|
| 99 | - } |
|
| 100 | - ?> |
|
| 95 | + } |
|
| 96 | + $meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', false ); |
|
| 97 | + if ( false === $meal ) { |
|
| 98 | + $meal = 'meal'; |
|
| 99 | + } |
|
| 100 | + ?> |
|
| 101 | 101 | <a href="<?php the_permalink(); ?><?php echo esc_attr( $meal ); ?>/" class="btn"><?php esc_html_e( 'View your meal plan', 'lsx-health-plan' ); ?></a> |
| 102 | 102 | </div> |
| 103 | 103 | </div> |
@@ -110,28 +110,28 @@ discard block |
||
| 110 | 110 | * @return void |
| 111 | 111 | */ |
| 112 | 112 | function lsx_health_plan_recipe_box() { |
| 113 | - if ( ! post_type_exists( 'recipe' ) ) { |
|
| 114 | - return; |
|
| 115 | - } |
|
| 116 | - ?> |
|
| 113 | + if ( ! post_type_exists( 'recipe' ) ) { |
|
| 114 | + return; |
|
| 115 | + } |
|
| 116 | + ?> |
|
| 117 | 117 | <div class="col-md-4" > |
| 118 | 118 | <div class="lsx-health-plan-box"> |
| 119 | 119 | <h3 class="title recipes-title title-lined"><?php esc_html_e( 'Recipes', 'lsx-health-plan' ); ?><?php lsx_get_svg_icon( 'recipes.svg' ); ?></h3> |
| 120 | 120 | <div class="spacer"></div> |
| 121 | 121 | <?php |
| 122 | - $intro_text = \lsx_health_plan\functions\get_option( 'recipes_intro', false ); |
|
| 123 | - if ( false !== $intro_text ) { |
|
| 124 | - ?> |
|
| 122 | + $intro_text = \lsx_health_plan\functions\get_option( 'recipes_intro', false ); |
|
| 123 | + if ( false !== $intro_text ) { |
|
| 124 | + ?> |
|
| 125 | 125 | <div class="excerpt"> |
| 126 | 126 | <p><?php echo wp_kses_post( $intro_text ); ?></p> |
| 127 | 127 | </div> |
| 128 | 128 | <?php |
| 129 | - } |
|
| 130 | - $recipes = \lsx_health_plan\functions\get_option( 'endpoint_recipe', false ); |
|
| 131 | - if ( false === $recipes ) { |
|
| 132 | - $recipes = 'recipes'; |
|
| 133 | - } |
|
| 134 | - ?> |
|
| 129 | + } |
|
| 130 | + $recipes = \lsx_health_plan\functions\get_option( 'endpoint_recipe', false ); |
|
| 131 | + if ( false === $recipes ) { |
|
| 132 | + $recipes = 'recipes'; |
|
| 133 | + } |
|
| 134 | + ?> |
|
| 135 | 135 | <a href="<?php the_permalink(); ?><?php echo esc_attr( $recipes ); ?>/" class="btn"><?php esc_html_e( 'View all recipes', 'lsx-health-plan' ); ?></a> |
| 136 | 136 | </div> |
| 137 | 137 | </div> |
@@ -144,8 +144,8 @@ discard block |
||
| 144 | 144 | * @return void |
| 145 | 145 | */ |
| 146 | 146 | function lsx_health_plan_downloads_box() { |
| 147 | - global $current_user; |
|
| 148 | - ?> |
|
| 147 | + global $current_user; |
|
| 148 | + ?> |
|
| 149 | 149 | <div class="col-md-4 day-download-box" > |
| 150 | 150 | <div class="lsx-health-plan-box"> |
| 151 | 151 | <h3 class="title downloads-title title-lined"><?php esc_html_e( 'Downloads', 'lsx-health-plan' ); ?><?php lsx_get_svg_icon( 'download.svg' ); ?></h3> |
@@ -153,13 +153,13 @@ discard block |
||
| 153 | 153 | <div class="download-list"> |
| 154 | 154 | <ul> |
| 155 | 155 | <?php |
| 156 | - $downloads = \lsx_health_plan\functions\get_downloads(); |
|
| 157 | - if ( ! empty( $downloads ) ) { |
|
| 158 | - foreach ( $downloads as $download ) { |
|
| 159 | - echo wp_kses_post( '<li><a href=""><i class="fa fa-file-pdf"></i>' . do_shortcode( '[download id="' . $download . '"]' ) . '</a></li>' ); |
|
| 160 | - } |
|
| 161 | - } |
|
| 162 | - ?> |
|
| 156 | + $downloads = \lsx_health_plan\functions\get_downloads(); |
|
| 157 | + if ( ! empty( $downloads ) ) { |
|
| 158 | + foreach ( $downloads as $download ) { |
|
| 159 | + echo wp_kses_post( '<li><a href=""><i class="fa fa-file-pdf"></i>' . do_shortcode( '[download id="' . $download . '"]' ) . '</a></li>' ); |
|
| 160 | + } |
|
| 161 | + } |
|
| 162 | + ?> |
|
| 163 | 163 | </ul> |
| 164 | 164 | </div> |
| 165 | 165 | </div> |
@@ -174,15 +174,15 @@ discard block |
||
| 174 | 174 | * @return void |
| 175 | 175 | */ |
| 176 | 176 | function lsx_health_plan_nav_class( $tab = '' ) { |
| 177 | - $nav_classes = array(); |
|
| 178 | - if ( function_exists( 'is_wc_endpoint_url' ) && 'edit-account' === $tab && is_wc_endpoint_url( 'edit-account' ) ) { |
|
| 179 | - $nav_classes[] = 'active'; |
|
| 180 | - } elseif ( lsx_health_plan_is_current_tab( $tab ) ) { |
|
| 181 | - $nav_classes[] = 'active'; |
|
| 182 | - } |
|
| 183 | - if ( ! empty( $nav_classes ) ) { |
|
| 184 | - echo wp_kses_post( implode( ' ', $nav_classes ) ); |
|
| 185 | - } |
|
| 177 | + $nav_classes = array(); |
|
| 178 | + if ( function_exists( 'is_wc_endpoint_url' ) && 'edit-account' === $tab && is_wc_endpoint_url( 'edit-account' ) ) { |
|
| 179 | + $nav_classes[] = 'active'; |
|
| 180 | + } elseif ( lsx_health_plan_is_current_tab( $tab ) ) { |
|
| 181 | + $nav_classes[] = 'active'; |
|
| 182 | + } |
|
| 183 | + if ( ! empty( $nav_classes ) ) { |
|
| 184 | + echo wp_kses_post( implode( ' ', $nav_classes ) ); |
|
| 185 | + } |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | /** |
@@ -191,22 +191,22 @@ discard block |
||
| 191 | 191 | * @return void |
| 192 | 192 | */ |
| 193 | 193 | function lsx_health_plan_my_profile_tabs() { |
| 194 | - ?> |
|
| 194 | + ?> |
|
| 195 | 195 | <div id="account-nav"> |
| 196 | 196 | <ul class="nav nav-pills"> |
| 197 | 197 | <li class=" |
| 198 | 198 | <?php |
| 199 | - if ( ( function_exists( 'is_wc_endpoint_url' ) && ! is_wc_endpoint_url( 'edit-account' ) ) || ! function_exists( 'is_wc_endpoint_url' ) ) { |
|
| 200 | - echo esc_attr( 'active' ); |
|
| 201 | - } |
|
| 202 | - ?> |
|
| 199 | + if ( ( function_exists( 'is_wc_endpoint_url' ) && ! is_wc_endpoint_url( 'edit-account' ) ) || ! function_exists( 'is_wc_endpoint_url' ) ) { |
|
| 200 | + echo esc_attr( 'active' ); |
|
| 201 | + } |
|
| 202 | + ?> |
|
| 203 | 203 | "><a class="my-plan-tab" href="<?php the_permalink(); ?>"><?php esc_html_e( 'My Plan', 'lsx-health-plan' ); ?></a></li> |
| 204 | 204 | <li class=" |
| 205 | 205 | <?php |
| 206 | - if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'edit-account' ) ) { |
|
| 207 | - echo esc_attr( 'active' ); |
|
| 208 | - } |
|
| 209 | - ?> |
|
| 206 | + if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'edit-account' ) ) { |
|
| 207 | + echo esc_attr( 'active' ); |
|
| 208 | + } |
|
| 209 | + ?> |
|
| 210 | 210 | "><a class="account-details-tab" href="<?php the_permalink(); ?>edit-account/"><?php esc_html_e( 'Account Details', 'lsx-health-plan' ); ?></a></li> |
| 211 | 211 | <li class=""><a class="logout-tab" href="<?php echo esc_url( wp_logout_url( get_permalink() ) ); ?>"><?php esc_html_e( 'Logout', 'lsx-health-plan' ); ?></a></li> |
| 212 | 212 | </ul> |
@@ -220,24 +220,24 @@ discard block |
||
| 220 | 220 | * @return void |
| 221 | 221 | */ |
| 222 | 222 | function lsx_health_plan_my_profile_box() { |
| 223 | - ?> |
|
| 223 | + ?> |
|
| 224 | 224 | <div class="lsx-health-plan my-profile-block"> |
| 225 | 225 | <div class="profile-navigation"> |
| 226 | 226 | <div class="profile-photo"> |
| 227 | 227 | <?php |
| 228 | - global $current_user; |
|
| 229 | - get_current_user(); |
|
| 230 | - echo get_avatar( $current_user->ID, 240 ); |
|
| 231 | - ?> |
|
| 228 | + global $current_user; |
|
| 229 | + get_current_user(); |
|
| 230 | + echo get_avatar( $current_user->ID, 240 ); |
|
| 231 | + ?> |
|
| 232 | 232 | </div> |
| 233 | 233 | <div class="edit-profile"> |
| 234 | 234 | <?php |
| 235 | - if ( function_exists( 'wc_get_page_id' ) ) { |
|
| 236 | - $url_id = wc_get_page_id( 'myaccount' ); |
|
| 237 | - } else { |
|
| 238 | - $url_id = ''; |
|
| 239 | - } |
|
| 240 | - ?> |
|
| 235 | + if ( function_exists( 'wc_get_page_id' ) ) { |
|
| 236 | + $url_id = wc_get_page_id( 'myaccount' ); |
|
| 237 | + } else { |
|
| 238 | + $url_id = ''; |
|
| 239 | + } |
|
| 240 | + ?> |
|
| 241 | 241 | <a class="btn btn-green" href="<?php echo esc_url( get_permalink( $url_id ) ); ?>edit-account/"><?php esc_html_e( 'Edit Profile', 'lsx-health-plan' ); ?></a> |
| 242 | 242 | </div> |
| 243 | 243 | </div> |
@@ -245,13 +245,13 @@ discard block |
||
| 245 | 245 | <div class="profile-details"> |
| 246 | 246 | <h1 class="title-lined"><?php echo esc_html( $current_user->display_name ); ?></h1> |
| 247 | 247 | <?php |
| 248 | - $disable_stats = \lsx_health_plan\functions\get_option( 'disable_all_stats', false ); |
|
| 249 | - if ( 'on' !== $disable_stats ) { |
|
| 248 | + $disable_stats = \lsx_health_plan\functions\get_option( 'disable_all_stats', false ); |
|
| 249 | + if ( 'on' !== $disable_stats ) { |
|
| 250 | 250 | |
| 251 | - $is_weight_disabled = \lsx_health_plan\functions\get_option( 'disable_weight_checkbox', false ); |
|
| 252 | - $is_waist_disabled = \lsx_health_plan\functions\get_option( 'disable_waist_checkbox', false ); |
|
| 253 | - $is_fitness_disabled = \lsx_health_plan\functions\get_option( 'disable_fitness_checkbox', false ); |
|
| 254 | - ?> |
|
| 251 | + $is_weight_disabled = \lsx_health_plan\functions\get_option( 'disable_weight_checkbox', false ); |
|
| 252 | + $is_waist_disabled = \lsx_health_plan\functions\get_option( 'disable_waist_checkbox', false ); |
|
| 253 | + $is_fitness_disabled = \lsx_health_plan\functions\get_option( 'disable_fitness_checkbox', false ); |
|
| 254 | + ?> |
|
| 255 | 255 | <table class="table personal-information"> |
| 256 | 256 | <thead> |
| 257 | 257 | <tr> |
@@ -267,30 +267,30 @@ discard block |
||
| 267 | 267 | <th scope="row"><strong><?php esc_html_e( 'Weight:', 'lsx-health-plan' ); ?></strong></th> |
| 268 | 268 | <td> |
| 269 | 269 | <?php |
| 270 | - if ( '' !== get_user_meta( get_current_user_id(), 'weight_start', true ) ) { |
|
| 271 | - echo wp_kses_post( get_user_meta( get_current_user_id(), 'weight_start', true ) . ' kg' ); |
|
| 272 | - } else { |
|
| 273 | - echo '/'; |
|
| 274 | - } |
|
| 275 | - ?> |
|
| 270 | + if ( '' !== get_user_meta( get_current_user_id(), 'weight_start', true ) ) { |
|
| 271 | + echo wp_kses_post( get_user_meta( get_current_user_id(), 'weight_start', true ) . ' kg' ); |
|
| 272 | + } else { |
|
| 273 | + echo '/'; |
|
| 274 | + } |
|
| 275 | + ?> |
|
| 276 | 276 | </td> |
| 277 | 277 | <td> |
| 278 | 278 | <?php |
| 279 | - if ( '' !== get_user_meta( get_current_user_id(), 'weight_goal', true ) ) { |
|
| 280 | - echo wp_kses_post( get_user_meta( get_current_user_id(), 'weight_goal', true ) . ' kg' ); |
|
| 281 | - } else { |
|
| 282 | - echo '/'; |
|
| 283 | - } |
|
| 284 | - ?> |
|
| 279 | + if ( '' !== get_user_meta( get_current_user_id(), 'weight_goal', true ) ) { |
|
| 280 | + echo wp_kses_post( get_user_meta( get_current_user_id(), 'weight_goal', true ) . ' kg' ); |
|
| 281 | + } else { |
|
| 282 | + echo '/'; |
|
| 283 | + } |
|
| 284 | + ?> |
|
| 285 | 285 | </td> |
| 286 | 286 | <td> |
| 287 | 287 | <?php |
| 288 | - if ( '' !== get_user_meta( get_current_user_id(), 'weight_end', true ) ) { |
|
| 289 | - echo wp_kses_post( get_user_meta( get_current_user_id(), 'weight_end', true ) . ' kg' ); |
|
| 290 | - } else { |
|
| 291 | - echo '/'; |
|
| 292 | - } |
|
| 293 | - ?> |
|
| 288 | + if ( '' !== get_user_meta( get_current_user_id(), 'weight_end', true ) ) { |
|
| 289 | + echo wp_kses_post( get_user_meta( get_current_user_id(), 'weight_end', true ) . ' kg' ); |
|
| 290 | + } else { |
|
| 291 | + echo '/'; |
|
| 292 | + } |
|
| 293 | + ?> |
|
| 294 | 294 | </td> |
| 295 | 295 | </tr> |
| 296 | 296 | <?php } ?> |
@@ -299,30 +299,30 @@ discard block |
||
| 299 | 299 | <th scope="row"><strong><?php esc_html_e( 'Waist:', 'lsx-health-plan' ); ?></strong></th> |
| 300 | 300 | <td> |
| 301 | 301 | <?php |
| 302 | - if ( '' !== get_user_meta( get_current_user_id(), 'waist_start', true ) ) { |
|
| 303 | - echo wp_kses_post( get_user_meta( get_current_user_id(), 'waist_start', true ) . ' cm' ); |
|
| 304 | - } else { |
|
| 305 | - echo '/'; |
|
| 306 | - } |
|
| 307 | - ?> |
|
| 302 | + if ( '' !== get_user_meta( get_current_user_id(), 'waist_start', true ) ) { |
|
| 303 | + echo wp_kses_post( get_user_meta( get_current_user_id(), 'waist_start', true ) . ' cm' ); |
|
| 304 | + } else { |
|
| 305 | + echo '/'; |
|
| 306 | + } |
|
| 307 | + ?> |
|
| 308 | 308 | </td> |
| 309 | 309 | <td> |
| 310 | 310 | <?php |
| 311 | - if ( '' !== get_user_meta( get_current_user_id(), 'waist_goal', true ) ) { |
|
| 312 | - echo wp_kses_post( get_user_meta( get_current_user_id(), 'waist_goal', true ) . ' cm' ); |
|
| 313 | - } else { |
|
| 314 | - echo '/'; |
|
| 315 | - } |
|
| 316 | - ?> |
|
| 311 | + if ( '' !== get_user_meta( get_current_user_id(), 'waist_goal', true ) ) { |
|
| 312 | + echo wp_kses_post( get_user_meta( get_current_user_id(), 'waist_goal', true ) . ' cm' ); |
|
| 313 | + } else { |
|
| 314 | + echo '/'; |
|
| 315 | + } |
|
| 316 | + ?> |
|
| 317 | 317 | </td> |
| 318 | 318 | <td> |
| 319 | 319 | <?php |
| 320 | - if ( '' !== get_user_meta( get_current_user_id(), 'waist_end', true ) ) { |
|
| 321 | - echo wp_kses_post( get_user_meta( get_current_user_id(), 'waist_end', true ) . ' cm' ); |
|
| 322 | - } else { |
|
| 323 | - echo '/'; |
|
| 324 | - } |
|
| 325 | - ?> |
|
| 320 | + if ( '' !== get_user_meta( get_current_user_id(), 'waist_end', true ) ) { |
|
| 321 | + echo wp_kses_post( get_user_meta( get_current_user_id(), 'waist_end', true ) . ' cm' ); |
|
| 322 | + } else { |
|
| 323 | + echo '/'; |
|
| 324 | + } |
|
| 325 | + ?> |
|
| 326 | 326 | </td> |
| 327 | 327 | </tr> |
| 328 | 328 | <?php } ?> |
@@ -331,38 +331,38 @@ discard block |
||
| 331 | 331 | <th scope="row"><strong><?php esc_html_e( 'Fitness:', 'lsx-health-plan' ); ?></strong></th> |
| 332 | 332 | <td> |
| 333 | 333 | <?php |
| 334 | - if ( '' !== get_user_meta( get_current_user_id(), 'fitness_start', true ) ) { |
|
| 335 | - echo wp_kses_post( get_user_meta( get_current_user_id(), 'fitness_start', true ) ); |
|
| 336 | - } else { |
|
| 337 | - echo '/'; |
|
| 338 | - } |
|
| 339 | - ?> |
|
| 334 | + if ( '' !== get_user_meta( get_current_user_id(), 'fitness_start', true ) ) { |
|
| 335 | + echo wp_kses_post( get_user_meta( get_current_user_id(), 'fitness_start', true ) ); |
|
| 336 | + } else { |
|
| 337 | + echo '/'; |
|
| 338 | + } |
|
| 339 | + ?> |
|
| 340 | 340 | </td> |
| 341 | 341 | <td> |
| 342 | 342 | <?php |
| 343 | - if ( '' !== get_user_meta( get_current_user_id(), 'fitness_goal', true ) ) { |
|
| 344 | - echo wp_kses_post( get_user_meta( get_current_user_id(), 'fitness_goal', true ) ); |
|
| 345 | - } else { |
|
| 346 | - echo '/'; |
|
| 347 | - } |
|
| 348 | - ?> |
|
| 343 | + if ( '' !== get_user_meta( get_current_user_id(), 'fitness_goal', true ) ) { |
|
| 344 | + echo wp_kses_post( get_user_meta( get_current_user_id(), 'fitness_goal', true ) ); |
|
| 345 | + } else { |
|
| 346 | + echo '/'; |
|
| 347 | + } |
|
| 348 | + ?> |
|
| 349 | 349 | </td> |
| 350 | 350 | <td> |
| 351 | 351 | <?php |
| 352 | - if ( '' !== get_user_meta( get_current_user_id(), 'fitness_end', true ) ) { |
|
| 353 | - echo wp_kses_post( get_user_meta( get_current_user_id(), 'fitness_end', true ) ); |
|
| 354 | - } else { |
|
| 355 | - echo '/'; |
|
| 356 | - } |
|
| 357 | - ?> |
|
| 352 | + if ( '' !== get_user_meta( get_current_user_id(), 'fitness_end', true ) ) { |
|
| 353 | + echo wp_kses_post( get_user_meta( get_current_user_id(), 'fitness_end', true ) ); |
|
| 354 | + } else { |
|
| 355 | + echo '/'; |
|
| 356 | + } |
|
| 357 | + ?> |
|
| 358 | 358 | </td> |
| 359 | 359 | </tr> |
| 360 | 360 | <?php } ?> |
| 361 | 361 | </tbody> |
| 362 | 362 | </table> |
| 363 | 363 | <?php |
| 364 | - } |
|
| 365 | - ?> |
|
| 364 | + } |
|
| 365 | + ?> |
|
| 366 | 366 | </div> |
| 367 | 367 | </div> |
| 368 | 368 | <?php |
@@ -374,25 +374,25 @@ discard block |
||
| 374 | 374 | * @return void |
| 375 | 375 | */ |
| 376 | 376 | function lsx_health_plan_day_plan_block() { |
| 377 | - $args = array( |
|
| 378 | - 'orderby' => 'menu_order', |
|
| 379 | - 'order' => 'ASC', |
|
| 380 | - 'post_type' => 'plan', |
|
| 381 | - 'posts_per_page' => -1, |
|
| 382 | - 'nopagin' => true, |
|
| 383 | - ); |
|
| 384 | - $the_query = new WP_Query( $args ); |
|
| 385 | - ?> |
|
| 377 | + $args = array( |
|
| 378 | + 'orderby' => 'menu_order', |
|
| 379 | + 'order' => 'ASC', |
|
| 380 | + 'post_type' => 'plan', |
|
| 381 | + 'posts_per_page' => -1, |
|
| 382 | + 'nopagin' => true, |
|
| 383 | + ); |
|
| 384 | + $the_query = new WP_Query( $args ); |
|
| 385 | + ?> |
|
| 386 | 386 | <div class="daily-plan-block day-grid"> |
| 387 | 387 | <?php |
| 388 | - if ( $the_query->have_posts() ) : |
|
| 389 | - while ( $the_query->have_posts() ) : |
|
| 390 | - $the_query->the_post(); |
|
| 391 | - $completed_class = ''; |
|
| 392 | - if ( lsx_health_plan_is_day_complete() ) { |
|
| 393 | - $completed_class = 'completed'; |
|
| 394 | - } |
|
| 395 | - ?> |
|
| 388 | + if ( $the_query->have_posts() ) : |
|
| 389 | + while ( $the_query->have_posts() ) : |
|
| 390 | + $the_query->the_post(); |
|
| 391 | + $completed_class = ''; |
|
| 392 | + if ( lsx_health_plan_is_day_complete() ) { |
|
| 393 | + $completed_class = 'completed'; |
|
| 394 | + } |
|
| 395 | + ?> |
|
| 396 | 396 | <a href="<?php the_permalink(); ?>" class="day id-<?php the_ID(); ?> <?php echo esc_attr( $completed_class ); ?>"> |
| 397 | 397 | <div class="plan-content"><?php the_title(); ?></div> |
| 398 | 398 | </a> |
@@ -411,63 +411,63 @@ discard block |
||
| 411 | 411 | * @return void |
| 412 | 412 | */ |
| 413 | 413 | function lsx_health_plan_week_plan_block( $args = array() ) { |
| 414 | - $defaults = array( |
|
| 415 | - 'show_downloads' => false, |
|
| 416 | - ); |
|
| 417 | - $args = wp_parse_args( $args, $defaults ); |
|
| 418 | - $weeks = get_terms( |
|
| 419 | - array( |
|
| 420 | - 'taxonomy' => 'week', |
|
| 421 | - 'orderby' => 'menu_order', |
|
| 422 | - 'order' => 'ASC', |
|
| 423 | - ) |
|
| 424 | - ); |
|
| 425 | - if ( ! empty( $weeks ) ) { |
|
| 426 | - $counter = 1; |
|
| 427 | - $section_open = false; |
|
| 428 | - |
|
| 429 | - foreach ( $weeks as $week ) { |
|
| 430 | - // Grab the days of the week. |
|
| 431 | - $query_args = array( |
|
| 432 | - 'orderby' => 'menu_order', |
|
| 433 | - 'order' => 'ASC', |
|
| 434 | - 'post_type' => 'plan', |
|
| 435 | - 'posts_per_page' => -1, |
|
| 436 | - 'nopagin' => true, |
|
| 437 | - 'tax_query' => array( |
|
| 438 | - array( |
|
| 439 | - 'taxonomy' => 'week', |
|
| 440 | - 'field' => 'slug', |
|
| 441 | - 'terms' => array( $week->slug ), |
|
| 442 | - ), |
|
| 443 | - ), |
|
| 444 | - ); |
|
| 445 | - $the_query = new WP_Query( $query_args ); |
|
| 446 | - $collapse_class = ''; |
|
| 447 | - |
|
| 448 | - // Determine if the current week is complete. |
|
| 449 | - if ( $the_query->have_posts() ) { |
|
| 450 | - $day_ids = wp_list_pluck( $the_query->posts, 'ID' ); |
|
| 451 | - |
|
| 452 | - if ( false === $section_open ) { |
|
| 453 | - if ( 1 === $counter && ! \lsx_health_plan\functions\is_week_complete( false, $day_ids ) ) { |
|
| 454 | - $collapse_class = 'in'; |
|
| 455 | - $section_open = true; |
|
| 456 | - } elseif ( ! \lsx_health_plan\functions\is_week_complete( false, $day_ids ) ) { |
|
| 457 | - $collapse_class = 'in'; |
|
| 458 | - $section_open = true; |
|
| 459 | - } |
|
| 460 | - } |
|
| 461 | - } |
|
| 462 | - |
|
| 463 | - // Determine if there are any weekly downloads. |
|
| 464 | - if ( isset( $args['show_downloads'] ) && false !== $args['show_downloads'] ) { |
|
| 465 | - $weekly_downloads = \lsx_health_plan\functions\get_weekly_downloads( $week->slug ); |
|
| 466 | - if ( ! empty( $weekly_downloads ) ) { |
|
| 467 | - $week_downloads_view = 'week-downloads-view-on'; |
|
| 468 | - } |
|
| 469 | - } |
|
| 470 | - ?> |
|
| 414 | + $defaults = array( |
|
| 415 | + 'show_downloads' => false, |
|
| 416 | + ); |
|
| 417 | + $args = wp_parse_args( $args, $defaults ); |
|
| 418 | + $weeks = get_terms( |
|
| 419 | + array( |
|
| 420 | + 'taxonomy' => 'week', |
|
| 421 | + 'orderby' => 'menu_order', |
|
| 422 | + 'order' => 'ASC', |
|
| 423 | + ) |
|
| 424 | + ); |
|
| 425 | + if ( ! empty( $weeks ) ) { |
|
| 426 | + $counter = 1; |
|
| 427 | + $section_open = false; |
|
| 428 | + |
|
| 429 | + foreach ( $weeks as $week ) { |
|
| 430 | + // Grab the days of the week. |
|
| 431 | + $query_args = array( |
|
| 432 | + 'orderby' => 'menu_order', |
|
| 433 | + 'order' => 'ASC', |
|
| 434 | + 'post_type' => 'plan', |
|
| 435 | + 'posts_per_page' => -1, |
|
| 436 | + 'nopagin' => true, |
|
| 437 | + 'tax_query' => array( |
|
| 438 | + array( |
|
| 439 | + 'taxonomy' => 'week', |
|
| 440 | + 'field' => 'slug', |
|
| 441 | + 'terms' => array( $week->slug ), |
|
| 442 | + ), |
|
| 443 | + ), |
|
| 444 | + ); |
|
| 445 | + $the_query = new WP_Query( $query_args ); |
|
| 446 | + $collapse_class = ''; |
|
| 447 | + |
|
| 448 | + // Determine if the current week is complete. |
|
| 449 | + if ( $the_query->have_posts() ) { |
|
| 450 | + $day_ids = wp_list_pluck( $the_query->posts, 'ID' ); |
|
| 451 | + |
|
| 452 | + if ( false === $section_open ) { |
|
| 453 | + if ( 1 === $counter && ! \lsx_health_plan\functions\is_week_complete( false, $day_ids ) ) { |
|
| 454 | + $collapse_class = 'in'; |
|
| 455 | + $section_open = true; |
|
| 456 | + } elseif ( ! \lsx_health_plan\functions\is_week_complete( false, $day_ids ) ) { |
|
| 457 | + $collapse_class = 'in'; |
|
| 458 | + $section_open = true; |
|
| 459 | + } |
|
| 460 | + } |
|
| 461 | + } |
|
| 462 | + |
|
| 463 | + // Determine if there are any weekly downloads. |
|
| 464 | + if ( isset( $args['show_downloads'] ) && false !== $args['show_downloads'] ) { |
|
| 465 | + $weekly_downloads = \lsx_health_plan\functions\get_weekly_downloads( $week->slug ); |
|
| 466 | + if ( ! empty( $weekly_downloads ) ) { |
|
| 467 | + $week_downloads_view = 'week-downloads-view-on'; |
|
| 468 | + } |
|
| 469 | + } |
|
| 470 | + ?> |
|
| 471 | 471 | <div class="daily-plan-block week-grid"> |
| 472 | 472 | <a href="#week-<?php echo esc_attr( $week->slug ); ?>" data-toggle="collapse" class="week-title"><?php echo esc_attr( $week->name ); ?></a> |
| 473 | 473 | <div id="week-<?php echo esc_attr( $week->slug ); ?>" class="week-row collapse <?php echo esc_attr( $collapse_class ); ?>"> |
@@ -478,36 +478,36 @@ discard block |
||
| 478 | 478 | <?php } ?> |
| 479 | 479 | <div class="week-meals-recipes-box-inner"> |
| 480 | 480 | <?php |
| 481 | - if ( $the_query->have_posts() ) : |
|
| 482 | - while ( $the_query->have_posts() ) : |
|
| 483 | - $the_query->the_post(); |
|
| 484 | - $completed_class = ''; |
|
| 485 | - if ( lsx_health_plan_is_day_complete() ) { |
|
| 486 | - $completed_class = 'completed'; |
|
| 487 | - } |
|
| 488 | - ?> |
|
| 481 | + if ( $the_query->have_posts() ) : |
|
| 482 | + while ( $the_query->have_posts() ) : |
|
| 483 | + $the_query->the_post(); |
|
| 484 | + $completed_class = ''; |
|
| 485 | + if ( lsx_health_plan_is_day_complete() ) { |
|
| 486 | + $completed_class = 'completed'; |
|
| 487 | + } |
|
| 488 | + ?> |
|
| 489 | 489 | <a href="<?php the_permalink(); ?>" class="day id-<?php the_ID(); ?> <?php echo esc_attr( $completed_class ); ?>"> |
| 490 | 490 | <div class="plan-content"><?php the_title(); ?></div> |
| 491 | 491 | </a> |
| 492 | 492 | <?php |
| 493 | - endwhile; |
|
| 494 | - endif; |
|
| 495 | - wp_reset_postdata(); |
|
| 496 | - ?> |
|
| 493 | + endwhile; |
|
| 494 | + endif; |
|
| 495 | + wp_reset_postdata(); |
|
| 496 | + ?> |
|
| 497 | 497 | </div> |
| 498 | 498 | </div> |
| 499 | 499 | <?php |
| 500 | - if ( ! empty( $week_downloads_view ) ) { |
|
| 501 | - lsx_health_plan_weekly_downloads( $weekly_downloads ); |
|
| 502 | - } |
|
| 503 | - ?> |
|
| 500 | + if ( ! empty( $week_downloads_view ) ) { |
|
| 501 | + lsx_health_plan_weekly_downloads( $weekly_downloads ); |
|
| 502 | + } |
|
| 503 | + ?> |
|
| 504 | 504 | </div> |
| 505 | 505 | </div> |
| 506 | 506 | </div> |
| 507 | 507 | <?php |
| 508 | - ++$counter; |
|
| 509 | - } |
|
| 510 | - } |
|
| 508 | + ++$counter; |
|
| 509 | + } |
|
| 510 | + } |
|
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | /** |
@@ -517,22 +517,22 @@ discard block |
||
| 517 | 517 | * @return void |
| 518 | 518 | */ |
| 519 | 519 | function lsx_health_plan_weekly_downloads( $weekly_downloads = array() ) { |
| 520 | - if ( ! empty( $weekly_downloads ) ) { |
|
| 521 | - ?> |
|
| 520 | + if ( ! empty( $weekly_downloads ) ) { |
|
| 521 | + ?> |
|
| 522 | 522 | <div class="week-download-box"> |
| 523 | 523 | <h3 class="title"><?php lsx_get_svg_icon( 'download.svg' ); ?><?php echo esc_html_e( 'Downloads', 'lsx-health-plan' ); ?></h3> |
| 524 | 524 | <ul class="week-download-box-list"> |
| 525 | 525 | <?php |
| 526 | - foreach ( $weekly_downloads as $weekly_download ) { |
|
| 527 | - ?> |
|
| 526 | + foreach ( $weekly_downloads as $weekly_download ) { |
|
| 527 | + ?> |
|
| 528 | 528 | <li><?php echo wp_kses_post( do_shortcode( '[download id="' . $weekly_download . '"]' ) ); ?></li> |
| 529 | 529 | <?php |
| 530 | - } |
|
| 531 | - ?> |
|
| 530 | + } |
|
| 531 | + ?> |
|
| 532 | 532 | </ul> |
| 533 | 533 | </div> |
| 534 | 534 | <?php |
| 535 | - } |
|
| 535 | + } |
|
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | /** |
@@ -541,9 +541,9 @@ discard block |
||
| 541 | 541 | * @return void |
| 542 | 542 | */ |
| 543 | 543 | function lsx_health_plan_items( $args = array() ) { |
| 544 | - global $shortcode_args; |
|
| 545 | - $shortcode_args = $args; |
|
| 546 | - include LSX_HEALTH_PLAN_PATH . '/templates/partials/shortcode-loop.php'; |
|
| 544 | + global $shortcode_args; |
|
| 545 | + $shortcode_args = $args; |
|
| 546 | + include LSX_HEALTH_PLAN_PATH . '/templates/partials/shortcode-loop.php'; |
|
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | /** |
@@ -552,10 +552,10 @@ discard block |
||
| 552 | 552 | * @return void |
| 553 | 553 | */ |
| 554 | 554 | function lsx_health_plan_featured_video_block() { |
| 555 | - if ( ! post_type_exists( 'video' ) ) { |
|
| 556 | - return; |
|
| 557 | - } |
|
| 558 | - include LSX_HEALTH_PLAN_PATH . '/templates/featured-videos.php'; |
|
| 555 | + if ( ! post_type_exists( 'video' ) ) { |
|
| 556 | + return; |
|
| 557 | + } |
|
| 558 | + include LSX_HEALTH_PLAN_PATH . '/templates/featured-videos.php'; |
|
| 559 | 559 | } |
| 560 | 560 | |
| 561 | 561 | /** |
@@ -564,10 +564,10 @@ discard block |
||
| 564 | 564 | * @return void |
| 565 | 565 | */ |
| 566 | 566 | function lsx_health_plan_featured_recipes_block() { |
| 567 | - if ( ! post_type_exists( 'recipe' ) ) { |
|
| 568 | - return; |
|
| 569 | - } |
|
| 570 | - include LSX_HEALTH_PLAN_PATH . '/templates/featured-recipes.php'; |
|
| 567 | + if ( ! post_type_exists( 'recipe' ) ) { |
|
| 568 | + return; |
|
| 569 | + } |
|
| 570 | + include LSX_HEALTH_PLAN_PATH . '/templates/featured-recipes.php'; |
|
| 571 | 571 | } |
| 572 | 572 | |
| 573 | 573 | /** |
@@ -576,10 +576,10 @@ discard block |
||
| 576 | 576 | * @return void |
| 577 | 577 | */ |
| 578 | 578 | function lsx_health_plan_featured_tips_block() { |
| 579 | - if ( ! post_type_exists( 'tip' ) ) { |
|
| 580 | - return; |
|
| 581 | - } |
|
| 582 | - include LSX_HEALTH_PLAN_PATH . '/templates/featured-tips.php'; |
|
| 579 | + if ( ! post_type_exists( 'tip' ) ) { |
|
| 580 | + return; |
|
| 581 | + } |
|
| 582 | + include LSX_HEALTH_PLAN_PATH . '/templates/featured-tips.php'; |
|
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | /** |
@@ -589,11 +589,11 @@ discard block |
||
| 589 | 589 | * @return void |
| 590 | 590 | */ |
| 591 | 591 | function lsx_health_plan_day_button() { |
| 592 | - if ( lsx_health_plan_is_day_complete() ) { |
|
| 593 | - lsx_health_plan_unlock_button(); |
|
| 594 | - } else { |
|
| 595 | - lsx_health_plan_complete_button(); |
|
| 596 | - } |
|
| 592 | + if ( lsx_health_plan_is_day_complete() ) { |
|
| 593 | + lsx_health_plan_unlock_button(); |
|
| 594 | + } else { |
|
| 595 | + lsx_health_plan_complete_button(); |
|
| 596 | + } |
|
| 597 | 597 | } |
| 598 | 598 | |
| 599 | 599 | /** |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | * @return void |
| 603 | 603 | */ |
| 604 | 604 | function lsx_health_plan_complete_button() { |
| 605 | - ?> |
|
| 605 | + ?> |
|
| 606 | 606 | <div class="single-plan-inner-buttons"> |
| 607 | 607 | <form action="<?php the_permalink(); ?>" method="post" class="form-complete-day complete-plan-btn"> |
| 608 | 608 | <?php wp_nonce_field( 'complete', 'lsx-health-plan-actions' ); ?> |
@@ -611,12 +611,12 @@ discard block |
||
| 611 | 611 | </form> |
| 612 | 612 | <div class="back-plan-btn"> |
| 613 | 613 | <?php |
| 614 | - if ( function_exists( 'wc_get_page_id' ) ) { |
|
| 615 | - ?> |
|
| 614 | + if ( function_exists( 'wc_get_page_id' ) ) { |
|
| 615 | + ?> |
|
| 616 | 616 | <a class="btn" href="<?php echo wp_kses_post( get_permalink( wc_get_page_id( 'myaccount' ) ) ); ?>"><?php esc_html_e( 'Back To My Plan', 'lsx-health-plan' ); ?></a> |
| 617 | 617 | <?php |
| 618 | - } |
|
| 619 | - ?> |
|
| 618 | + } |
|
| 619 | + ?> |
|
| 620 | 620 | </div> |
| 621 | 621 | </div> |
| 622 | 622 | <?php |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | * @return void |
| 629 | 629 | */ |
| 630 | 630 | function lsx_health_plan_unlock_button() { |
| 631 | - ?> |
|
| 631 | + ?> |
|
| 632 | 632 | <div class="single-plan-inner-buttons"> |
| 633 | 633 | <form action="<?php the_permalink(); ?>" method="post" class="form-complete-day complete-plan-btn"> |
| 634 | 634 | <?php wp_nonce_field( 'unlock', 'lsx-health-plan-actions' ); ?> |
@@ -637,12 +637,12 @@ discard block |
||
| 637 | 637 | </form> |
| 638 | 638 | <div class="back-plan-btn"> |
| 639 | 639 | <?php |
| 640 | - if ( function_exists( 'wc_get_page_id' ) ) { |
|
| 641 | - ?> |
|
| 640 | + if ( function_exists( 'wc_get_page_id' ) ) { |
|
| 641 | + ?> |
|
| 642 | 642 | <a class="btn" href="<?php echo wp_kses_post( get_permalink( wc_get_page_id( 'myaccount' ) ) ); ?>"><?php esc_html_e( 'Back To My Plan', 'lsx-health-plan' ); ?></a> |
| 643 | 643 | <?php |
| 644 | - } |
|
| 645 | - ?> |
|
| 644 | + } |
|
| 645 | + ?> |
|
| 646 | 646 | </div> |
| 647 | 647 | </div> |
| 648 | 648 | <?php |
@@ -655,10 +655,10 @@ discard block |
||
| 655 | 655 | * @return void |
| 656 | 656 | */ |
| 657 | 657 | function lsx_health_plan_single_nav() { |
| 658 | - $tab_template_path = apply_filters( 'lsx_health_plan_single_nav_path', LSX_HEALTH_PLAN_PATH . '/templates/single-plan-tabs.php' ); |
|
| 659 | - if ( '' !== $tab_template_path ) { |
|
| 660 | - require $tab_template_path; |
|
| 661 | - } |
|
| 658 | + $tab_template_path = apply_filters( 'lsx_health_plan_single_nav_path', LSX_HEALTH_PLAN_PATH . '/templates/single-plan-tabs.php' ); |
|
| 659 | + if ( '' !== $tab_template_path ) { |
|
| 660 | + require $tab_template_path; |
|
| 661 | + } |
|
| 662 | 662 | } |
| 663 | 663 | |
| 664 | 664 | /** |
@@ -668,32 +668,32 @@ discard block |
||
| 668 | 668 | * @return void |
| 669 | 669 | */ |
| 670 | 670 | function lsx_health_plan_single_tabs() { |
| 671 | - $endpoint = get_query_var( 'endpoint' ); |
|
| 672 | - switch ( $endpoint ) { |
|
| 673 | - case 'meal': |
|
| 674 | - $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-meal.php'; |
|
| 675 | - break; |
|
| 676 | - |
|
| 677 | - case 'recipes': |
|
| 678 | - $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-recipes.php'; |
|
| 679 | - break; |
|
| 680 | - |
|
| 681 | - case 'workout': |
|
| 682 | - $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-workout.php'; |
|
| 683 | - break; |
|
| 684 | - |
|
| 685 | - case 'warm-up': |
|
| 686 | - $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-warm-up.php'; |
|
| 687 | - break; |
|
| 688 | - |
|
| 689 | - default: |
|
| 690 | - $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-plan.php'; |
|
| 691 | - break; |
|
| 692 | - } |
|
| 693 | - $tab_template_path = apply_filters( 'lsx_health_plan_single_tab_path', $tab_template_path ); |
|
| 694 | - if ( '' !== $tab_template_path ) { |
|
| 695 | - include $tab_template_path; |
|
| 696 | - } |
|
| 671 | + $endpoint = get_query_var( 'endpoint' ); |
|
| 672 | + switch ( $endpoint ) { |
|
| 673 | + case 'meal': |
|
| 674 | + $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-meal.php'; |
|
| 675 | + break; |
|
| 676 | + |
|
| 677 | + case 'recipes': |
|
| 678 | + $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-recipes.php'; |
|
| 679 | + break; |
|
| 680 | + |
|
| 681 | + case 'workout': |
|
| 682 | + $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-workout.php'; |
|
| 683 | + break; |
|
| 684 | + |
|
| 685 | + case 'warm-up': |
|
| 686 | + $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-warm-up.php'; |
|
| 687 | + break; |
|
| 688 | + |
|
| 689 | + default: |
|
| 690 | + $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-plan.php'; |
|
| 691 | + break; |
|
| 692 | + } |
|
| 693 | + $tab_template_path = apply_filters( 'lsx_health_plan_single_tab_path', $tab_template_path ); |
|
| 694 | + if ( '' !== $tab_template_path ) { |
|
| 695 | + include $tab_template_path; |
|
| 696 | + } |
|
| 697 | 697 | } |
| 698 | 698 | |
| 699 | 699 | /** |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | * @return void |
| 703 | 703 | */ |
| 704 | 704 | function lsx_health_plan_recipe_data() { |
| 705 | - include LSX_HEALTH_PLAN_PATH . '/templates/table-recipe-data.php'; |
|
| 705 | + include LSX_HEALTH_PLAN_PATH . '/templates/table-recipe-data.php'; |
|
| 706 | 706 | } |
| 707 | 707 | |
| 708 | 708 | /** |
@@ -711,11 +711,11 @@ discard block |
||
| 711 | 711 | * @return recipe_type |
| 712 | 712 | */ |
| 713 | 713 | function lsx_health_plan_recipe_type() { |
| 714 | - $term_obj_list = get_the_terms( get_the_ID(), 'recipe-type' ); |
|
| 715 | - $recipe_type = $term_obj_list[0]->name; |
|
| 716 | - if ( ! empty( $recipe_type ) ) { |
|
| 717 | - return $recipe_type; |
|
| 718 | - } |
|
| 714 | + $term_obj_list = get_the_terms( get_the_ID(), 'recipe-type' ); |
|
| 715 | + $recipe_type = $term_obj_list[0]->name; |
|
| 716 | + if ( ! empty( $recipe_type ) ) { |
|
| 717 | + return $recipe_type; |
|
| 718 | + } |
|
| 719 | 719 | } |
| 720 | 720 | |
| 721 | 721 | /** |
@@ -726,35 +726,35 @@ discard block |
||
| 726 | 726 | * @return void |
| 727 | 727 | */ |
| 728 | 728 | function lsx_health_plan_workout_video_play_button( $m, $group, $echo = true ) { |
| 729 | - $workout_video = ''; |
|
| 730 | - $giphy = ''; |
|
| 731 | - $youtube = ''; |
|
| 732 | - if ( isset( $group['connected_videos'] ) && '' !== $group['connected_videos'] ) { |
|
| 733 | - $workout_video = esc_html( $group['connected_videos'] ); |
|
| 734 | - $giphy = get_post_meta( $workout_video, 'video_giphy_source', true ); |
|
| 735 | - $youtube = esc_url( get_post_meta( $workout_video, 'video_youtube_source', 1 ) ); |
|
| 736 | - $content = get_post_field( 'post_content', $workout_video ); |
|
| 737 | - $play_button = '<button data-toggle="modal" data-target="#workout-video-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>'; |
|
| 738 | - |
|
| 739 | - $modal_body = ''; |
|
| 740 | - if ( ! empty( $giphy ) ) { |
|
| 741 | - $giphy = \lsx_health_plan\functions\get_video_url( $giphy ); |
|
| 742 | - $modal_body = $giphy; // WPCS: XSS OK. |
|
| 743 | - } elseif ( ! empty( $youtube ) ) { |
|
| 744 | - $modal_body = wp_oembed_get( $youtube, array( // WPCS: XSS OK. |
|
| 745 | - 'width' => 480, |
|
| 746 | - ) ); |
|
| 747 | - } |
|
| 748 | - $modal_body .= '<h5 class="modal-title title-lined">' . $group['name'] . '</h5>'; |
|
| 749 | - $modal_body .= $content; |
|
| 750 | - \lsx_health_plan\functions\register_modal( 'workout-video-modal-' . $m, '', $modal_body ); |
|
| 751 | - |
|
| 752 | - if ( true === $echo ) { |
|
| 753 | - echo wp_kses_post( $play_button ); |
|
| 754 | - } else { |
|
| 755 | - return $play_button; |
|
| 756 | - } |
|
| 757 | - } |
|
| 729 | + $workout_video = ''; |
|
| 730 | + $giphy = ''; |
|
| 731 | + $youtube = ''; |
|
| 732 | + if ( isset( $group['connected_videos'] ) && '' !== $group['connected_videos'] ) { |
|
| 733 | + $workout_video = esc_html( $group['connected_videos'] ); |
|
| 734 | + $giphy = get_post_meta( $workout_video, 'video_giphy_source', true ); |
|
| 735 | + $youtube = esc_url( get_post_meta( $workout_video, 'video_youtube_source', 1 ) ); |
|
| 736 | + $content = get_post_field( 'post_content', $workout_video ); |
|
| 737 | + $play_button = '<button data-toggle="modal" data-target="#workout-video-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>'; |
|
| 738 | + |
|
| 739 | + $modal_body = ''; |
|
| 740 | + if ( ! empty( $giphy ) ) { |
|
| 741 | + $giphy = \lsx_health_plan\functions\get_video_url( $giphy ); |
|
| 742 | + $modal_body = $giphy; // WPCS: XSS OK. |
|
| 743 | + } elseif ( ! empty( $youtube ) ) { |
|
| 744 | + $modal_body = wp_oembed_get( $youtube, array( // WPCS: XSS OK. |
|
| 745 | + 'width' => 480, |
|
| 746 | + ) ); |
|
| 747 | + } |
|
| 748 | + $modal_body .= '<h5 class="modal-title title-lined">' . $group['name'] . '</h5>'; |
|
| 749 | + $modal_body .= $content; |
|
| 750 | + \lsx_health_plan\functions\register_modal( 'workout-video-modal-' . $m, '', $modal_body ); |
|
| 751 | + |
|
| 752 | + if ( true === $echo ) { |
|
| 753 | + echo wp_kses_post( $play_button ); |
|
| 754 | + } else { |
|
| 755 | + return $play_button; |
|
| 756 | + } |
|
| 757 | + } |
|
| 758 | 758 | } |
| 759 | 759 | |
| 760 | 760 | /** |
@@ -763,21 +763,21 @@ discard block |
||
| 763 | 763 | * @return void |
| 764 | 764 | */ |
| 765 | 765 | function lsx_health_plan_recipe_archive_description() { |
| 766 | - $description = ''; |
|
| 767 | - if ( is_post_type_archive( 'recipe' ) ) { |
|
| 768 | - $description = \lsx_health_plan\functions\get_option( 'recipe_archive_description', '' ); |
|
| 769 | - } elseif ( is_post_type_archive( 'exercise' ) ) { |
|
| 770 | - $description = \lsx_health_plan\functions\get_option( 'exercise_archive_description', '' ); |
|
| 771 | - } elseif ( is_tax() ) { |
|
| 772 | - $description = get_the_archive_description(); |
|
| 773 | - } |
|
| 774 | - if ( '' !== $description ) { |
|
| 775 | - ?> |
|
| 766 | + $description = ''; |
|
| 767 | + if ( is_post_type_archive( 'recipe' ) ) { |
|
| 768 | + $description = \lsx_health_plan\functions\get_option( 'recipe_archive_description', '' ); |
|
| 769 | + } elseif ( is_post_type_archive( 'exercise' ) ) { |
|
| 770 | + $description = \lsx_health_plan\functions\get_option( 'exercise_archive_description', '' ); |
|
| 771 | + } elseif ( is_tax() ) { |
|
| 772 | + $description = get_the_archive_description(); |
|
| 773 | + } |
|
| 774 | + if ( '' !== $description ) { |
|
| 775 | + ?> |
|
| 776 | 776 | <div class="lsx-hp-archive-description row"> |
| 777 | 777 | <div class="col-xs-12 description-wrapper"><?php echo wp_kses_post( $description ); ?></div> |
| 778 | 778 | </div> |
| 779 | 779 | <?php |
| 780 | - } |
|
| 780 | + } |
|
| 781 | 781 | } |
| 782 | 782 | |
| 783 | 783 | /** |
@@ -787,36 +787,36 @@ discard block |
||
| 787 | 787 | * @return void |
| 788 | 788 | */ |
| 789 | 789 | function lsx_health_plan_workout_tab_content( $index = 1 ) { |
| 790 | - global $group_name,$shortcode_args; |
|
| 791 | - $group_name = 'workout_section_' . $index; |
|
| 792 | - if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) { |
|
| 793 | - $layout = strtolower( \lsx_health_plan\functions\get_option( 'workout_tab_layout', 'table' ) ); |
|
| 794 | - |
|
| 795 | - // Check for shortcode overrides. |
|
| 796 | - if ( null !== $shortcode_args && isset( $shortcode_args['layout'] ) ) { |
|
| 797 | - $layout = $shortcode_args['layout']; |
|
| 798 | - } |
|
| 799 | - } else { |
|
| 800 | - $layout = 'table'; |
|
| 801 | - } |
|
| 802 | - |
|
| 803 | - switch ( $layout ) { |
|
| 804 | - case 'list': |
|
| 805 | - $tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-list.php'; |
|
| 806 | - break; |
|
| 807 | - |
|
| 808 | - case 'grid': |
|
| 809 | - $tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-grid.php'; |
|
| 810 | - break; |
|
| 811 | - |
|
| 812 | - case 'table': |
|
| 813 | - $tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-table.php'; |
|
| 814 | - break; |
|
| 815 | - } |
|
| 816 | - $tab_template_path = apply_filters( 'lsx_health_plan_workout_tab_content_path', $tab_template_path ); |
|
| 817 | - if ( '' !== $tab_template_path ) { |
|
| 818 | - include $tab_template_path; |
|
| 819 | - } |
|
| 790 | + global $group_name,$shortcode_args; |
|
| 791 | + $group_name = 'workout_section_' . $index; |
|
| 792 | + if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) { |
|
| 793 | + $layout = strtolower( \lsx_health_plan\functions\get_option( 'workout_tab_layout', 'table' ) ); |
|
| 794 | + |
|
| 795 | + // Check for shortcode overrides. |
|
| 796 | + if ( null !== $shortcode_args && isset( $shortcode_args['layout'] ) ) { |
|
| 797 | + $layout = $shortcode_args['layout']; |
|
| 798 | + } |
|
| 799 | + } else { |
|
| 800 | + $layout = 'table'; |
|
| 801 | + } |
|
| 802 | + |
|
| 803 | + switch ( $layout ) { |
|
| 804 | + case 'list': |
|
| 805 | + $tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-list.php'; |
|
| 806 | + break; |
|
| 807 | + |
|
| 808 | + case 'grid': |
|
| 809 | + $tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-grid.php'; |
|
| 810 | + break; |
|
| 811 | + |
|
| 812 | + case 'table': |
|
| 813 | + $tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-table.php'; |
|
| 814 | + break; |
|
| 815 | + } |
|
| 816 | + $tab_template_path = apply_filters( 'lsx_health_plan_workout_tab_content_path', $tab_template_path ); |
|
| 817 | + if ( '' !== $tab_template_path ) { |
|
| 818 | + include $tab_template_path; |
|
| 819 | + } |
|
| 820 | 820 | } |
| 821 | 821 | |
| 822 | 822 | /** |
@@ -825,13 +825,13 @@ discard block |
||
| 825 | 825 | * @return void |
| 826 | 826 | */ |
| 827 | 827 | function lsx_health_plan_workout_sets() { |
| 828 | - if ( is_singular( 'workout' ) ) { |
|
| 829 | - global $connected_workouts; |
|
| 830 | - $connected_workouts = array( get_the_ID() ); |
|
| 831 | - } |
|
| 832 | - $template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-sets.php'; |
|
| 833 | - $template_path = apply_filters( 'lsx_health_plan_workout_set_template_path', $template_path ); |
|
| 834 | - if ( '' !== $template_path && ! empty( $template_path ) ) { |
|
| 835 | - include $template_path; |
|
| 836 | - } |
|
| 828 | + if ( is_singular( 'workout' ) ) { |
|
| 829 | + global $connected_workouts; |
|
| 830 | + $connected_workouts = array( get_the_ID() ); |
|
| 831 | + } |
|
| 832 | + $template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-sets.php'; |
|
| 833 | + $template_path = apply_filters( 'lsx_health_plan_workout_set_template_path', $template_path ); |
|
| 834 | + if ( '' !== $template_path && ! empty( $template_path ) ) { |
|
| 835 | + include $template_path; |
|
| 836 | + } |
|
| 837 | 837 | } |
@@ -15,17 +15,17 @@ |
||
| 15 | 15 | * @return string |
| 16 | 16 | */ |
| 17 | 17 | function lsx_health_plan_gallery( $before = '', $after = '', $echo = true, $item_id = false ) { |
| 18 | - $gallery = ''; |
|
| 19 | - $lsx_hp = lsx_health_plan(); |
|
| 20 | - if ( false === $item_id ) { |
|
| 21 | - $item_id = get_the_ID(); |
|
| 22 | - } |
|
| 23 | - if ( $lsx_hp->frontend->gallery->has_gallery( $item_id ) ) { |
|
| 24 | - $gallery = $before . $lsx_hp->frontend->gallery->get_gallery() . $after; |
|
| 25 | - } |
|
| 26 | - if ( true === $echo ) { |
|
| 27 | - echo wp_kses_post( $gallery ); |
|
| 28 | - } else { |
|
| 29 | - return $gallery; |
|
| 30 | - } |
|
| 18 | + $gallery = ''; |
|
| 19 | + $lsx_hp = lsx_health_plan(); |
|
| 20 | + if ( false === $item_id ) { |
|
| 21 | + $item_id = get_the_ID(); |
|
| 22 | + } |
|
| 23 | + if ( $lsx_hp->frontend->gallery->has_gallery( $item_id ) ) { |
|
| 24 | + $gallery = $before . $lsx_hp->frontend->gallery->get_gallery() . $after; |
|
| 25 | + } |
|
| 26 | + if ( true === $echo ) { |
|
| 27 | + echo wp_kses_post( $gallery ); |
|
| 28 | + } else { |
|
| 29 | + return $gallery; |
|
| 30 | + } |
|
| 31 | 31 | } |