@@ -14,13 +14,13 @@ discard block |
||
14 | 14 | $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id; |
15 | 15 | ?> |
16 | 16 | |
17 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
17 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
18 | 18 | |
19 | 19 | <?php lsx_content_before(); ?> |
20 | 20 | |
21 | 21 | <!-- Begining restricted content --> |
22 | 22 | <?php |
23 | - if ( ! function_exists( 'wc_memberships_view_restricted_post_content' ) || current_user_can( 'wc_memberships_view_restricted_post_content', $post_id ) ) { |
|
23 | + if ( ! function_exists('wc_memberships_view_restricted_post_content') || current_user_can('wc_memberships_view_restricted_post_content', $post_id)) { |
|
24 | 24 | ?> |
25 | 25 | <main id="main" role="main"> |
26 | 26 | |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | |
29 | 29 | <div class="post-wrapper exercise-archive-plan archive-plan"> |
30 | 30 | <div class="row"> |
31 | - <?php if ( have_posts() ) : ?> |
|
31 | + <?php if (have_posts()) : ?> |
|
32 | 32 | <?php |
33 | - while ( have_posts() ) : |
|
33 | + while (have_posts()) : |
|
34 | 34 | the_post(); |
35 | 35 | ?> |
36 | 36 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | <?php else : ?> |
42 | 42 | |
43 | - <?php get_template_part( 'partials/content', 'none' ); ?> |
|
43 | + <?php get_template_part('partials/content', 'none'); ?> |
|
44 | 44 | |
45 | 45 | <?php endif; ?> |
46 | 46 | </div> |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | <?php |
54 | 54 | } else { |
55 | - wp_redirect( $redirect ); |
|
55 | + wp_redirect($redirect); |
|
56 | 56 | exit; |
57 | 57 | } |
58 | 58 | ?> |
@@ -14,13 +14,13 @@ discard block |
||
14 | 14 | $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id; |
15 | 15 | ?> |
16 | 16 | |
17 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
17 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
18 | 18 | |
19 | 19 | <?php lsx_content_before(); ?> |
20 | 20 | |
21 | 21 | <!-- Begining restricted content --> |
22 | 22 | <?php |
23 | - if ( ! function_exists( 'wc_memberships_view_restricted_post_content' ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) { |
|
23 | + if ( ! function_exists('wc_memberships_view_restricted_post_content') || current_user_can('wc_memberships_view_restricted_post_content', $page_id)) { |
|
24 | 24 | ?> |
25 | 25 | <main id="main" role="main"> |
26 | 26 | |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | |
29 | 29 | <div class="post-wrapper workout-archive-plan archive-plan"> |
30 | 30 | <div class="row"> |
31 | - <?php if ( have_posts() ) : ?> |
|
31 | + <?php if (have_posts()) : ?> |
|
32 | 32 | <?php |
33 | - while ( have_posts() ) : |
|
33 | + while (have_posts()) : |
|
34 | 34 | the_post(); |
35 | 35 | ?> |
36 | 36 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | <?php else : ?> |
42 | 42 | |
43 | - <?php get_template_part( 'partials/content', 'none' ); ?> |
|
43 | + <?php get_template_part('partials/content', 'none'); ?> |
|
44 | 44 | |
45 | 45 | <?php endif; ?> |
46 | 46 | </div> |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | <?php |
54 | 54 | } else { |
55 | - wp_redirect( $redirect ); |
|
55 | + wp_redirect($redirect); |
|
56 | 56 | exit; |
57 | 57 | } |
58 | 58 | ?> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | <?php lsx_content_wrap_before(); ?> |
11 | 11 | |
12 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
12 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
13 | 13 | |
14 | 14 | <?php lsx_content_before(); ?> |
15 | 15 | |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | |
20 | 20 | <div class="post-wrapper archive-plan"> |
21 | 21 | <div class="row"> |
22 | - <?php if ( have_posts() ) : ?> |
|
22 | + <?php if (have_posts()) : ?> |
|
23 | 23 | <?php |
24 | - while ( have_posts() ) : |
|
24 | + while (have_posts()) : |
|
25 | 25 | the_post(); |
26 | 26 | ?> |
27 | 27 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | <?php else : ?> |
33 | 33 | |
34 | - <?php get_template_part( 'partials/content', 'none' ); ?> |
|
34 | + <?php get_template_part('partials/content', 'none'); ?> |
|
35 | 35 | |
36 | 36 | <?php endif; ?> |
37 | 37 | </div> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | <?php lsx_content_wrap_before(); ?> |
11 | 11 | |
12 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
12 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
13 | 13 | |
14 | 14 | <?php lsx_content_before(); ?> |
15 | 15 | |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | |
20 | 20 | <div class="post-wrapper archive-plan"> |
21 | 21 | <div class="row"> |
22 | - <?php if ( have_posts() ) : ?> |
|
22 | + <?php if (have_posts()) : ?> |
|
23 | 23 | <?php |
24 | - while ( have_posts() ) : |
|
24 | + while (have_posts()) : |
|
25 | 25 | the_post(); |
26 | 26 | ?> |
27 | 27 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | <?php else : ?> |
33 | 33 | |
34 | - <?php get_template_part( 'partials/content', 'none' ); ?> |
|
34 | + <?php get_template_part('partials/content', 'none'); ?> |
|
35 | 35 | |
36 | 36 | <?php endif; ?> |
37 | 37 | </div> |
@@ -21,10 +21,10 @@ discard block |
||
21 | 21 | * Constructor |
22 | 22 | */ |
23 | 23 | public function __construct() { |
24 | - add_filter( 'template_include', array( $this, 'archive_template_include' ), 99 ); |
|
25 | - add_filter( 'template_include', array( $this, 'single_template_include' ), 99 ); |
|
26 | - add_filter( 'template_include', array( $this, 'taxonomy_template_include' ), 99 ); |
|
27 | - add_action( 'wp', array( $this, 'redirect_restrictions' ), 99 ); |
|
24 | + add_filter('template_include', array($this, 'archive_template_include'), 99); |
|
25 | + add_filter('template_include', array($this, 'single_template_include'), 99); |
|
26 | + add_filter('template_include', array($this, 'taxonomy_template_include'), 99); |
|
27 | + add_action('wp', array($this, 'redirect_restrictions'), 99); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public static function get_instance() { |
38 | 38 | // If the single instance hasn't been set, set it now. |
39 | - if ( null === self::$instance ) { |
|
39 | + if (null === self::$instance) { |
|
40 | 40 | self::$instance = new self(); |
41 | 41 | } |
42 | 42 | return self::$instance; |
@@ -45,11 +45,11 @@ discard block |
||
45 | 45 | /** |
46 | 46 | * Archive template. |
47 | 47 | */ |
48 | - public function archive_template_include( $template ) { |
|
49 | - $applicable_post_types = apply_filters( 'lsx_health_plan_archive_template', array() ); |
|
50 | - if ( ! empty( $applicable_post_types ) && is_main_query() && is_post_type_archive( $applicable_post_types ) ) { |
|
48 | + public function archive_template_include($template) { |
|
49 | + $applicable_post_types = apply_filters('lsx_health_plan_archive_template', array()); |
|
50 | + if ( ! empty($applicable_post_types) && is_main_query() && is_post_type_archive($applicable_post_types)) { |
|
51 | 51 | $post_type = get_post_type(); |
52 | - if ( empty( locate_template( array( 'archive-' . $post_type . '.php' ) ) ) && file_exists( LSX_HEALTH_PLAN_PATH . 'templates/archive-' . $post_type . '.php' ) ) { |
|
52 | + if (empty(locate_template(array('archive-' . $post_type . '.php'))) && file_exists(LSX_HEALTH_PLAN_PATH . 'templates/archive-' . $post_type . '.php')) { |
|
53 | 53 | $template = LSX_HEALTH_PLAN_PATH . 'templates/archive-' . $post_type . '.php'; |
54 | 54 | } |
55 | 55 | } |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | /** |
60 | 60 | * Single template. |
61 | 61 | */ |
62 | - public function single_template_include( $template ) { |
|
63 | - $applicable_post_types = apply_filters( 'lsx_health_plan_single_template', array() ); |
|
64 | - if ( ! empty( $applicable_post_types ) && is_main_query() && is_singular( $applicable_post_types ) ) { |
|
62 | + public function single_template_include($template) { |
|
63 | + $applicable_post_types = apply_filters('lsx_health_plan_single_template', array()); |
|
64 | + if ( ! empty($applicable_post_types) && is_main_query() && is_singular($applicable_post_types)) { |
|
65 | 65 | $post_type = get_post_type(); |
66 | - if ( empty( locate_template( array( 'single-' . $post_type . '.php' ) ) ) && file_exists( LSX_HEALTH_PLAN_PATH . 'templates/single-' . $post_type . '.php' ) ) { |
|
66 | + if (empty(locate_template(array('single-' . $post_type . '.php'))) && file_exists(LSX_HEALTH_PLAN_PATH . 'templates/single-' . $post_type . '.php')) { |
|
67 | 67 | $template = LSX_HEALTH_PLAN_PATH . 'templates/single-' . $post_type . '.php'; |
68 | 68 | } |
69 | 69 | } |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | * @param $template string |
77 | 77 | * @return string |
78 | 78 | */ |
79 | - public function taxonomy_template_include( $template ) { |
|
80 | - $applicable_taxonomies = apply_filters( 'lsx_health_plan_taxonomies_template', array() ); |
|
81 | - if ( is_main_query() && is_tax( $applicable_taxonomies ) ) { |
|
82 | - $current_taxonomy = get_query_var( 'taxonomy' ); |
|
83 | - if ( '' === locate_template( array( 'taxonomy-' . $current_taxonomy . '.php' ) ) && file_exists( LSX_HEALTH_PLAN_PATH . 'templates/taxonomy-' . $current_taxonomy . '.php' ) ) { |
|
79 | + public function taxonomy_template_include($template) { |
|
80 | + $applicable_taxonomies = apply_filters('lsx_health_plan_taxonomies_template', array()); |
|
81 | + if (is_main_query() && is_tax($applicable_taxonomies)) { |
|
82 | + $current_taxonomy = get_query_var('taxonomy'); |
|
83 | + if ('' === locate_template(array('taxonomy-' . $current_taxonomy . '.php')) && file_exists(LSX_HEALTH_PLAN_PATH . 'templates/taxonomy-' . $current_taxonomy . '.php')) { |
|
84 | 84 | $template = LSX_HEALTH_PLAN_PATH . 'templates/taxonomy-' . $current_taxonomy . '.php'; |
85 | 85 | } |
86 | 86 | } |
@@ -92,21 +92,21 @@ discard block |
||
92 | 92 | * restriction functionality elsewhere. |
93 | 93 | */ |
94 | 94 | public function redirect_restrictions() { |
95 | - if ( function_exists( 'WC' ) && ! is_user_logged_in() ) { |
|
96 | - if ( is_post_type_archive( array( 'recipe', 'exercise', 'meal', 'workout' ) ) |
|
97 | - || is_tax( array( 'meal-type', 'workout-type', 'recipe-type', 'recipe-cuisine', 'exercise-type', 'equipment', 'muscle-group' ) ) |
|
98 | - || is_single( 'recipe', 'exercise' ) ) { |
|
95 | + if (function_exists('WC') && ! is_user_logged_in()) { |
|
96 | + if (is_post_type_archive(array('recipe', 'exercise', 'meal', 'workout')) |
|
97 | + || is_tax(array('meal-type', 'workout-type', 'recipe-type', 'recipe-cuisine', 'exercise-type', 'equipment', 'muscle-group')) |
|
98 | + || is_single('recipe', 'exercise')) { |
|
99 | 99 | |
100 | - $redirect = \lsx_health_plan\functions\get_option( 'my_plan_slug', '/' ); |
|
101 | - if ( function_exists( 'wc_memberships' ) ) { |
|
100 | + $redirect = \lsx_health_plan\functions\get_option('my_plan_slug', '/'); |
|
101 | + if (function_exists('wc_memberships')) { |
|
102 | 102 | $restriction_mode = wc_memberships()->get_restrictions_instance()->get_restriction_mode(); |
103 | - if ( 'redirect' === $restriction_mode ) { |
|
103 | + if ('redirect' === $restriction_mode) { |
|
104 | 104 | $page_id = wc_memberships()->get_restrictions_instance()->get_restricted_content_redirect_page_id(); |
105 | - $redirect = get_permalink( $page_id ); |
|
105 | + $redirect = get_permalink($page_id); |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | |
109 | - wp_redirect( $redirect ); |
|
109 | + wp_redirect($redirect); |
|
110 | 110 | exit; |
111 | 111 | } |
112 | 112 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | <?php lsx_content_wrap_before(); ?> |
11 | 11 | |
12 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
12 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
13 | 13 | |
14 | 14 | <?php lsx_content_before(); ?> |
15 | 15 | |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | |
20 | 20 | <div class="post-wrapper archive-plan"> |
21 | 21 | <div class="row"> |
22 | - <?php if ( have_posts() ) : ?> |
|
22 | + <?php if (have_posts()) : ?> |
|
23 | 23 | <?php |
24 | - while ( have_posts() ) : |
|
24 | + while (have_posts()) : |
|
25 | 25 | the_post(); |
26 | 26 | ?> |
27 | 27 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | <?php else : ?> |
33 | 33 | |
34 | - <?php get_template_part( 'partials/content', 'none' ); ?> |
|
34 | + <?php get_template_part('partials/content', 'none'); ?> |
|
35 | 35 | |
36 | 36 | <?php endif; ?> |
37 | 37 | </div> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | <?php lsx_content_wrap_before(); ?> |
11 | 11 | |
12 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
12 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
13 | 13 | |
14 | 14 | <?php lsx_content_before(); ?> |
15 | 15 | |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | |
20 | 20 | <div class="post-wrapper archive-plan"> |
21 | 21 | <div class="row"> |
22 | - <?php if ( have_posts() ) : ?> |
|
22 | + <?php if (have_posts()) : ?> |
|
23 | 23 | <?php |
24 | - while ( have_posts() ) : |
|
24 | + while (have_posts()) : |
|
25 | 25 | the_post(); |
26 | 26 | ?> |
27 | 27 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | <?php else : ?> |
33 | 33 | |
34 | - <?php get_template_part( 'partials/content', 'none' ); ?> |
|
34 | + <?php get_template_part('partials/content', 'none'); ?> |
|
35 | 35 | |
36 | 36 | <?php endif; ?> |
37 | 37 | </div> |
@@ -6,11 +6,11 @@ discard block |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | global $group_name; |
9 | -$groups = get_post_meta( get_the_ID(), $group_name, true ); |
|
10 | -if ( is_singular( 'workout' ) ) { |
|
11 | - $groups = get_post_meta( get_queried_object_id(), $group_name, true ); |
|
9 | +$groups = get_post_meta(get_the_ID(), $group_name, true); |
|
10 | +if (is_singular('workout')) { |
|
11 | + $groups = get_post_meta(get_queried_object_id(), $group_name, true); |
|
12 | 12 | } |
13 | -if ( ! empty( $groups ) ) { |
|
13 | +if ( ! empty($groups)) { |
|
14 | 14 | ?> |
15 | 15 | <div class="set-table"> |
16 | 16 | <table class="workout-table"> |
@@ -18,99 +18,99 @@ discard block |
||
18 | 18 | $table_headers = array(); |
19 | 19 | $table_body = array(); |
20 | 20 | |
21 | - foreach ( $groups as $group ) { |
|
21 | + foreach ($groups as $group) { |
|
22 | 22 | $this_row = array(); |
23 | 23 | |
24 | 24 | $this_row[] = '<tr>'; |
25 | 25 | |
26 | 26 | // Getting the connected exercise. |
27 | - if ( post_type_exists( 'exercise' ) ) { |
|
28 | - if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_exercises'] ) ) ) ) { |
|
27 | + if (post_type_exists('exercise')) { |
|
28 | + if (isset($group['connected_exercises']) && '' !== $group['connected_exercises'] && ! empty(\lsx_health_plan\functions\check_posts_exist(array($group['connected_exercises'])))) { |
|
29 | 29 | $exercise = $group['connected_exercises']; |
30 | - $exercise_id = get_post( $exercise ); |
|
30 | + $exercise_id = get_post($exercise); |
|
31 | 31 | } |
32 | 32 | } else { |
33 | 33 | $exercise = false; |
34 | 34 | $exercise_id = false; |
35 | 35 | } |
36 | 36 | |
37 | - if ( false !== $exercise && '' !== $exercise ) { |
|
38 | - $exercise_name = get_the_title( $exercise_id ); |
|
39 | - $this_row[] = '<td class="workout-title-item">' . esc_html( $exercise_name ) . '</td>'; |
|
37 | + if (false !== $exercise && '' !== $exercise) { |
|
38 | + $exercise_name = get_the_title($exercise_id); |
|
39 | + $this_row[] = '<td class="workout-title-item">' . esc_html($exercise_name) . '</td>'; |
|
40 | 40 | $table_headers['name'] = true; |
41 | 41 | } else { |
42 | - if ( isset( $group['name'] ) && '' !== $group['name'] ) { |
|
43 | - $this_row[] = '<td class="workout-title-item">' . esc_html( $group['name'] ) . '</td>'; |
|
42 | + if (isset($group['name']) && '' !== $group['name']) { |
|
43 | + $this_row[] = '<td class="workout-title-item">' . esc_html($group['name']) . '</td>'; |
|
44 | 44 | $table_headers['name'] = true; |
45 | 45 | } |
46 | 46 | } |
47 | 47 | // Only display this is exercise is disabled. |
48 | - if ( false === $exercise && isset( $group['description'] ) && '' !== $group['description'] ) { |
|
49 | - $this_row[] = '<td class="workout-desc-item"><p>' . esc_html( $group['description'] ) . '</td>'; |
|
48 | + if (false === $exercise && isset($group['description']) && '' !== $group['description']) { |
|
49 | + $this_row[] = '<td class="workout-desc-item"><p>' . esc_html($group['description']) . '</td>'; |
|
50 | 50 | $table_headers['description'] = true; |
51 | 51 | } |
52 | 52 | |
53 | - if ( isset( $group['reps'] ) && '' !== $group['reps'] ) { |
|
54 | - $this_row[] = '<td class="reps-field-item center-mobile">' . esc_html( $group['reps'] ) . '</td>'; |
|
53 | + if (isset($group['reps']) && '' !== $group['reps']) { |
|
54 | + $this_row[] = '<td class="reps-field-item center-mobile">' . esc_html($group['reps']) . '</td>'; |
|
55 | 55 | $table_headers['reps'] = true; |
56 | 56 | } |
57 | 57 | |
58 | 58 | // Only display this is exercise is disabled. |
59 | - if ( false === $exercise ) { |
|
60 | - if ( isset( $group['equipment'] ) && '' !== $group['equipment'] ) { |
|
61 | - $this_row[] = '<td class="equipment-field-item center-mobile">' . esc_html( $group['equipment'] ) . '</td>'; |
|
59 | + if (false === $exercise) { |
|
60 | + if (isset($group['equipment']) && '' !== $group['equipment']) { |
|
61 | + $this_row[] = '<td class="equipment-field-item center-mobile">' . esc_html($group['equipment']) . '</td>'; |
|
62 | 62 | $table_headers['equipment'] = true; |
63 | 63 | } |
64 | - if ( isset( $group['muscle'] ) && '' !== $group['muscle'] ) { |
|
65 | - $this_row[] = '<td class="muscle-field-item center-mobile">' . esc_html( $group['muscle'] ) . '</td>'; |
|
64 | + if (isset($group['muscle']) && '' !== $group['muscle']) { |
|
65 | + $this_row[] = '<td class="muscle-field-item center-mobile">' . esc_html($group['muscle']) . '</td>'; |
|
66 | 66 | $table_headers['muscle'] = true; |
67 | 67 | } |
68 | 68 | } |
69 | - if ( post_type_exists( 'video' ) && isset( $group['connected_videos'] ) && '' !== $group['connected_videos'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_videos'] ) ) ) ) { |
|
70 | - $this_row[] = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_video_play_button( $m, $group, false ) . '</td>'; |
|
69 | + if (post_type_exists('video') && isset($group['connected_videos']) && '' !== $group['connected_videos'] && ! empty(\lsx_health_plan\functions\check_posts_exist(array($group['connected_videos'])))) { |
|
70 | + $this_row[] = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_video_play_button($m, $group, false) . '</td>'; |
|
71 | 71 | $table_headers['video'] = true; |
72 | 72 | } |
73 | - if ( post_type_exists( 'exercise' ) && isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_exercises'] ) ) ) ) { |
|
74 | - $this_row[] = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_exercise_button( $m, $group, false ) . '</td>'; |
|
73 | + if (post_type_exists('exercise') && isset($group['connected_exercises']) && '' !== $group['connected_exercises'] && ! empty(\lsx_health_plan\functions\check_posts_exist(array($group['connected_exercises'])))) { |
|
74 | + $this_row[] = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_exercise_button($m, $group, false) . '</td>'; |
|
75 | 75 | $table_headers['exercise'] = true; |
76 | 76 | } |
77 | 77 | $this_row[] = '</tr>'; |
78 | 78 | |
79 | - $table_body[] = implode( '', $this_row ); |
|
79 | + $table_body[] = implode('', $this_row); |
|
80 | 80 | $m++; |
81 | 81 | } |
82 | 82 | |
83 | 83 | // Now we build the table header. |
84 | 84 | $table_header = array(); |
85 | 85 | $table_header[] = '<tr>'; |
86 | - if ( isset( $table_headers['name'] ) ) { |
|
87 | - $table_header[] = '<th class="center-mobile">' . __( 'Workout', 'lsx-health-plan' ) . '</th>'; |
|
86 | + if (isset($table_headers['name'])) { |
|
87 | + $table_header[] = '<th class="center-mobile">' . __('Workout', 'lsx-health-plan') . '</th>'; |
|
88 | 88 | } |
89 | - if ( isset( $table_headers['description'] ) ) { |
|
90 | - $table_header[] = '<th class="center-mobile">' . __( 'Description', 'lsx-health-plan' ) . '</th>'; |
|
89 | + if (isset($table_headers['description'])) { |
|
90 | + $table_header[] = '<th class="center-mobile">' . __('Description', 'lsx-health-plan') . '</th>'; |
|
91 | 91 | } |
92 | - if ( isset( $table_headers['reps'] ) ) { |
|
93 | - $table_header[] = '<th class="center-mobile">' . __( 'Reps / Time / Distance', 'lsx-health-plan' ) . '</th>'; |
|
92 | + if (isset($table_headers['reps'])) { |
|
93 | + $table_header[] = '<th class="center-mobile">' . __('Reps / Time / Distance', 'lsx-health-plan') . '</th>'; |
|
94 | 94 | } |
95 | - if ( isset( $table_headers['equipment'] ) ) { |
|
96 | - $table_header[] = '<th class="center-mobile">' . __( 'Equipment', 'lsx-health-plan' ) . '</th>'; |
|
95 | + if (isset($table_headers['equipment'])) { |
|
96 | + $table_header[] = '<th class="center-mobile">' . __('Equipment', 'lsx-health-plan') . '</th>'; |
|
97 | 97 | } |
98 | - if ( isset( $table_headers['muscle'] ) ) { |
|
99 | - $table_header[] = '<th class="center-mobile">' . __( 'Muscle', 'lsx-health-plan' ) . '</th>'; |
|
98 | + if (isset($table_headers['muscle'])) { |
|
99 | + $table_header[] = '<th class="center-mobile">' . __('Muscle', 'lsx-health-plan') . '</th>'; |
|
100 | 100 | } |
101 | - if ( isset( $table_headers['video'] ) ) { |
|
102 | - $table_header[] = '<th class="center-mobile">' . __( 'How To', 'lsx-health-plan' ) . '</th>'; |
|
101 | + if (isset($table_headers['video'])) { |
|
102 | + $table_header[] = '<th class="center-mobile">' . __('How To', 'lsx-health-plan') . '</th>'; |
|
103 | 103 | } |
104 | - if ( isset( $table_headers['exercise'] ) ) { |
|
105 | - $table_header[] = '<th class="center-mobile">' . __( 'How To', 'lsx-health-plan' ) . '</th>'; |
|
104 | + if (isset($table_headers['exercise'])) { |
|
105 | + $table_header[] = '<th class="center-mobile">' . __('How To', 'lsx-health-plan') . '</th>'; |
|
106 | 106 | } |
107 | 107 | $table_header[] = '</tr>'; |
108 | 108 | ?> |
109 | 109 | <thead> |
110 | - <?php echo wp_kses_post( implode( '', $table_header ) ); ?> |
|
110 | + <?php echo wp_kses_post(implode('', $table_header)); ?> |
|
111 | 111 | </thead> |
112 | 112 | <tbody> |
113 | - <?php echo wp_kses_post( implode( '', $table_body ) ); ?> |
|
113 | + <?php echo wp_kses_post(implode('', $table_body)); ?> |
|
114 | 114 | </tbody> |
115 | 115 | </table> |
116 | 116 | </div> |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | <?php lsx_content_wrap_before(); ?> |
14 | 14 | |
15 | -<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
15 | +<div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
16 | 16 | |
17 | 17 | <?php lsx_content_before(); ?> |
18 | 18 | |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | |
21 | 21 | <?php lsx_content_top(); ?> |
22 | 22 | |
23 | - <?php if ( have_posts() ) : ?> |
|
23 | + <?php if (have_posts()) : ?> |
|
24 | 24 | |
25 | - <?php while ( have_posts() ) : the_post(); ?> |
|
25 | + <?php while (have_posts()) : the_post(); ?> |
|
26 | 26 | |
27 | 27 | <?php lsx_entry_before(); ?> |
28 | 28 | |
@@ -32,35 +32,35 @@ discard block |
||
32 | 32 | |
33 | 33 | <div class="entry-content"> |
34 | 34 | <?php |
35 | - if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'edit-account' ) ) { |
|
35 | + if (function_exists('is_wc_endpoint_url') && is_wc_endpoint_url('edit-account')) { |
|
36 | 36 | $classes = get_body_class(); |
37 | - if ( in_array( 'has-block-banner', $classes ) ) { |
|
38 | - $blocks = parse_blocks( get_the_content() ); |
|
39 | - foreach ( $blocks as $block ) { |
|
40 | - if ( 'lsx-blocks/lsx-banner-box' === $block['blockName'] ) { |
|
41 | - echo wp_kses_post( $block['innerHTML'] ); |
|
37 | + if (in_array('has-block-banner', $classes)) { |
|
38 | + $blocks = parse_blocks(get_the_content()); |
|
39 | + foreach ($blocks as $block) { |
|
40 | + if ('lsx-blocks/lsx-banner-box' === $block['blockName']) { |
|
41 | + echo wp_kses_post($block['innerHTML']); |
|
42 | 42 | } |
43 | 43 | } |
44 | - } elseif ( in_array( 'has-block-cover', $classes ) ) { |
|
45 | - $blocks = parse_blocks( get_the_content() ); |
|
46 | - foreach ( $blocks as $block ) { |
|
44 | + } elseif (in_array('has-block-cover', $classes)) { |
|
45 | + $blocks = parse_blocks(get_the_content()); |
|
46 | + foreach ($blocks as $block) { |
|
47 | 47 | //print( '<pre>' . print_r( $block, true ) . '</pre>' ); |
48 | - if ( 'core/cover' === $block['blockName'] ) { |
|
49 | - echo wp_kses_post( render_block( $block ) ); |
|
48 | + if ('core/cover' === $block['blockName']) { |
|
49 | + echo wp_kses_post(render_block($block)); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | } else { |
53 | - $my_plan_string = esc_html__( 'My Dashboard', 'lsx-health-plan' ); |
|
54 | - echo wp_kses_post( '<div class="lsx-health-plan my-profile-block wp-block-cover alignfull"><div class="wp-block-cover__inner-container"><h2>' . $my_plan_string . '</h2></div></div>' ); |
|
53 | + $my_plan_string = esc_html__('My Dashboard', 'lsx-health-plan'); |
|
54 | + echo wp_kses_post('<div class="lsx-health-plan my-profile-block wp-block-cover alignfull"><div class="wp-block-cover__inner-container"><h2>' . $my_plan_string . '</h2></div></div>'); |
|
55 | 55 | } |
56 | 56 | |
57 | - if ( is_user_logged_in() ) { |
|
58 | - $my_profile_string = esc_html__( 'My Profile', 'lsx-health-plan' ); |
|
59 | - $my_profile_tagline = esc_html__( 'Update your details below', 'lsx-health-plan' ); |
|
57 | + if (is_user_logged_in()) { |
|
58 | + $my_profile_string = esc_html__('My Profile', 'lsx-health-plan'); |
|
59 | + $my_profile_tagline = esc_html__('Update your details below', 'lsx-health-plan'); |
|
60 | 60 | } |
61 | - echo do_shortcode( '<div id="edit-account-tab">[lsx_health_plan_my_profile_tabs]<div class="edit-account-section"><h2 class="title-lined">' . $my_profile_string . '</h2><p>' . $my_profile_tagline . '</p>[woocommerce_my_account]</div></div>' ); |
|
62 | - } else if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'lost-password' ) ) { |
|
63 | - echo do_shortcode( '[woocommerce_my_account]' ); |
|
61 | + echo do_shortcode('<div id="edit-account-tab">[lsx_health_plan_my_profile_tabs]<div class="edit-account-section"><h2 class="title-lined">' . $my_profile_string . '</h2><p>' . $my_profile_tagline . '</p>[woocommerce_my_account]</div></div>'); |
|
62 | + } else if (function_exists('is_wc_endpoint_url') && is_wc_endpoint_url('lost-password')) { |
|
63 | + echo do_shortcode('[woocommerce_my_account]'); |
|
64 | 64 | } else { |
65 | 65 | the_content(); |
66 | 66 | } |