@@ -16,44 +16,44 @@ discard block |
||
| 16 | 16 | ); |
| 17 | 17 | |
| 18 | 18 | $plan_id = get_the_ID(); |
| 19 | -$has_sections = \lsx_health_plan\functions\plan\has_sections( $plan_id ); |
|
| 20 | -$has_parent = wp_get_post_parent_id( $plan_id ); |
|
| 19 | +$has_sections = \lsx_health_plan\functions\plan\has_sections($plan_id); |
|
| 20 | +$has_parent = wp_get_post_parent_id($plan_id); |
|
| 21 | 21 | $restricted = false; |
| 22 | -$is_section = get_query_var( 'section', false ); |
|
| 22 | +$is_section = get_query_var('section', false); |
|
| 23 | 23 | |
| 24 | 24 | // Getting translated endpoint. |
| 25 | -$plan = \lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' ); |
|
| 25 | +$plan = \lsx_health_plan\functions\get_option('endpoint_plan', 'plan'); |
|
| 26 | 26 | |
| 27 | -$connected_members = get_post_meta( get_the_ID(), ( $plan . '_connected_team_member' ), true ); |
|
| 28 | -$connected_articles = get_post_meta( get_the_ID(), ( $plan . '_connected_articles' ), true ); |
|
| 29 | -$small_description = get_post_meta( get_the_ID(), ( $plan . '_short_description' ), true ); |
|
| 27 | +$connected_members = get_post_meta(get_the_ID(), ($plan . '_connected_team_member'), true); |
|
| 28 | +$connected_articles = get_post_meta(get_the_ID(), ($plan . '_connected_articles'), true); |
|
| 29 | +$small_description = get_post_meta(get_the_ID(), ($plan . '_short_description'), true); |
|
| 30 | 30 | |
| 31 | -if ( ! empty( $has_sections ) ) { |
|
| 31 | +if ( ! empty($has_sections)) { |
|
| 32 | 32 | $plan_type_class = 'parent-plan'; |
| 33 | - if ( 0 !== $has_parent ) { |
|
| 33 | + if (0 !== $has_parent) { |
|
| 34 | 34 | $plan_type_class = 'parent-sub-plan'; |
| 35 | 35 | } |
| 36 | 36 | } else { |
| 37 | 37 | $plan_type_class = 'unique-plan'; |
| 38 | - if ( 0 !== $has_parent ) { |
|
| 38 | + if (0 !== $has_parent) { |
|
| 39 | 39 | $plan_type_class = 'child-plan-' . $has_parent; |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | // Get the plan restrictions. |
| 44 | -if ( function_exists( 'wc_memberships_is_post_content_restricted' ) && wc_memberships_is_post_content_restricted( get_the_ID() ) ) { |
|
| 45 | - $restricted = ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() ); |
|
| 44 | +if (function_exists('wc_memberships_is_post_content_restricted') && wc_memberships_is_post_content_restricted(get_the_ID())) { |
|
| 45 | + $restricted = ! current_user_can('wc_memberships_view_restricted_post_content', get_the_ID()); |
|
| 46 | 46 | } |
| 47 | -if ( false === $restricted ) { |
|
| 48 | - $round_progress = round( \lsx_health_plan\functions\get_progress( get_the_ID() ), 0 ); |
|
| 47 | +if (false === $restricted) { |
|
| 48 | + $round_progress = round(\lsx_health_plan\functions\get_progress(get_the_ID()), 0); |
|
| 49 | 49 | } |
| 50 | 50 | ?> |
| 51 | 51 | |
| 52 | -<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
| 52 | +<div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
| 53 | 53 | |
| 54 | 54 | <?php lsx_content_before(); ?> |
| 55 | 55 | |
| 56 | - <main id="main" class="site-main <?php echo esc_html( $plan_type_class ); ?>" role="main"> |
|
| 56 | + <main id="main" class="site-main <?php echo esc_html($plan_type_class); ?>" role="main"> |
|
| 57 | 57 | |
| 58 | 58 | <?php lsx_content_top(); ?> |
| 59 | 59 | |
@@ -63,16 +63,16 @@ discard block |
||
| 63 | 63 | </div> |
| 64 | 64 | |
| 65 | 65 | <?php |
| 66 | - if ( ! empty( $has_sections ) ) { |
|
| 67 | - if ( false === $is_section ) { |
|
| 66 | + if ( ! empty($has_sections)) { |
|
| 67 | + if (false === $is_section) { |
|
| 68 | 68 | ?> |
| 69 | 69 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
| 70 | 70 | <div class="entry-content"> |
| 71 | 71 | <div class="single-plan-inner main-plan-content"> |
| 72 | 72 | <div class="single-plan-section-title title-lined"> |
| 73 | - <?php lsx_get_svg_icon( 'my-plan.svg' ); ?> |
|
| 74 | - <h2><?php echo esc_html_e( 'Your Plan', 'lsx-health-plan' ); ?></h2> |
|
| 75 | - <?php if ( class_exists( 'LSX_Sharing' ) ) { |
|
| 73 | + <?php lsx_get_svg_icon('my-plan.svg'); ?> |
|
| 74 | + <h2><?php echo esc_html_e('Your Plan', 'lsx-health-plan'); ?></h2> |
|
| 75 | + <?php if (class_exists('LSX_Sharing')) { |
|
| 76 | 76 | lsx_content_sharing(); |
| 77 | 77 | } ?> |
| 78 | 78 | </div> |
@@ -80,16 +80,16 @@ discard block |
||
| 80 | 80 | <div class="set-box set content-box entry-content"> |
| 81 | 81 | <div class="plan-top-content"> |
| 82 | 82 | <?php |
| 83 | - if ( $connected_members ) { |
|
| 84 | - echo wp_kses_post( lsx_hp_member_connected( $connected_members, $plan ) ); |
|
| 83 | + if ($connected_members) { |
|
| 84 | + echo wp_kses_post(lsx_hp_member_connected($connected_members, $plan)); |
|
| 85 | 85 | } |
| 86 | - if ( false === $restricted ) { |
|
| 87 | - echo wp_kses_post( '<span class="progress"><progress class="bar" value="' . $round_progress . '" max="100"> ' . $round_progress . '% </progress><span>' . $round_progress . '%</span></span>' ); |
|
| 86 | + if (false === $restricted) { |
|
| 87 | + echo wp_kses_post('<span class="progress"><progress class="bar" value="' . $round_progress . '" max="100"> ' . $round_progress . '% </progress><span>' . $round_progress . '%</span></span>'); |
|
| 88 | 88 | } |
| 89 | - if ( $small_description ) { |
|
| 89 | + if ($small_description) { |
|
| 90 | 90 | ?> |
| 91 | 91 | <div class="the-content"> |
| 92 | - <span><?php echo esc_html( $small_description ); ?></span> |
|
| 92 | + <span><?php echo esc_html($small_description); ?></span> |
|
| 93 | 93 | </div> |
| 94 | 94 | <?php |
| 95 | 95 | |
@@ -97,20 +97,20 @@ discard block |
||
| 97 | 97 | ?> |
| 98 | 98 | </div> |
| 99 | 99 | <?php |
| 100 | - if ( lsx_health_plan_has_tips() ) { |
|
| 101 | - echo wp_kses_post( do_shortcode( '[lsx_health_plan_featured_tips_block]' ) ); |
|
| 100 | + if (lsx_health_plan_has_tips()) { |
|
| 101 | + echo wp_kses_post(do_shortcode('[lsx_health_plan_featured_tips_block]')); |
|
| 102 | 102 | } ?> |
| 103 | 103 | </div> |
| 104 | 104 | <div class="the-plan-content"> |
| 105 | 105 | <?php |
| 106 | - echo do_shortcode( '[lsx_health_plan_day_plan_block week_view="true" show_downloads="true" plan="' . get_the_ID() . '"]' ); |
|
| 106 | + echo do_shortcode('[lsx_health_plan_day_plan_block week_view="true" show_downloads="true" plan="' . get_the_ID() . '"]'); |
|
| 107 | 107 | |
| 108 | 108 | ?> |
| 109 | 109 | <div class="row status-plan-buttons main-plan-btn"> |
| 110 | 110 | <?php |
| 111 | - if ( function_exists( 'wc_get_page_id' ) ) { |
|
| 111 | + if (function_exists('wc_get_page_id')) { |
|
| 112 | 112 | ?> |
| 113 | - <a class="btn border-btn" href="<?php echo wp_kses_post( get_permalink( wc_get_page_id( 'myaccount' ) ) ); ?>"><?php esc_html_e( 'My Plans', 'lsx-health-plan' ); ?></a> |
|
| 113 | + <a class="btn border-btn" href="<?php echo wp_kses_post(get_permalink(wc_get_page_id('myaccount'))); ?>"><?php esc_html_e('My Plans', 'lsx-health-plan'); ?></a> |
|
| 114 | 114 | <?php |
| 115 | 115 | } |
| 116 | 116 | ?> |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | <?php |
| 134 | 134 | // Show the buttons on the single plan tabs. |
| 135 | - if ( ! empty( $has_sections ) && false !== $is_section ) { |
|
| 135 | + if ( ! empty($has_sections) && false !== $is_section) { |
|
| 136 | 136 | ?> |
| 137 | 137 | <div class="row status-plan-buttons"> |
| 138 | 138 | <?php lsx_health_plan_day_button(); ?> |
@@ -144,8 +144,8 @@ discard block |
||
| 144 | 144 | <?php lsx_content_bottom(); ?> |
| 145 | 145 | |
| 146 | 146 | <?php |
| 147 | - if ( ! empty( $connected_articles ) ) { |
|
| 148 | - lsx_hp_single_related( $connected_articles, __( 'Latest articles', 'lsx-health-plan' ) ); |
|
| 147 | + if ( ! empty($connected_articles)) { |
|
| 148 | + lsx_hp_single_related($connected_articles, __('Latest articles', 'lsx-health-plan')); |
|
| 149 | 149 | } |
| 150 | 150 | ?> |
| 151 | 151 | |