Passed
Push — add/multiplan ( 02e61e...7421db )
by Warwick
03:32
created
templates/taxonomy-exercise-type.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
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 ( current_user_can( 'wc_memberships_view_restricted_post_content', $post_id ) ) {
23
+		if (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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
52 52
 
53 53
 			<?php
54 54
 		} else {
55
-			wp_redirect( $redirect );
55
+			wp_redirect($redirect);
56 56
 			exit;
57 57
 		}
58 58
 		?>
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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-exercise.php'; ?>
38 38
 
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,9 +38,12 @@
 block discarded – undo
38 38
 
39 39
 							<?php endwhile; ?>
40 40
 
41
-						<?php else : ?>
41
+						<?php else {
42
+     : ?>
42 43
 
43
-							<?php get_template_part( 'partials/content', 'none' ); ?>
44
+							<?php get_template_part( 'partials/content', 'none' );
45
+}
46
+?>
44 47
 
45 48
 						<?php endif; ?>
46 49
 					</div>
Please login to merge, or discard this patch.
templates/single-recipe.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
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
 
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
 
18 18
 		<?php lsx_content_top(); ?>
19 19
 
20
-		<?php if ( have_posts() ) : ?>
20
+		<?php if (have_posts()) : ?>
21 21
 
22 22
 			<?php
23
-			while ( have_posts() ) :
23
+			while (have_posts()) :
24 24
 				the_post();
25 25
 				?>
26 26
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	<?php lsx_content_after(); ?>
38 38
 
39 39
 	<?php
40
-	if ( is_singular( 'post' ) ) {
40
+	if (is_singular('post')) {
41 41
 		lsx_post_nav();
42 42
 	}
43 43
 	?>
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
 		<?php if ( have_posts() ) : ?>
21 21
 
22 22
 			<?php
23
-			while ( have_posts() ) :
24
-				the_post();
25
-				?>
23
+               while ( have_posts() ) :
24
+                    the_post();
25
+                    ?>
26 26
 
27 27
 				<?php include LSX_HEALTH_PLAN_PATH . '/templates/content-recipe.php'; ?>
28 28
 
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
 	<?php lsx_content_after(); ?>
38 38
 
39 39
 	<?php
40
-	if ( is_singular( 'post' ) ) {
41
-		lsx_post_nav();
42
-	}
43
-	?>
40
+     if ( is_singular( 'post' ) ) {
41
+          lsx_post_nav();
42
+     }
43
+     ?>
44 44
 
45 45
 </div><!-- #primary -->
46 46
 
Please login to merge, or discard this patch.
includes/shortcodes.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@  discard block
 block discarded – undo
14 14
  */
15 15
 function restricted_content() {
16 16
 	$content = '';
17
-	if ( ! is_user_logged_in() ) {
17
+	if ( ! is_user_logged_in()) {
18 18
 		ob_start();
19
-		echo do_shortcode( '[woocommerce_my_account]' );
19
+		echo do_shortcode('[woocommerce_my_account]');
20 20
 		$content = ob_get_clean();
21 21
 	}
22 22
 	return $content;
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
  *
52 52
  * @return void
53 53
  */
54
-function all_plans_box( $args = array() ) {
54
+function all_plans_box($args = array()) {
55 55
 
56 56
 	ob_start();
57 57
 	echo lsx_health_plan_all_plans_block(); // WPCS: XSS OK.
@@ -64,18 +64,18 @@  discard block
 block discarded – undo
64 64
  *
65 65
  * @return void
66 66
  */
67
-function day_plan_box( $args = array() ) {
67
+function day_plan_box($args = array()) {
68 68
 	$defaults = array(
69 69
 		'week_view'      => false,
70 70
 		'show_downloads' => false,
71 71
 		'plan'           => '',
72 72
 	);
73
-	$args     = wp_parse_args( $args, $defaults );
73
+	$args = wp_parse_args($args, $defaults);
74 74
 	ob_start();
75
-	if ( false === $args['week_view'] ) {
76
-		echo lsx_health_plan_day_plan_block( $args ); // WPCS: XSS OK.
75
+	if (false === $args['week_view']) {
76
+		echo lsx_health_plan_day_plan_block($args); // WPCS: XSS OK.
77 77
 	} else {
78
-		echo lsx_health_plan_week_plan_block( $args ); // WPCS: XSS OK.
78
+		echo lsx_health_plan_week_plan_block($args); // WPCS: XSS OK.
79 79
 	}
80 80
 	$content = ob_get_clean();
81 81
 	return $content;
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
  * @param array $args
88 88
  * @return void
89 89
  */
90
-function exercise_box( $args = array() ) {
90
+function exercise_box($args = array()) {
91 91
 	$defaults = array(
92 92
 		'include'       => '',
93 93
 		'term'          => '',
@@ -106,9 +106,9 @@  discard block
 block discarded – undo
106 106
 		'parent'        => false,
107 107
 		'modal_content' => 'excerpt',
108 108
 	);
109
-	$args     = wp_parse_args( $args, $defaults );
109
+	$args = wp_parse_args($args, $defaults);
110 110
 	ob_start();
111
-	echo lsx_health_plan_items( $args ); // WPCS: XSS OK.
111
+	echo lsx_health_plan_items($args); // WPCS: XSS OK.
112 112
 	$content = ob_get_clean();
113 113
 	return $content;
114 114
 }
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
 	echo lsx_health_plan_featured_video_block(); // WPCS: XSS OK.
124 124
 	$content = ob_get_clean();
125 125
 
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 );
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 128
 	return $content;
129 129
 }
130 130
 
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
 	ob_start();
138 138
 	echo lsx_health_plan_featured_recipes_block(); // WPCS: XSS OK.
139 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 );
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 142
 	return $content;
143 143
 }
144 144
 
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
 	ob_start();
152 152
 	echo lsx_health_plan_featured_tips_block(); // WPCS: XSS OK.
153 153
 	$content = ob_get_clean();
154
-	wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
155
-	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 );
154
+	wp_enqueue_script('slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array('jquery'), LSX_HEALTH_PLAN_VER, true);
155
+	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);
156 156
 	return $content;
157 157
 }
158 158
 
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
  */
164 164
 function account_notices() {
165 165
 	$content = '';
166
-	if ( function_exists( 'wc_print_notices' ) ) {
167
-		$content = wc_print_notices( true );
166
+	if (function_exists('wc_print_notices')) {
167
+		$content = wc_print_notices(true);
168 168
 	}
169 169
 	return $content;
170 170
 }
Please login to merge, or discard this patch.
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 /**
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
  */
54 54
 function all_plans_box( $args = array() ) {
55 55
 
56
-	ob_start();
57
-	echo lsx_health_plan_all_plans_block(); // WPCS: XSS OK.
58
-	$content = ob_get_clean();
59
-	return $content;
56
+     ob_start();
57
+     echo lsx_health_plan_all_plans_block(); // WPCS: XSS OK.
58
+     $content = ob_get_clean();
59
+     return $content;
60 60
 }
61 61
 
62 62
 /**
@@ -65,20 +65,20 @@  discard block
 block discarded – undo
65 65
  * @return void
66 66
  */
67 67
 function day_plan_box( $args = array() ) {
68
-	$defaults = array(
69
-		'week_view'      => false,
70
-		'show_downloads' => false,
71
-		'plan'           => '',
72
-	);
73
-	$args     = wp_parse_args( $args, $defaults );
74
-	ob_start();
75
-	if ( false === $args['week_view'] ) {
76
-		echo lsx_health_plan_day_plan_block( $args ); // WPCS: XSS OK.
77
-	} else {
78
-		echo lsx_health_plan_week_plan_block( $args ); // WPCS: XSS OK.
79
-	}
80
-	$content = ob_get_clean();
81
-	return $content;
68
+     $defaults = array(
69
+          'week_view'      => false,
70
+          'show_downloads' => false,
71
+          'plan'           => '',
72
+     );
73
+     $args     = wp_parse_args( $args, $defaults );
74
+     ob_start();
75
+     if ( false === $args['week_view'] ) {
76
+          echo lsx_health_plan_day_plan_block( $args ); // WPCS: XSS OK.
77
+     } else {
78
+          echo lsx_health_plan_week_plan_block( $args ); // WPCS: XSS OK.
79
+     }
80
+     $content = ob_get_clean();
81
+     return $content;
82 82
 }
83 83
 
84 84
 /**
@@ -88,29 +88,29 @@  discard block
 block discarded – undo
88 88
  * @return void
89 89
  */
90 90
 function exercise_box( $args = array() ) {
91
-	$defaults = array(
92
-		'include'       => '',
93
-		'term'          => '',
94
-		'taxonomy'      => '',
95
-		'view_more'     => false,
96
-		'columns'       => 3,
97
-		'limit'         => 4,
98
-		'post_type'     => 'exercise',
99
-		'orderby'       => 'date',
100
-		'order'         => 'DESC',
101
-		'description'   => 'none',
102
-		'link'          => 'item',
103
-		'link_class'    => 'btn border-btn',
104
-		'layout'        => 'grid',
105
-		'image_size'    => 'lsx-thumbnail-square',
106
-		'parent'        => false,
107
-		'modal_content' => 'excerpt',
108
-	);
109
-	$args     = wp_parse_args( $args, $defaults );
110
-	ob_start();
111
-	echo lsx_health_plan_items( $args ); // WPCS: XSS OK.
112
-	$content = ob_get_clean();
113
-	return $content;
91
+     $defaults = array(
92
+          'include'       => '',
93
+          'term'          => '',
94
+          'taxonomy'      => '',
95
+          'view_more'     => false,
96
+          'columns'       => 3,
97
+          'limit'         => 4,
98
+          'post_type'     => 'exercise',
99
+          'orderby'       => 'date',
100
+          'order'         => 'DESC',
101
+          'description'   => 'none',
102
+          'link'          => 'item',
103
+          'link_class'    => 'btn border-btn',
104
+          'layout'        => 'grid',
105
+          'image_size'    => 'lsx-thumbnail-square',
106
+          'parent'        => false,
107
+          'modal_content' => 'excerpt',
108
+     );
109
+     $args     = wp_parse_args( $args, $defaults );
110
+     ob_start();
111
+     echo lsx_health_plan_items( $args ); // WPCS: XSS OK.
112
+     $content = ob_get_clean();
113
+     return $content;
114 114
 }
115 115
 
116 116
 /**
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
  * @return void
120 120
  */
121 121
 function feature_video_box() {
122
-	ob_start();
123
-	echo lsx_health_plan_featured_video_block(); // WPCS: XSS OK.
124
-	$content = ob_get_clean();
122
+     ob_start();
123
+     echo lsx_health_plan_featured_video_block(); // WPCS: XSS OK.
124
+     $content = ob_get_clean();
125 125
 
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;
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
 block discarded – undo
134 134
  * @return void
135 135
  */
136 136
 function feature_recipes_box() {
137
-	ob_start();
138
-	echo lsx_health_plan_featured_recipes_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_recipes_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,12 +148,12 @@  discard block
 block discarded – undo
148 148
  * @return void
149 149
  */
150 150
 function feature_tips_box() {
151
-	ob_start();
152
-	echo lsx_health_plan_featured_tips_block(); // WPCS: XSS OK.
153
-	$content = ob_get_clean();
154
-	wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
155
-	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 );
156
-	return $content;
151
+     ob_start();
152
+     echo lsx_health_plan_featured_tips_block(); // WPCS: XSS OK.
153
+     $content = ob_get_clean();
154
+     wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
155
+     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 );
156
+     return $content;
157 157
 }
158 158
 
159 159
 /**
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
  * @return string
163 163
  */
164 164
 function account_notices() {
165
-	$content = '';
166
-	if ( function_exists( 'wc_print_notices' ) ) {
167
-		$content = wc_print_notices( true );
168
-	}
169
-	return $content;
165
+     $content = '';
166
+     if ( function_exists( 'wc_print_notices' ) ) {
167
+          $content = wc_print_notices( true );
168
+     }
169
+     return $content;
170 170
 }
Please login to merge, or discard this patch.
includes/template-tags/exercise.php 2 patches
Spacing   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
  * @return exercise_type
12 12
  */
13 13
 function lsx_health_plan_exercise_type() {
14
-	$term_obj_list = get_the_term_list( get_the_ID(), 'exercise-type', '', ', ' );
15
-	if ( ! empty( $term_obj_list ) ) {
14
+	$term_obj_list = get_the_term_list(get_the_ID(), 'exercise-type', '', ', ');
15
+	if ( ! empty($term_obj_list)) {
16 16
 		return $term_obj_list;
17 17
 	}
18 18
 }
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
  * @return muscle_group_equipment
24 24
  */
25 25
 function lsx_health_plan_muscle_group_equipment() {
26
-	$term_obj_list = get_the_term_list( get_the_ID(), 'muscle-group', '', ', ' );
27
-	if ( ! empty( $term_obj_list ) ) {
26
+	$term_obj_list = get_the_term_list(get_the_ID(), 'muscle-group', '', ', ');
27
+	if ( ! empty($term_obj_list)) {
28 28
 		return $term_obj_list;
29 29
 	}
30 30
 }
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
  * @return exercise_equipment
36 36
  */
37 37
 function lsx_health_plan_exercise_equipment() {
38
-	$term_obj_list = get_the_term_list( get_the_ID(), 'equipment', '', ', ' );
39
-	if ( ! empty( $term_obj_list ) ) {
38
+	$term_obj_list = get_the_term_list(get_the_ID(), 'equipment', '', ', ');
39
+	if ( ! empty($term_obj_list)) {
40 40
 		return $term_obj_list;
41 41
 	}
42 42
 }
@@ -50,74 +50,74 @@  discard block
 block discarded – undo
50 50
 	include LSX_HEALTH_PLAN_PATH . '/templates/table-exercise-data.php';
51 51
 }
52 52
 
53
-function lsx_health_plan_workout_exercise_alt_button( $m, $group, $echo = true, $args = array(), $alt_title, $alt_description, $alt_image ) {
53
+function lsx_health_plan_workout_exercise_alt_button($m, $group, $echo = true, $args = array(), $alt_title, $alt_description, $alt_image) {
54 54
 	$defaults = array(
55 55
 		'modal_trigger' => 'button',
56 56
 		'modal_content' => 'excerpt',
57 57
 	);
58
-	$args     = wp_parse_args( $args, $defaults );
58
+	$args = wp_parse_args($args, $defaults);
59 59
 
60 60
 	$exercise_id = '';
61
-	if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) {
62
-		$exercise_id     = esc_html( $group['connected_exercises'] );
63
-		$content         = get_post_field( 'post_content', $exercise_id );
64
-		$url             = get_permalink( $exercise_id );
65
-		$equipment_group = get_the_term_list( $exercise_id, 'equipment', '', ', ' );
66
-		$muscle_group    = get_the_term_list( $exercise_id, 'muscle-group', '', ', ' );
61
+	if (isset($group['connected_exercises']) && '' !== $group['connected_exercises']) {
62
+		$exercise_id     = esc_html($group['connected_exercises']);
63
+		$content         = get_post_field('post_content', $exercise_id);
64
+		$url             = get_permalink($exercise_id);
65
+		$equipment_group = get_the_term_list($exercise_id, 'equipment', '', ', ');
66
+		$muscle_group    = get_the_term_list($exercise_id, 'muscle-group', '', ', ');
67 67
 		$lsx_hp          = lsx_health_plan();
68 68
 
69
-		if ( 'excerpt' === $args['modal_content'] ) {
70
-			$content = wp_trim_words( $content, 40 );
69
+		if ('excerpt' === $args['modal_content']) {
70
+			$content = wp_trim_words($content, 40);
71 71
 		}
72 72
 
73
-		if ( 'link' ) {
74
-			$play_button = '<a data-toggle="modal" href="#workout-alt-exercise-modal-' . $m . '">' . get_the_title( $exercise_id ) . '</a>';
73
+		if ('link') {
74
+			$play_button = '<a data-toggle="modal" href="#workout-alt-exercise-modal-' . $m . '">' . get_the_title($exercise_id) . '</a>';
75 75
 		} else {
76 76
 			$play_button = '<button data-toggle="alt-modal" data-target="#workout-alt-exercise-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>';
77 77
 		}
78 78
 
79
-		$modal_body  = '';
79
+		$modal_body = '';
80 80
 
81
-		if ( '' !== $alt_image ) {
81
+		if ('' !== $alt_image) {
82 82
 			$modal_body .= '<div class="modal-image"/><img alt="thumbnail" loading="lazy" class="aligncenter wp-post-image" src="' . $alt_image . '"></div>';
83 83
 		} else {
84
-			if ( $lsx_hp->frontend->gallery->has_gallery( $exercise_id ) ) {
84
+			if ($lsx_hp->frontend->gallery->has_gallery($exercise_id)) {
85 85
 				$gallery_args = array(
86 86
 					'css_class' => 'modal-slider',
87 87
 				);
88
-				$modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args );
88
+				$modal_body .= $lsx_hp->frontend->gallery->get_gallery('', '', $gallery_args);
89 89
 			} else {
90
-				$modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail( $exercise_id, 'large' ) . '</div>';
90
+				$modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail($exercise_id, 'large') . '</div>';
91 91
 			}
92 92
 		}
93 93
 
94
-		if ( '' !== $alt_title ) {
94
+		if ('' !== $alt_title) {
95 95
 			$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . $alt_title . '</h5>';
96 96
 		} else {
97
-			$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title( $exercise_id ) . '</h5>';
97
+			$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title($exercise_id) . '</h5>';
98 98
 		}
99 99
 
100
-		if ( ! empty( $equipment_group ) ) {
100
+		if ( ! empty($equipment_group)) {
101 101
 			$modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>';
102 102
 		}
103
-		if ( ! empty( $muscle_group ) ) {
103
+		if ( ! empty($muscle_group)) {
104 104
 			$modal_body .= '<span class="muscle-terms">Muscle Group: ' . $muscle_group . '</span>';
105 105
 		}
106 106
 		$modal_body .= '</div>';
107
-		if ( '' !== $args['modal_content'] ) {
108
-			if ( '' !== $alt_description ) {
107
+		if ('' !== $args['modal_content']) {
108
+			if ('' !== $alt_description) {
109 109
 				$modal_body .= '<div class="modal-excerpt"/>' . $alt_description . '</div>';
110 110
 			} else {
111 111
 				$modal_body .= '<div class="modal-excerpt"/>' . $content . '</div>';
112 112
 			}
113 113
 		}
114
-		if ( 'excerpt' === $args['modal_content'] ) {
115
-			$modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __( 'Read More', 'lsx-heal-plan' ) . '</a>';
114
+		if ('excerpt' === $args['modal_content']) {
115
+			$modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __('Read More', 'lsx-heal-plan') . '</a>';
116 116
 		}
117
-		\lsx_health_plan\functions\register_modal( 'workout-alt-exercise-modal-' . $m, '', $modal_body );
117
+		\lsx_health_plan\functions\register_modal('workout-alt-exercise-modal-' . $m, '', $modal_body);
118 118
 
119
-		if ( true === $echo ) {
120
-			echo wp_kses_post( $play_button );
119
+		if (true === $echo) {
120
+			echo wp_kses_post($play_button);
121 121
 		} else {
122 122
 			return $play_button;
123 123
 		}
@@ -133,62 +133,62 @@  discard block
 block discarded – undo
133 133
  * @param array   $args
134 134
  * @return void
135 135
  */
136
-function lsx_health_plan_workout_exercise_button( $m, $group, $echo = true, $args = array() ) {
136
+function lsx_health_plan_workout_exercise_button($m, $group, $echo = true, $args = array()) {
137 137
 	$defaults = array(
138 138
 		'modal_trigger' => 'button',
139 139
 		'modal_content' => 'excerpt',
140 140
 	);
141
-	$args     = wp_parse_args( $args, $defaults );
141
+	$args = wp_parse_args($args, $defaults);
142 142
 
143 143
 	$exercise_id = '';
144
-	if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) {
145
-		$exercise_id     = esc_html( $group['connected_exercises'] );
146
-		$content         = get_post_field( 'post_content', $exercise_id );
147
-		$url             = get_permalink( $exercise_id );
148
-		$equipment_group = get_the_term_list( $exercise_id, 'equipment', '', ', ' );
149
-		$muscle_group    = get_the_term_list( $exercise_id, 'muscle-group', '', ', ' );
144
+	if (isset($group['connected_exercises']) && '' !== $group['connected_exercises']) {
145
+		$exercise_id     = esc_html($group['connected_exercises']);
146
+		$content         = get_post_field('post_content', $exercise_id);
147
+		$url             = get_permalink($exercise_id);
148
+		$equipment_group = get_the_term_list($exercise_id, 'equipment', '', ', ');
149
+		$muscle_group    = get_the_term_list($exercise_id, 'muscle-group', '', ', ');
150 150
 		$lsx_hp          = lsx_health_plan();
151 151
 
152
-		if ( 'excerpt' === $args['modal_content'] ) {
153
-			$content = wp_trim_words( $content, 40 );
152
+		if ('excerpt' === $args['modal_content']) {
153
+			$content = wp_trim_words($content, 40);
154 154
 		}
155 155
 
156
-		if ( 'link' ) {
157
-			$play_button = '<a data-toggle="modal" href="#workout-exercise-modal-' . $m . '">' . get_the_title( $exercise_id ) . '</a>';
156
+		if ('link') {
157
+			$play_button = '<a data-toggle="modal" href="#workout-exercise-modal-' . $m . '">' . get_the_title($exercise_id) . '</a>';
158 158
 		} else {
159 159
 			$play_button = '<button data-toggle="modal" data-target="#workout-exercise-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>';
160 160
 		}
161 161
 
162
-		$modal_body  = '';
162
+		$modal_body = '';
163 163
 
164
-		if ( $lsx_hp->frontend->gallery->has_gallery( $exercise_id ) ) {
164
+		if ($lsx_hp->frontend->gallery->has_gallery($exercise_id)) {
165 165
 			$gallery_args = array(
166 166
 				'css_class' => 'modal-slider',
167 167
 			);
168
-			$modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args );
168
+			$modal_body .= $lsx_hp->frontend->gallery->get_gallery('', '', $gallery_args);
169 169
 		} else {
170
-			$modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail( $exercise_id, 'large' ) . '</div>';
170
+			$modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail($exercise_id, 'large') . '</div>';
171 171
 		}
172 172
 
173
-		$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title( $exercise_id ) . '</h5>';
173
+		$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title($exercise_id) . '</h5>';
174 174
 
175
-		if ( ! empty( $equipment_group ) ) {
175
+		if ( ! empty($equipment_group)) {
176 176
 			$modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>';
177 177
 		}
178
-		if ( ! empty( $muscle_group ) ) {
178
+		if ( ! empty($muscle_group)) {
179 179
 			$modal_body .= '<span class="muscle-terms">Muscle Group: ' . $muscle_group . '</span>';
180 180
 		}
181 181
 		$modal_body .= '</div>';
182
-		if ( '' !== $args['modal_content'] ) {
182
+		if ('' !== $args['modal_content']) {
183 183
 			$modal_body .= '<div class="modal-excerpt"/>' . $content . '</div>';
184 184
 		}
185
-		if ( 'excerpt' === $args['modal_content'] ) {
186
-			$modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __( 'Read More', 'lsx-heal-plan' ) . '</a>';
185
+		if ('excerpt' === $args['modal_content']) {
186
+			$modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __('Read More', 'lsx-heal-plan') . '</a>';
187 187
 		}
188
-		\lsx_health_plan\functions\register_modal( 'workout-exercise-modal-' . $m, '', $modal_body );
188
+		\lsx_health_plan\functions\register_modal('workout-exercise-modal-' . $m, '', $modal_body);
189 189
 
190
-		if ( true === $echo ) {
191
-			echo wp_kses_post( $play_button );
190
+		if (true === $echo) {
191
+			echo wp_kses_post($play_button);
192 192
 		} else {
193 193
 			return $play_button;
194 194
 		}
@@ -202,39 +202,39 @@  discard block
 block discarded – undo
202 202
  * @param array $group
203 203
  * @return void
204 204
  */
205
-function lsx_health_plan_shortcode_exercise_button( $m, $content = true ) {
206
-	$equipment_group = get_the_term_list( $m, 'equipment', '', ', ' );
207
-	$muscle_group    = get_the_term_list( $m, 'muscle-group', '', ', ' );
205
+function lsx_health_plan_shortcode_exercise_button($m, $content = true) {
206
+	$equipment_group = get_the_term_list($m, 'equipment', '', ', ');
207
+	$muscle_group    = get_the_term_list($m, 'muscle-group', '', ', ');
208 208
 	$title           = get_the_title();
209 209
 	$lsx_hp          = lsx_health_plan();
210
-	$button     = '<a data-toggle="modal" href="#exercise-modal-' . $m . '" data-target="#exercise-modal-' . $m . '"></a>';
210
+	$button = '<a data-toggle="modal" href="#exercise-modal-' . $m . '" data-target="#exercise-modal-' . $m . '"></a>';
211 211
 
212
-	if ( true === $content ) {
212
+	if (true === $content) {
213 213
 		$content = get_the_content();
214 214
 	}
215 215
 
216 216
 	$modal_body = '';
217
-	if ( $lsx_hp->frontend->gallery->has_gallery( $m ) ) {
217
+	if ($lsx_hp->frontend->gallery->has_gallery($m)) {
218 218
 		$gallery_args = array(
219 219
 			'css_class' => 'modal-slider',
220 220
 		);
221
-		$modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args );
221
+		$modal_body .= $lsx_hp->frontend->gallery->get_gallery('', '', $gallery_args);
222 222
 	} else {
223
-		$modal_body .= '<div class="modal-image">' . get_the_post_thumbnail( $m, 'large' ) . '</div>';
223
+		$modal_body .= '<div class="modal-image">' . get_the_post_thumbnail($m, 'large') . '</div>';
224 224
 	}
225 225
 	$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . $title . '</h5>';
226 226
 
227
-	if ( ! empty( $equipment_group ) ) {
227
+	if ( ! empty($equipment_group)) {
228 228
 		$modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>';
229 229
 	}
230
-	if ( ! empty( $muscle_group ) ) {
230
+	if ( ! empty($muscle_group)) {
231 231
 		$modal_body .= '<span class="muscle-terms">Muscle Group: ' . $muscle_group . '</span>';
232 232
 	}
233 233
 	$modal_body .= '</div>';
234 234
 	$modal_body .= $content;
235
-	\lsx_health_plan\functions\register_modal( 'exercise-modal-' . $m, '', $modal_body );
235
+	\lsx_health_plan\functions\register_modal('exercise-modal-' . $m, '', $modal_body);
236 236
 
237
-	return ( $button );
237
+	return ($button);
238 238
 }
239 239
 
240 240
 /**
@@ -245,18 +245,18 @@  discard block
 block discarded – undo
245 245
  * @param  boolean $echo
246 246
  * @return string
247 247
  */
248
-function lsx_health_plan_exercise_title( $before = '', $after = '', $echo = true, $exercise_id = false ) {
249
-	if ( false === $exercise_id ) {
248
+function lsx_health_plan_exercise_title($before = '', $after = '', $echo = true, $exercise_id = false) {
249
+	if (false === $exercise_id) {
250 250
 		$exercise_id = get_the_ID();
251 251
 	}
252
-	$title = get_the_title( $exercise_id );
253
-	$side  = get_post_meta( $exercise_id, 'exercise_side', true );
254
-	if ( '' !== $side ) {
255
-		$title .= ' - ' . ucwords( $side );
252
+	$title = get_the_title($exercise_id);
253
+	$side  = get_post_meta($exercise_id, 'exercise_side', true);
254
+	if ('' !== $side) {
255
+		$title .= ' - ' . ucwords($side);
256 256
 	}
257
-	$title = apply_filters( 'lsx_health_plan_exercise_title', $before . $title . $after, $title, $before, $after, $exercise_id );
258
-	if ( true === $echo ) {
259
-		echo wp_kses_post( $title );
257
+	$title = apply_filters('lsx_health_plan_exercise_title', $before . $title . $after, $title, $before, $after, $exercise_id);
258
+	if (true === $echo) {
259
+		echo wp_kses_post($title);
260 260
 	} else {
261 261
 		return $title;
262 262
 	}
Please login to merge, or discard this patch.
Indentation   +169 added lines, -169 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@  discard block
 block discarded – undo
11 11
  * @return exercise_type
12 12
  */
13 13
 function lsx_health_plan_exercise_type() {
14
-	$term_obj_list = get_the_term_list( get_the_ID(), 'exercise-type', '', ', ' );
15
-	if ( ! empty( $term_obj_list ) ) {
16
-		return $term_obj_list;
17
-	}
14
+     $term_obj_list = get_the_term_list( get_the_ID(), 'exercise-type', '', ', ' );
15
+     if ( ! empty( $term_obj_list ) ) {
16
+          return $term_obj_list;
17
+     }
18 18
 }
19 19
 
20 20
 /**
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
  * @return muscle_group_equipment
24 24
  */
25 25
 function lsx_health_plan_muscle_group_equipment() {
26
-	$term_obj_list = get_the_term_list( get_the_ID(), 'muscle-group', '', ', ' );
27
-	if ( ! empty( $term_obj_list ) ) {
28
-		return $term_obj_list;
29
-	}
26
+     $term_obj_list = get_the_term_list( get_the_ID(), 'muscle-group', '', ', ' );
27
+     if ( ! empty( $term_obj_list ) ) {
28
+          return $term_obj_list;
29
+     }
30 30
 }
31 31
 
32 32
 /**
@@ -35,10 +35,10 @@  discard block
 block discarded – undo
35 35
  * @return exercise_equipment
36 36
  */
37 37
 function lsx_health_plan_exercise_equipment() {
38
-	$term_obj_list = get_the_term_list( get_the_ID(), 'equipment', '', ', ' );
39
-	if ( ! empty( $term_obj_list ) ) {
40
-		return $term_obj_list;
41
-	}
38
+     $term_obj_list = get_the_term_list( get_the_ID(), 'equipment', '', ', ' );
39
+     if ( ! empty( $term_obj_list ) ) {
40
+          return $term_obj_list;
41
+     }
42 42
 }
43 43
 
44 44
 /**
@@ -47,81 +47,81 @@  discard block
 block discarded – undo
47 47
  * @return void
48 48
  */
49 49
 function lsx_health_plan_exercise_data() {
50
-	include LSX_HEALTH_PLAN_PATH . '/templates/table-exercise-data.php';
50
+     include LSX_HEALTH_PLAN_PATH . '/templates/table-exercise-data.php';
51 51
 }
52 52
 
53 53
 function lsx_health_plan_workout_exercise_alt_button( $m, $group, $echo = true, $args = array(), $alt_title, $alt_description, $alt_image ) {
54
-	$defaults = array(
55
-		'modal_trigger' => 'button',
56
-		'modal_content' => 'excerpt',
57
-	);
58
-	$args     = wp_parse_args( $args, $defaults );
54
+     $defaults = array(
55
+          'modal_trigger' => 'button',
56
+          'modal_content' => 'excerpt',
57
+     );
58
+     $args     = wp_parse_args( $args, $defaults );
59 59
 
60
-	$exercise_id = '';
61
-	if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) {
62
-		$exercise_id     = esc_html( $group['connected_exercises'] );
63
-		$content         = get_post_field( 'post_content', $exercise_id );
64
-		$url             = get_permalink( $exercise_id );
65
-		$equipment_group = get_the_term_list( $exercise_id, 'equipment', '', ', ' );
66
-		$muscle_group    = get_the_term_list( $exercise_id, 'muscle-group', '', ', ' );
67
-		$lsx_hp          = lsx_health_plan();
60
+     $exercise_id = '';
61
+     if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) {
62
+          $exercise_id     = esc_html( $group['connected_exercises'] );
63
+          $content         = get_post_field( 'post_content', $exercise_id );
64
+          $url             = get_permalink( $exercise_id );
65
+          $equipment_group = get_the_term_list( $exercise_id, 'equipment', '', ', ' );
66
+          $muscle_group    = get_the_term_list( $exercise_id, 'muscle-group', '', ', ' );
67
+          $lsx_hp          = lsx_health_plan();
68 68
 
69
-		if ( 'excerpt' === $args['modal_content'] ) {
70
-			$content = wp_trim_words( $content, 40 );
71
-		}
69
+          if ( 'excerpt' === $args['modal_content'] ) {
70
+               $content = wp_trim_words( $content, 40 );
71
+          }
72 72
 
73
-		if ( 'link' ) {
74
-			$play_button = '<a data-toggle="modal" href="#workout-alt-exercise-modal-' . $m . '">' . get_the_title( $exercise_id ) . '</a>';
75
-		} else {
76
-			$play_button = '<button data-toggle="alt-modal" data-target="#workout-alt-exercise-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>';
77
-		}
73
+          if ( 'link' ) {
74
+               $play_button = '<a data-toggle="modal" href="#workout-alt-exercise-modal-' . $m . '">' . get_the_title( $exercise_id ) . '</a>';
75
+          } else {
76
+               $play_button = '<button data-toggle="alt-modal" data-target="#workout-alt-exercise-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>';
77
+          }
78 78
 
79
-		$modal_body  = '';
79
+          $modal_body  = '';
80 80
 
81
-		if ( '' !== $alt_image ) {
82
-			$modal_body .= '<div class="modal-image"/><img alt="thumbnail" loading="lazy" class="aligncenter wp-post-image" src="' . $alt_image . '"></div>';
83
-		} else {
84
-			if ( $lsx_hp->frontend->gallery->has_gallery( $exercise_id ) ) {
85
-				$gallery_args = array(
86
-					'css_class' => 'modal-slider',
87
-				);
88
-				$modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args );
89
-			} else {
90
-				$modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail( $exercise_id, 'large' ) . '</div>';
91
-			}
92
-		}
81
+          if ( '' !== $alt_image ) {
82
+               $modal_body .= '<div class="modal-image"/><img alt="thumbnail" loading="lazy" class="aligncenter wp-post-image" src="' . $alt_image . '"></div>';
83
+          } else {
84
+               if ( $lsx_hp->frontend->gallery->has_gallery( $exercise_id ) ) {
85
+                    $gallery_args = array(
86
+                         'css_class' => 'modal-slider',
87
+                    );
88
+                    $modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args );
89
+               } else {
90
+                    $modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail( $exercise_id, 'large' ) . '</div>';
91
+               }
92
+          }
93 93
 
94
-		if ( '' !== $alt_title ) {
95
-			$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . $alt_title . '</h5>';
96
-		} else {
97
-			$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title( $exercise_id ) . '</h5>';
98
-		}
94
+          if ( '' !== $alt_title ) {
95
+               $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . $alt_title . '</h5>';
96
+          } else {
97
+               $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title( $exercise_id ) . '</h5>';
98
+          }
99 99
 
100
-		if ( ! empty( $equipment_group ) ) {
101
-			$modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>';
102
-		}
103
-		if ( ! empty( $muscle_group ) ) {
104
-			$modal_body .= '<span class="muscle-terms">Muscle Group: ' . $muscle_group . '</span>';
105
-		}
106
-		$modal_body .= '</div>';
107
-		if ( '' !== $args['modal_content'] ) {
108
-			if ( '' !== $alt_description ) {
109
-				$modal_body .= '<div class="modal-excerpt"/>' . $alt_description . '</div>';
110
-			} else {
111
-				$modal_body .= '<div class="modal-excerpt"/>' . $content . '</div>';
112
-			}
113
-		}
114
-		if ( 'excerpt' === $args['modal_content'] ) {
115
-			$modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __( 'Read More', 'lsx-heal-plan' ) . '</a>';
116
-		}
117
-		\lsx_health_plan\functions\register_modal( 'workout-alt-exercise-modal-' . $m, '', $modal_body );
100
+          if ( ! empty( $equipment_group ) ) {
101
+               $modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>';
102
+          }
103
+          if ( ! empty( $muscle_group ) ) {
104
+               $modal_body .= '<span class="muscle-terms">Muscle Group: ' . $muscle_group . '</span>';
105
+          }
106
+          $modal_body .= '</div>';
107
+          if ( '' !== $args['modal_content'] ) {
108
+               if ( '' !== $alt_description ) {
109
+                    $modal_body .= '<div class="modal-excerpt"/>' . $alt_description . '</div>';
110
+               } else {
111
+                    $modal_body .= '<div class="modal-excerpt"/>' . $content . '</div>';
112
+               }
113
+          }
114
+          if ( 'excerpt' === $args['modal_content'] ) {
115
+               $modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __( 'Read More', 'lsx-heal-plan' ) . '</a>';
116
+          }
117
+          \lsx_health_plan\functions\register_modal( 'workout-alt-exercise-modal-' . $m, '', $modal_body );
118 118
 
119
-		if ( true === $echo ) {
120
-			echo wp_kses_post( $play_button );
121
-		} else {
122
-			return $play_button;
123
-		}
124
-	}
119
+          if ( true === $echo ) {
120
+               echo wp_kses_post( $play_button );
121
+          } else {
122
+               return $play_button;
123
+          }
124
+     }
125 125
 }
126 126
 
127 127
 /**
@@ -134,65 +134,65 @@  discard block
 block discarded – undo
134 134
  * @return void
135 135
  */
136 136
 function lsx_health_plan_workout_exercise_button( $m, $group, $echo = true, $args = array() ) {
137
-	$defaults = array(
138
-		'modal_trigger' => 'button',
139
-		'modal_content' => 'excerpt',
140
-	);
141
-	$args     = wp_parse_args( $args, $defaults );
137
+     $defaults = array(
138
+          'modal_trigger' => 'button',
139
+          'modal_content' => 'excerpt',
140
+     );
141
+     $args     = wp_parse_args( $args, $defaults );
142 142
 
143
-	$exercise_id = '';
144
-	if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) {
145
-		$exercise_id     = esc_html( $group['connected_exercises'] );
146
-		$content         = get_post_field( 'post_content', $exercise_id );
147
-		$url             = get_permalink( $exercise_id );
148
-		$equipment_group = get_the_term_list( $exercise_id, 'equipment', '', ', ' );
149
-		$muscle_group    = get_the_term_list( $exercise_id, 'muscle-group', '', ', ' );
150
-		$lsx_hp          = lsx_health_plan();
143
+     $exercise_id = '';
144
+     if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) {
145
+          $exercise_id     = esc_html( $group['connected_exercises'] );
146
+          $content         = get_post_field( 'post_content', $exercise_id );
147
+          $url             = get_permalink( $exercise_id );
148
+          $equipment_group = get_the_term_list( $exercise_id, 'equipment', '', ', ' );
149
+          $muscle_group    = get_the_term_list( $exercise_id, 'muscle-group', '', ', ' );
150
+          $lsx_hp          = lsx_health_plan();
151 151
 
152
-		if ( 'excerpt' === $args['modal_content'] ) {
153
-			$content = wp_trim_words( $content, 40 );
154
-		}
152
+          if ( 'excerpt' === $args['modal_content'] ) {
153
+               $content = wp_trim_words( $content, 40 );
154
+          }
155 155
 
156
-		if ( 'link' ) {
157
-			$play_button = '<a data-toggle="modal" href="#workout-exercise-modal-' . $m . '">' . get_the_title( $exercise_id ) . '</a>';
158
-		} else {
159
-			$play_button = '<button data-toggle="modal" data-target="#workout-exercise-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>';
160
-		}
156
+          if ( 'link' ) {
157
+               $play_button = '<a data-toggle="modal" href="#workout-exercise-modal-' . $m . '">' . get_the_title( $exercise_id ) . '</a>';
158
+          } else {
159
+               $play_button = '<button data-toggle="modal" data-target="#workout-exercise-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>';
160
+          }
161 161
 
162
-		$modal_body  = '';
162
+          $modal_body  = '';
163 163
 
164
-		if ( $lsx_hp->frontend->gallery->has_gallery( $exercise_id ) ) {
165
-			$gallery_args = array(
166
-				'css_class' => 'modal-slider',
167
-			);
168
-			$modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args );
169
-		} else {
170
-			$modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail( $exercise_id, 'large' ) . '</div>';
171
-		}
164
+          if ( $lsx_hp->frontend->gallery->has_gallery( $exercise_id ) ) {
165
+               $gallery_args = array(
166
+                    'css_class' => 'modal-slider',
167
+               );
168
+               $modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args );
169
+          } else {
170
+               $modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail( $exercise_id, 'large' ) . '</div>';
171
+          }
172 172
 
173
-		$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title( $exercise_id ) . '</h5>';
173
+          $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title( $exercise_id ) . '</h5>';
174 174
 
175
-		if ( ! empty( $equipment_group ) ) {
176
-			$modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>';
177
-		}
178
-		if ( ! empty( $muscle_group ) ) {
179
-			$modal_body .= '<span class="muscle-terms">Muscle Group: ' . $muscle_group . '</span>';
180
-		}
181
-		$modal_body .= '</div>';
182
-		if ( '' !== $args['modal_content'] ) {
183
-			$modal_body .= '<div class="modal-excerpt"/>' . $content . '</div>';
184
-		}
185
-		if ( 'excerpt' === $args['modal_content'] ) {
186
-			$modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __( 'Read More', 'lsx-heal-plan' ) . '</a>';
187
-		}
188
-		\lsx_health_plan\functions\register_modal( 'workout-exercise-modal-' . $m, '', $modal_body );
175
+          if ( ! empty( $equipment_group ) ) {
176
+               $modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>';
177
+          }
178
+          if ( ! empty( $muscle_group ) ) {
179
+               $modal_body .= '<span class="muscle-terms">Muscle Group: ' . $muscle_group . '</span>';
180
+          }
181
+          $modal_body .= '</div>';
182
+          if ( '' !== $args['modal_content'] ) {
183
+               $modal_body .= '<div class="modal-excerpt"/>' . $content . '</div>';
184
+          }
185
+          if ( 'excerpt' === $args['modal_content'] ) {
186
+               $modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __( 'Read More', 'lsx-heal-plan' ) . '</a>';
187
+          }
188
+          \lsx_health_plan\functions\register_modal( 'workout-exercise-modal-' . $m, '', $modal_body );
189 189
 
190
-		if ( true === $echo ) {
191
-			echo wp_kses_post( $play_button );
192
-		} else {
193
-			return $play_button;
194
-		}
195
-	}
190
+          if ( true === $echo ) {
191
+               echo wp_kses_post( $play_button );
192
+          } else {
193
+               return $play_button;
194
+          }
195
+     }
196 196
 }
197 197
 
198 198
 /**
@@ -203,38 +203,38 @@  discard block
 block discarded – undo
203 203
  * @return void
204 204
  */
205 205
 function lsx_health_plan_shortcode_exercise_button( $m, $content = true ) {
206
-	$equipment_group = get_the_term_list( $m, 'equipment', '', ', ' );
207
-	$muscle_group    = get_the_term_list( $m, 'muscle-group', '', ', ' );
208
-	$title           = get_the_title();
209
-	$lsx_hp          = lsx_health_plan();
210
-	$button     = '<a data-toggle="modal" href="#exercise-modal-' . $m . '" data-target="#exercise-modal-' . $m . '"></a>';
206
+     $equipment_group = get_the_term_list( $m, 'equipment', '', ', ' );
207
+     $muscle_group    = get_the_term_list( $m, 'muscle-group', '', ', ' );
208
+     $title           = get_the_title();
209
+     $lsx_hp          = lsx_health_plan();
210
+     $button     = '<a data-toggle="modal" href="#exercise-modal-' . $m . '" data-target="#exercise-modal-' . $m . '"></a>';
211 211
 
212
-	if ( true === $content ) {
213
-		$content = get_the_content();
214
-	}
212
+     if ( true === $content ) {
213
+          $content = get_the_content();
214
+     }
215 215
 
216
-	$modal_body = '';
217
-	if ( $lsx_hp->frontend->gallery->has_gallery( $m ) ) {
218
-		$gallery_args = array(
219
-			'css_class' => 'modal-slider',
220
-		);
221
-		$modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args );
222
-	} else {
223
-		$modal_body .= '<div class="modal-image">' . get_the_post_thumbnail( $m, 'large' ) . '</div>';
224
-	}
225
-	$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . $title . '</h5>';
216
+     $modal_body = '';
217
+     if ( $lsx_hp->frontend->gallery->has_gallery( $m ) ) {
218
+          $gallery_args = array(
219
+               'css_class' => 'modal-slider',
220
+          );
221
+          $modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args );
222
+     } else {
223
+          $modal_body .= '<div class="modal-image">' . get_the_post_thumbnail( $m, 'large' ) . '</div>';
224
+     }
225
+     $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . $title . '</h5>';
226 226
 
227
-	if ( ! empty( $equipment_group ) ) {
228
-		$modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>';
229
-	}
230
-	if ( ! empty( $muscle_group ) ) {
231
-		$modal_body .= '<span class="muscle-terms">Muscle Group: ' . $muscle_group . '</span>';
232
-	}
233
-	$modal_body .= '</div>';
234
-	$modal_body .= $content;
235
-	\lsx_health_plan\functions\register_modal( 'exercise-modal-' . $m, '', $modal_body );
227
+     if ( ! empty( $equipment_group ) ) {
228
+          $modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>';
229
+     }
230
+     if ( ! empty( $muscle_group ) ) {
231
+          $modal_body .= '<span class="muscle-terms">Muscle Group: ' . $muscle_group . '</span>';
232
+     }
233
+     $modal_body .= '</div>';
234
+     $modal_body .= $content;
235
+     \lsx_health_plan\functions\register_modal( 'exercise-modal-' . $m, '', $modal_body );
236 236
 
237
-	return ( $button );
237
+     return ( $button );
238 238
 }
239 239
 
240 240
 /**
@@ -246,18 +246,18 @@  discard block
 block discarded – undo
246 246
  * @return string
247 247
  */
248 248
 function lsx_health_plan_exercise_title( $before = '', $after = '', $echo = true, $exercise_id = false ) {
249
-	if ( false === $exercise_id ) {
250
-		$exercise_id = get_the_ID();
251
-	}
252
-	$title = get_the_title( $exercise_id );
253
-	$side  = get_post_meta( $exercise_id, 'exercise_side', true );
254
-	if ( '' !== $side ) {
255
-		$title .= ' - ' . ucwords( $side );
256
-	}
257
-	$title = apply_filters( 'lsx_health_plan_exercise_title', $before . $title . $after, $title, $before, $after, $exercise_id );
258
-	if ( true === $echo ) {
259
-		echo wp_kses_post( $title );
260
-	} else {
261
-		return $title;
262
-	}
249
+     if ( false === $exercise_id ) {
250
+          $exercise_id = get_the_ID();
251
+     }
252
+     $title = get_the_title( $exercise_id );
253
+     $side  = get_post_meta( $exercise_id, 'exercise_side', true );
254
+     if ( '' !== $side ) {
255
+          $title .= ' - ' . ucwords( $side );
256
+     }
257
+     $title = apply_filters( 'lsx_health_plan_exercise_title', $before . $title . $after, $title, $before, $after, $exercise_id );
258
+     if ( true === $echo ) {
259
+          echo wp_kses_post( $title );
260
+     } else {
261
+          return $title;
262
+     }
263 263
 }
Please login to merge, or discard this patch.
includes/template-tags/woocommerce.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
 	global $product;
11 11
 
12 12
 	$restricted = false;
13
-	if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) {
14
-		$restricted = wc_memberships_is_post_content_restricted() && ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
13
+	if (function_exists('wc_memberships_is_post_content_restricted')) {
14
+		$restricted = wc_memberships_is_post_content_restricted() && ! current_user_can('wc_memberships_view_restricted_post_content', get_the_ID());
15 15
 	}
16
-	if ( true === $restricted && \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
16
+	if (true === $restricted && \lsx_health_plan\functions\woocommerce\plan_has_products()) {
17 17
 		$products      = \lsx_health_plan\functions\woocommerce\get_plan_products();
18
-		$product_count = count( $products );
19
-		if ( 1 === (int) $product_count ) {
18
+		$product_count = count($products);
19
+		if (1 === (int) $product_count) {
20 20
 			$class = 'col-md-12';
21 21
 		} else {
22 22
 			$class = 'col-md-6';
@@ -24,25 +24,25 @@  discard block
 block discarded – undo
24 24
 		?>
25 25
 			<div class="plans-products-wrapper row">
26 26
 				<?php
27
-				foreach ( $products as $product ) {
28
-					$product = wc_get_product( $product );
27
+				foreach ($products as $product) {
28
+					$product = wc_get_product($product);
29 29
 					?>
30
-						<div class="plan-product <?php echo esc_attr( $class ); ?>">
31
-							<h3 class="title"><a href="<?php echo esc_html( $product->get_permalink() ); ?>"><?php echo esc_html( $product->get_title() ); ?></a></h3>
30
+						<div class="plan-product <?php echo esc_attr($class); ?>">
31
+							<h3 class="title"><a href="<?php echo esc_html($product->get_permalink()); ?>"><?php echo esc_html($product->get_title()); ?></a></h3>
32 32
 							<?php
33
-							$description = $product->is_type( 'variation' ) ? $product->get_description() : $product->get_short_description();
34
-							if ( '' !== $description ) {
33
+							$description = $product->is_type('variation') ? $product->get_description() : $product->get_short_description();
34
+							if ('' !== $description) {
35 35
 								?>
36 36
 									<div class="description">
37
-										<?php echo esc_html( $description ); ?>
37
+										<?php echo esc_html($description); ?>
38 38
 									</div>
39 39
 								<?php
40 40
 							}
41 41
 							?>
42
-							<?php echo wp_kses_post( $product->get_price_html() ); ?>
42
+							<?php echo wp_kses_post($product->get_price_html()); ?>
43 43
 
44 44
 							<div class="add-to-cart">
45
-								<a class="btn cta-btn" href="<?php echo esc_attr( $product->add_to_cart_url() ); ?>"><?php echo esc_attr( $product->add_to_cart_text() ); ?></a>
45
+								<a class="btn cta-btn" href="<?php echo esc_attr($product->add_to_cart_url()); ?>"><?php echo esc_attr($product->add_to_cart_text()); ?></a>
46 46
 							</div>
47 47
 						</div>
48 48
 					<?php
Please login to merge, or discard this patch.
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -7,38 +7,38 @@  discard block
 block discarded – undo
7 7
 
8 8
 
9 9
 function lsx_hp_single_plan_products() {
10
-	global $product;
10
+     global $product;
11 11
 
12
-	$restricted = false;
13
-	if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) {
14
-		$restricted = wc_memberships_is_post_content_restricted() && ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
15
-	}
16
-	if ( true === $restricted && \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
17
-		$products      = \lsx_health_plan\functions\woocommerce\get_plan_products();
18
-		$product_count = count( $products );
19
-		if ( 1 === (int) $product_count ) {
20
-			$class = 'col-md-12';
21
-		} else {
22
-			$class = 'col-md-6';
23
-		}
24
-		?>
12
+     $restricted = false;
13
+     if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) {
14
+          $restricted = wc_memberships_is_post_content_restricted() && ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
15
+     }
16
+     if ( true === $restricted && \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
17
+          $products      = \lsx_health_plan\functions\woocommerce\get_plan_products();
18
+          $product_count = count( $products );
19
+          if ( 1 === (int) $product_count ) {
20
+               $class = 'col-md-12';
21
+          } else {
22
+               $class = 'col-md-6';
23
+          }
24
+          ?>
25 25
 			<div class="plans-products-wrapper row">
26 26
 				<?php
27
-				foreach ( $products as $product ) {
28
-					$product = wc_get_product( $product );
29
-					?>
27
+                    foreach ( $products as $product ) {
28
+                         $product = wc_get_product( $product );
29
+                         ?>
30 30
 						<div class="plan-product <?php echo esc_attr( $class ); ?>">
31 31
 							<h3 class="title"><a href="<?php echo esc_html( $product->get_permalink() ); ?>"><?php echo esc_html( $product->get_title() ); ?></a></h3>
32 32
 							<?php
33
-							$description = $product->is_type( 'variation' ) ? $product->get_description() : $product->get_short_description();
34
-							if ( '' !== $description ) {
35
-								?>
33
+                                   $description = $product->is_type( 'variation' ) ? $product->get_description() : $product->get_short_description();
34
+                                   if ( '' !== $description ) {
35
+                                        ?>
36 36
 									<div class="description">
37 37
 										<?php echo esc_html( $description ); ?>
38 38
 									</div>
39 39
 								<?php
40
-							}
41
-							?>
40
+                                   }
41
+                                   ?>
42 42
 							<?php echo wp_kses_post( $product->get_price_html() ); ?>
43 43
 
44 44
 							<div class="add-to-cart">
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
 							</div>
47 47
 						</div>
48 48
 					<?php
49
-				}
50
-				?>
49
+                    }
50
+                    ?>
51 51
 			</div>
52 52
 		<?php
53
-	}
53
+     }
54 54
 }
Please login to merge, or discard this patch.
includes/functions/woocommerce.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 function plan_has_products() {
16 16
 	$lsx_hp       = lsx_health_plan();
17 17
 	$has_products = false;
18
-	if ( ! empty( $lsx_hp->integrations->woocommerce->plans->product_ids ) ) {
18
+	if ( ! empty($lsx_hp->integrations->woocommerce->plans->product_ids)) {
19 19
 		$has_products = true;
20 20
 	}
21 21
 	return $has_products;
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 function get_plan_products() {
30 30
 	$lsx_hp       = lsx_health_plan();
31 31
 	$has_products = array();
32
-	if ( ! empty( $lsx_hp->integrations->woocommerce->plans->product_ids ) ) {
32
+	if ( ! empty($lsx_hp->integrations->woocommerce->plans->product_ids)) {
33 33
 		$has_products = $lsx_hp->integrations->woocommerce->plans->product_ids;
34 34
 	}
35 35
 	return $has_products;
@@ -42,20 +42,20 @@  discard block
 block discarded – undo
42 42
  */
43 43
 function get_membership_products() {
44 44
 	$product_ids = array();
45
-	if ( function_exists( 'wc_memberships_get_user_memberships' ) ) {
45
+	if (function_exists('wc_memberships_get_user_memberships')) {
46 46
 		$user_memberships = wc_memberships_get_user_memberships();
47 47
 
48
-		if ( ! empty( $user_memberships ) ) {
49
-			foreach ( $user_memberships as $membership ) {
48
+		if ( ! empty($user_memberships)) {
49
+			foreach ($user_memberships as $membership) {
50 50
 				$current_products = $membership->plan->get_product_ids();
51
-				if ( ! empty( $current_products ) ) {
52
-					$product_ids = array_merge( $product_ids, $current_products );
51
+				if ( ! empty($current_products)) {
52
+					$product_ids = array_merge($product_ids, $current_products);
53 53
 				}
54 54
 			}
55 55
 		}
56 56
 	}
57
-	if ( ! empty( $product_ids ) ) {
58
-		$product_ids = array_unique( $product_ids );
57
+	if ( ! empty($product_ids)) {
58
+		$product_ids = array_unique($product_ids);
59 59
 	}
60 60
 	return $product_ids;
61 61
 }
Please login to merge, or discard this patch.
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -13,12 +13,12 @@  discard block
 block discarded – undo
13 13
  * @return boolean
14 14
  */
15 15
 function plan_has_products() {
16
-	$lsx_hp       = lsx_health_plan();
17
-	$has_products = false;
18
-	if ( ! empty( $lsx_hp->integrations->woocommerce->plans->product_ids ) ) {
19
-		$has_products = true;
20
-	}
21
-	return $has_products;
16
+     $lsx_hp       = lsx_health_plan();
17
+     $has_products = false;
18
+     if ( ! empty( $lsx_hp->integrations->woocommerce->plans->product_ids ) ) {
19
+          $has_products = true;
20
+     }
21
+     return $has_products;
22 22
 }
23 23
 
24 24
 /**
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
  * @return array
28 28
  */
29 29
 function get_plan_products() {
30
-	$lsx_hp       = lsx_health_plan();
31
-	$has_products = array();
32
-	if ( ! empty( $lsx_hp->integrations->woocommerce->plans->product_ids ) ) {
33
-		$has_products = $lsx_hp->integrations->woocommerce->plans->product_ids;
34
-	}
35
-	return $has_products;
30
+     $lsx_hp       = lsx_health_plan();
31
+     $has_products = array();
32
+     if ( ! empty( $lsx_hp->integrations->woocommerce->plans->product_ids ) ) {
33
+          $has_products = $lsx_hp->integrations->woocommerce->plans->product_ids;
34
+     }
35
+     return $has_products;
36 36
 }
37 37
 
38 38
 /**
@@ -41,21 +41,21 @@  discard block
 block discarded – undo
41 41
  * @return array
42 42
  */
43 43
 function get_membership_products() {
44
-	$product_ids = array();
45
-	if ( function_exists( 'wc_memberships_get_user_memberships' ) ) {
46
-		$user_memberships = wc_memberships_get_user_memberships();
44
+     $product_ids = array();
45
+     if ( function_exists( 'wc_memberships_get_user_memberships' ) ) {
46
+          $user_memberships = wc_memberships_get_user_memberships();
47 47
 
48
-		if ( ! empty( $user_memberships ) ) {
49
-			foreach ( $user_memberships as $membership ) {
50
-				$current_products = $membership->plan->get_product_ids();
51
-				if ( ! empty( $current_products ) ) {
52
-					$product_ids = array_merge( $product_ids, $current_products );
53
-				}
54
-			}
55
-		}
56
-	}
57
-	if ( ! empty( $product_ids ) ) {
58
-		$product_ids = array_unique( $product_ids );
59
-	}
60
-	return $product_ids;
48
+          if ( ! empty( $user_memberships ) ) {
49
+               foreach ( $user_memberships as $membership ) {
50
+                    $current_products = $membership->plan->get_product_ids();
51
+                    if ( ! empty( $current_products ) ) {
52
+                         $product_ids = array_merge( $product_ids, $current_products );
53
+                    }
54
+               }
55
+          }
56
+     }
57
+     if ( ! empty( $product_ids ) ) {
58
+          $product_ids = array_unique( $product_ids );
59
+     }
60
+     return $product_ids;
61 61
 }
Please login to merge, or discard this patch.
includes/functions/recipes.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@
 block discarded – undo
14 14
  * @return boolean
15 15
  */
16 16
 function register_recipe_modal() {
17
-	remove_action( 'lsx_content_sharing', 'lsx_sharing_output', 20 );
17
+	remove_action('lsx_content_sharing', 'lsx_sharing_output', 20);
18 18
 	ob_start();
19 19
 	include LSX_HEALTH_PLAN_PATH . '/templates/content-recipe.php';
20 20
 	$modal_body = ob_get_clean();
21
-	add_action( 'lsx_content_sharing', 'lsx_sharing_output', 20 );
22
-	\lsx_health_plan\functions\register_modal( 'recipe-modal-' . get_the_ID(), '', $modal_body );
21
+	add_action('lsx_content_sharing', 'lsx_sharing_output', 20);
22
+	\lsx_health_plan\functions\register_modal('recipe-modal-' . get_the_ID(), '', $modal_body);
23 23
 }
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@
 block discarded – undo
14 14
  * @return boolean
15 15
  */
16 16
 function register_recipe_modal() {
17
-	remove_action( 'lsx_content_sharing', 'lsx_sharing_output', 20 );
18
-	ob_start();
19
-	include LSX_HEALTH_PLAN_PATH . '/templates/content-recipe.php';
20
-	$modal_body = ob_get_clean();
21
-	add_action( 'lsx_content_sharing', 'lsx_sharing_output', 20 );
22
-	\lsx_health_plan\functions\register_modal( 'recipe-modal-' . get_the_ID(), '', $modal_body );
17
+     remove_action( 'lsx_content_sharing', 'lsx_sharing_output', 20 );
18
+     ob_start();
19
+     include LSX_HEALTH_PLAN_PATH . '/templates/content-recipe.php';
20
+     $modal_body = ob_get_clean();
21
+     add_action( 'lsx_content_sharing', 'lsx_sharing_output', 20 );
22
+     \lsx_health_plan\functions\register_modal( 'recipe-modal-' . get_the_ID(), '', $modal_body );
23 23
 }
Please login to merge, or discard this patch.
templates/page-template-my-plan.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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,33 +32,33 @@  discard block
 block discarded – undo
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 Plan', '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 Plan', '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
-							$my_profile_string  = esc_html__( 'My Profile', 'lsx-health-plan' );
58
-							$my_profile_tagline = esc_html__( 'Update your details below', 'lsx-health-plan' );
59
-							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>' );
60
-						} else if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'lost-password' ) ) {
61
-							echo do_shortcode( '[woocommerce_my_account]' );
57
+							$my_profile_string  = esc_html__('My Profile', 'lsx-health-plan');
58
+							$my_profile_tagline = esc_html__('Update your details below', 'lsx-health-plan');
59
+							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>');
60
+						} else if (function_exists('is_wc_endpoint_url') && is_wc_endpoint_url('lost-password')) {
61
+							echo do_shortcode('[woocommerce_my_account]');
62 62
 						} else {
63 63
 							the_content();
64 64
 						}
Please login to merge, or discard this patch.
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -32,37 +32,37 @@
 block discarded – undo
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' ) ) {
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'] );
42
-									}
43
-								}
44
-							} elseif ( in_array( 'has-block-cover', $classes ) ) {
45
-								$blocks = parse_blocks( get_the_content() );
46
-								foreach ( $blocks as $block ) {
47
-									//print( '<pre>' . print_r( $block, true ) . '</pre>' );
48
-									if ( 'core/cover' === $block['blockName'] ) {
49
-										echo wp_kses_post( render_block( $block ) );
50
-									}
51
-								}
52
-							} else {
53
-								$my_plan_string = esc_html__( 'My Plan', '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
-							}
56
-
57
-							$my_profile_string  = esc_html__( 'My Profile', 'lsx-health-plan' );
58
-							$my_profile_tagline = esc_html__( 'Update your details below', 'lsx-health-plan' );
59
-							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>' );
60
-						} else if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'lost-password' ) ) {
61
-							echo do_shortcode( '[woocommerce_my_account]' );
62
-						} else {
63
-							the_content();
64
-						}
65
-						?>
35
+                              if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'edit-account' ) ) {
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'] );
42
+                                             }
43
+                                        }
44
+                                   } elseif ( in_array( 'has-block-cover', $classes ) ) {
45
+                                        $blocks = parse_blocks( get_the_content() );
46
+                                        foreach ( $blocks as $block ) {
47
+                                             //print( '<pre>' . print_r( $block, true ) . '</pre>' );
48
+                                             if ( 'core/cover' === $block['blockName'] ) {
49
+                                                  echo wp_kses_post( render_block( $block ) );
50
+                                             }
51
+                                        }
52
+                                   } else {
53
+                                        $my_plan_string = esc_html__( 'My Plan', '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
+                                   }
56
+
57
+                                   $my_profile_string  = esc_html__( 'My Profile', 'lsx-health-plan' );
58
+                                   $my_profile_tagline = esc_html__( 'Update your details below', 'lsx-health-plan' );
59
+                                   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>' );
60
+                              } else if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'lost-password' ) ) {
61
+                                   echo do_shortcode( '[woocommerce_my_account]' );
62
+                              } else {
63
+                                   the_content();
64
+                              }
65
+                              ?>
66 66
 					</div><!-- .entry-content -->
67 67
 
68 68
 					<?php lsx_entry_bottom(); ?>
Please login to merge, or discard this patch.
templates/taxonomy-recipe-cuisine.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
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 ( current_user_can( 'wc_memberships_view_restricted_post_content', $post_id ) ) {
23
+		if (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
 block discarded – undo
28 28
 
29 29
 				<div class="post-wrapper 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
 block discarded – undo
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
 block discarded – undo
52 52
 
53 53
 			<?php
54 54
 		} else {
55
-			wp_redirect( $redirect );
55
+			wp_redirect($redirect);
56 56
 			exit;
57 57
 		}
58 58
 		?>
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,9 +38,12 @@
 block discarded – undo
38 38
 
39 39
 							<?php endwhile; ?>
40 40
 
41
-						<?php else : ?>
41
+						<?php else {
42
+     : ?>
42 43
 
43
-							<?php get_template_part( 'partials/content', 'none' ); ?>
44
+							<?php get_template_part( 'partials/content', 'none' );
45
+}
46
+?>
44 47
 
45 48
 						<?php endif; ?>
46 49
 					</div>
Please login to merge, or discard this patch.