Passed
Push — master ( 903e32...f43b43 )
by Warwick
07:01
created
templates/content-archive-recipe.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
13 13
 $column_class = '4';
14 14
 // Check for shortcode overrides.
15 15
 if ( null !== $shortcode_args ) {
16
-	if ( isset( $shortcode_args['columns'] ) ) {
17
-		$column_class = $shortcode_args['columns'];
18
-		$column_class = \lsx_health_plan\functions\column_class( $column_class );
19
-	}
16
+     if ( isset( $shortcode_args['columns'] ) ) {
17
+          $column_class = $shortcode_args['columns'];
18
+          $column_class = \lsx_health_plan\functions\column_class( $column_class );
19
+     }
20 20
 }
21 21
 ?>
22 22
 
@@ -29,17 +29,17 @@  discard block
 block discarded – undo
29 29
 		<div class="recipe-feature-img">
30 30
 			<a href="<?php echo esc_url( get_permalink() ); ?>">
31 31
 			<?php
32
-			$featured_image = get_the_post_thumbnail();
33
-			if ( ! empty( $featured_image ) && '' !== $featured_image ) {
34
-				the_post_thumbnail( 'lsx-thumbnail-square', array(
35
-					'class' => 'aligncenter',
36
-				) );
37
-			} else {
38
-				?>
32
+               $featured_image = get_the_post_thumbnail();
33
+               if ( ! empty( $featured_image ) && '' !== $featured_image ) {
34
+                    the_post_thumbnail( 'lsx-thumbnail-square', array(
35
+                         'class' => 'aligncenter',
36
+                    ) );
37
+               } else {
38
+                    ?>
39 39
 				<img loading="lazy" class="placeholder" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>">
40 40
 				<?php
41
-			}
42
-			?>
41
+               }
42
+               ?>
43 43
 			</a>
44 44
 		</div>
45 45
 		<div class="content-box white-bg">
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -12,31 +12,31 @@  discard block
 block discarded – undo
12 12
 <?php
13 13
 $column_class = '4';
14 14
 // Check for shortcode overrides.
15
-if ( null !== $shortcode_args ) {
16
-	if ( isset( $shortcode_args['columns'] ) ) {
15
+if (null !== $shortcode_args) {
16
+	if (isset($shortcode_args['columns'])) {
17 17
 		$column_class = $shortcode_args['columns'];
18
-		$column_class = \lsx_health_plan\functions\column_class( $column_class );
18
+		$column_class = \lsx_health_plan\functions\column_class($column_class);
19 19
 	}
20 20
 }
21 21
 ?>
22 22
 
23
-<div class="col-xs-12 col-sm-6 col-md-<?php echo esc_attr( $column_class ); ?>">
23
+<div class="col-xs-12 col-sm-6 col-md-<?php echo esc_attr($column_class); ?>">
24 24
 	<article class="lsx-slot box-shadow">
25 25
 		<?php lsx_entry_top(); ?>
26 26
 
27 27
 		<?php lsx_hp_recipe_plan_meta(); ?>
28 28
 
29 29
 		<div class="recipe-feature-img">
30
-			<a href="<?php echo esc_url( get_permalink() ); ?>">
30
+			<a href="<?php echo esc_url(get_permalink()); ?>">
31 31
 			<?php
32 32
 			$featured_image = get_the_post_thumbnail();
33
-			if ( ! empty( $featured_image ) && '' !== $featured_image ) {
34
-				the_post_thumbnail( 'lsx-thumbnail-square', array(
33
+			if ( ! empty($featured_image) && '' !== $featured_image) {
34
+				the_post_thumbnail('lsx-thumbnail-square', array(
35 35
 					'class' => 'aligncenter',
36
-				) );
36
+				));
37 37
 			} else {
38 38
 				?>
39
-				<img loading="lazy" class="placeholder" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>">
39
+				<img loading="lazy" class="placeholder" src="<?php echo esc_attr(plugin_dir_url(__FILE__) . '../assets/images/placeholder.jpg'); ?>">
40 40
 				<?php
41 41
 			}
42 42
 			?>
@@ -44,10 +44,10 @@  discard block
 block discarded – undo
44 44
 		</div>
45 45
 		<div class="content-box white-bg">
46 46
 			<?php lsx_health_plan_recipe_data(); ?>
47
-			<a class="recipe-title-link" href="<?php echo esc_url( get_permalink() ); ?>">
48
-				<?php the_title( '<h3 class="recipe-title">', '</h3>' ); ?>
47
+			<a class="recipe-title-link" href="<?php echo esc_url(get_permalink()); ?>">
48
+				<?php the_title('<h3 class="recipe-title">', '</h3>'); ?>
49 49
 			</a>
50
-			<a href="<?php echo esc_url( get_permalink() ); ?>" class="btn border-btn"><?php esc_html_e( 'See Recipe', 'lsx-health-plan' ); ?></a>
50
+			<a href="<?php echo esc_url(get_permalink()); ?>" class="btn border-btn"><?php esc_html_e('See Recipe', 'lsx-health-plan'); ?></a>
51 51
 		</div>
52 52
 		<?php lsx_entry_bottom(); ?>
53 53
 	</article>
Please login to merge, or discard this patch.
includes/template-tags.php 3 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1143,7 +1143,9 @@
 block discarded – undo
1143 1143
 						</article>
1144 1144
 
1145 1145
 					<?php
1146
-					if (++$i === 3) break;
1146
+					if (++$i === 3) {
1147
+					     break;
1148
+					}
1147 1149
 					} ?>
1148 1150
 				</div>
1149 1151
 			</div>
Please login to merge, or discard this patch.
Indentation   +627 added lines, -627 removed lines patch added patch discarded remove patch
@@ -11,29 +11,29 @@  discard block
 block discarded – undo
11 11
 * @return void
12 12
 */
13 13
 function lsx_health_plan_workout_box() {
14
-	if ( ! post_type_exists( 'workout' ) ) {
15
-		return;
16
-	}
17
-	$intro_text = \lsx_health_plan\functions\get_option( 'workout_intro', false );
18
-	?>
14
+     if ( ! post_type_exists( 'workout' ) ) {
15
+          return;
16
+     }
17
+     $intro_text = \lsx_health_plan\functions\get_option( 'workout_intro', false );
18
+     ?>
19 19
 	<div class="workout-instructions">
20 20
 		<div class="row">
21 21
 			<div class="col-md-12">
22 22
 			<?php
23
-			if ( false !== $intro_text ) {
24
-				?>
23
+               if ( false !== $intro_text ) {
24
+                    ?>
25 25
 				<div class="excerpt">
26 26
 					<p><?php echo wp_kses_post( wpautop( $intro_text ) ); ?></p>
27 27
 				</div>
28 28
 				<?php
29
-			} else {
30
-				?>
29
+               } else {
30
+                    ?>
31 31
 				<div class="content-intro">
32 32
 					<h3><?php esc_html_e( "Don't forget your warm up!", 'lsx-health-plan' ); ?></h3>
33 33
 					<p><?php esc_html_e( 'Be sure to do the warm-up before every workout session.', 'lsx-health-plan' ); ?></p>
34 34
 				</div>
35 35
 				<?php
36
-			} ?>
36
+               } ?>
37 37
 			</div>
38 38
 		</div>
39 39
 	</div>
@@ -46,28 +46,28 @@  discard block
 block discarded – undo
46 46
 * @return void
47 47
 */
48 48
 function lsx_health_plan_meal_box() {
49
-	if ( ! post_type_exists( 'meal' ) ) {
50
-		return;
51
-	}
52
-	?>
49
+     if ( ! post_type_exists( 'meal' ) ) {
50
+          return;
51
+     }
52
+     ?>
53 53
 	<div class="col-md-4" >
54 54
 		<div class="lsx-health-plan-box">
55 55
 			<h3 class="title meal-plan-title title-lined"><?php esc_html_e( 'Your Meal Plan', 'lsx-health-plan' ); ?><?php lsx_get_svg_icon( 'meal.svg' ); ?></h3>
56 56
 			<div class="spacer"></div>
57 57
 			<?php
58
-			$intro_text = \lsx_health_plan\functions\get_option( 'meal_plan_intro', false );
59
-			if ( false !== $intro_text ) {
60
-				?>
58
+               $intro_text = \lsx_health_plan\functions\get_option( 'meal_plan_intro', false );
59
+               if ( false !== $intro_text ) {
60
+                    ?>
61 61
 				<div class="excerpt">
62 62
 					<p><?php echo wp_kses_post( $intro_text ); ?></p>
63 63
 				</div>
64 64
 				<?php
65
-			}
66
-			$meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', false );
67
-			if ( false === $meal ) {
68
-				$meal = 'meal';
69
-			}
70
-			?>
65
+               }
66
+               $meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', false );
67
+               if ( false === $meal ) {
68
+                    $meal = 'meal';
69
+               }
70
+               ?>
71 71
 			<a href="<?php the_permalink(); ?><?php echo esc_attr( $meal ); ?>/" class="btn"><?php esc_html_e( 'View your meal plan', 'lsx-health-plan' ); ?></a>
72 72
 		</div>
73 73
 	</div>
@@ -80,28 +80,28 @@  discard block
 block discarded – undo
80 80
 * @return void
81 81
 */
82 82
 function lsx_health_plan_recipe_box() {
83
-	if ( ! post_type_exists( 'recipe' ) ) {
84
-		return;
85
-	}
86
-	?>
83
+     if ( ! post_type_exists( 'recipe' ) ) {
84
+          return;
85
+     }
86
+     ?>
87 87
 	<div class="col-md-4" >
88 88
 		<div class="lsx-health-plan-box">
89 89
 			<h3 class="title recipes-title title-lined"><?php esc_html_e( 'Recipes', 'lsx-health-plan' ); ?><?php lsx_get_svg_icon( 'recipes.svg' ); ?></h3>
90 90
 			<div class="spacer"></div>
91 91
 			<?php
92
-			$intro_text = \lsx_health_plan\functions\get_option( 'recipes_intro', false );
93
-			if ( false !== $intro_text ) {
94
-				?>
92
+               $intro_text = \lsx_health_plan\functions\get_option( 'recipes_intro', false );
93
+               if ( false !== $intro_text ) {
94
+                    ?>
95 95
 				<div class="excerpt">
96 96
 					<p><?php echo wp_kses_post( $intro_text ); ?></p>
97 97
 				</div>
98 98
 				<?php
99
-			}
100
-			$recipes = \lsx_health_plan\functions\get_option( 'endpoint_recipe', false );
101
-			if ( false === $recipes ) {
102
-				$recipes = 'recipes';
103
-			}
104
-			?>
99
+               }
100
+               $recipes = \lsx_health_plan\functions\get_option( 'endpoint_recipe', false );
101
+               if ( false === $recipes ) {
102
+                    $recipes = 'recipes';
103
+               }
104
+               ?>
105 105
 			<a href="<?php the_permalink(); ?><?php echo esc_attr( $recipes ); ?>/" class="btn"><?php esc_html_e( 'View all recipes', 'lsx-health-plan' ); ?></a>
106 106
 		</div>
107 107
 	</div>
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
 * @return void
115 115
 */
116 116
 function lsx_health_plan_downloads_box() {
117
-	global $current_user;
118
-	?>
117
+     global $current_user;
118
+     ?>
119 119
 	<div class="col-md-4 day-download-box" >
120 120
 		<div class="lsx-health-plan-box">
121 121
 			<h3 class="title downloads-title title-lined"><?php esc_html_e( 'Downloads', 'lsx-health-plan' ); ?><?php lsx_get_svg_icon( 'download.svg' ); ?></h3>
@@ -123,13 +123,13 @@  discard block
 block discarded – undo
123 123
 			<div class="download-list">
124 124
 				<ul>
125 125
 					<?php
126
-					$downloads = \lsx_health_plan\functions\get_downloads();
127
-					if ( ! empty( $downloads ) ) {
128
-						foreach ( $downloads as $download ) {
129
-							echo wp_kses_post( '<li><a href=""><i class="fa fa-file-pdf"></i>' . do_shortcode( '[download id="' . $download . '"]' ) . '</a></li>' );
130
-						}
131
-					}
132
-					?>
126
+                         $downloads = \lsx_health_plan\functions\get_downloads();
127
+                         if ( ! empty( $downloads ) ) {
128
+                              foreach ( $downloads as $download ) {
129
+                                   echo wp_kses_post( '<li><a href=""><i class="fa fa-file-pdf"></i>' . do_shortcode( '[download id="' . $download . '"]' ) . '</a></li>' );
130
+                              }
131
+                         }
132
+                         ?>
133 133
 				</ul>
134 134
 			</div>
135 135
 		</div>
@@ -144,15 +144,15 @@  discard block
 block discarded – undo
144 144
  * @return void
145 145
  */
146 146
 function lsx_health_plan_nav_class( $tab = '' ) {
147
-	$nav_classes = array();
148
-	if ( function_exists( 'is_wc_endpoint_url' ) && 'edit-account' === $tab && is_wc_endpoint_url( 'edit-account' ) ) {
149
-		$nav_classes[] = 'active';
150
-	} elseif ( lsx_health_plan_is_current_tab( $tab ) ) {
151
-		$nav_classes[] = 'active';
152
-	}
153
-	if ( ! empty( $nav_classes ) ) {
154
-		echo wp_kses_post( implode( ' ', $nav_classes ) );
155
-	}
147
+     $nav_classes = array();
148
+     if ( function_exists( 'is_wc_endpoint_url' ) && 'edit-account' === $tab && is_wc_endpoint_url( 'edit-account' ) ) {
149
+          $nav_classes[] = 'active';
150
+     } elseif ( lsx_health_plan_is_current_tab( $tab ) ) {
151
+          $nav_classes[] = 'active';
152
+     }
153
+     if ( ! empty( $nav_classes ) ) {
154
+          echo wp_kses_post( implode( ' ', $nav_classes ) );
155
+     }
156 156
 }
157 157
 
158 158
 /**
@@ -161,29 +161,29 @@  discard block
 block discarded – undo
161 161
  * @return void
162 162
  */
163 163
 function lsx_health_plan_my_profile_tabs() {
164
-	?>
164
+     ?>
165 165
 	<div id="account-nav">
166 166
 		<ul class="nav nav-pills">
167 167
 			<li class="
168 168
 			<?php
169
-			if ( ( function_exists( 'is_wc_endpoint_url' ) && ! is_wc_endpoint_url( 'edit-account' ) ) || ! function_exists( 'is_wc_endpoint_url' ) ) {
170
-				echo esc_attr( 'active' );
171
-			}
172
-			?>
169
+               if ( ( function_exists( 'is_wc_endpoint_url' ) && ! is_wc_endpoint_url( 'edit-account' ) ) || ! function_exists( 'is_wc_endpoint_url' ) ) {
170
+                    echo esc_attr( 'active' );
171
+               }
172
+               ?>
173 173
 			"><a class="my-plan-tab" href="<?php the_permalink(); ?>"><?php esc_html_e( 'My Plans', 'lsx-health-plan' ); ?></a></li>
174 174
 			<?php
175
-			if ( function_exists( 'WC' ) ) {
176
-				?>
175
+               if ( function_exists( 'WC' ) ) {
176
+                    ?>
177 177
 				<li class="
178 178
 				<?php
179
-				if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'edit-account' ) ) {
180
-					echo esc_attr( 'active' );
181
-				}
182
-				?>
179
+                    if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'edit-account' ) ) {
180
+                         echo esc_attr( 'active' );
181
+                    }
182
+                    ?>
183 183
 				"><a class="account-details-tab" href="<?php the_permalink(); ?>edit-account/"><?php esc_html_e( 'Account Details', 'lsx-health-plan' ); ?></a></li>
184 184
 				<?php
185
-			}
186
-			?>
185
+               }
186
+               ?>
187 187
 			<li class=""><a class="logout-tab" href="<?php echo esc_url( wp_logout_url( get_permalink() ) ); ?>"><?php esc_html_e( 'Logout', 'lsx-health-plan' ); ?></a></li>
188 188
 		</ul>
189 189
 	</div>
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
  * @return void
197 197
  */
198 198
 function lsx_health_plan_my_profile_box() {
199
-	?>
199
+     ?>
200 200
 	<div class="lsx-health-plan my-profile-block wp-block-cover alignfull">
201 201
 		<div class="wp-block-cover__inner-container">
202 202
 			<h2><?php esc_html_e( 'My Dashboard', 'lsx-health-plan' ); ?></h2>
@@ -204,97 +204,97 @@  discard block
 block discarded – undo
204 204
 				<div class="profile-navigation">
205 205
 					<div class="profile-photo">
206 206
 					<?php
207
-						global $current_user;
208
-						get_current_user();
209
-						echo get_avatar( $current_user->ID, 240 );
210
-						?>
207
+                              global $current_user;
208
+                              get_current_user();
209
+                              echo get_avatar( $current_user->ID, 240 );
210
+                              ?>
211 211
 					</div>
212 212
 				</div>
213 213
 				<div class="profile-details">
214 214
 					<h1 class="title-lined has-text-color"><?php echo esc_html( $current_user->display_name ); ?></h1>
215 215
 					<?php
216
-					$disable_stats = \lsx_health_plan\functions\get_option( 'disable_all_stats', false );
217
-					if ( 'on' !== $disable_stats && function_exists( 'WC' ) ) {
216
+                         $disable_stats = \lsx_health_plan\functions\get_option( 'disable_all_stats', false );
217
+                         if ( 'on' !== $disable_stats && function_exists( 'WC' ) ) {
218 218
 
219
-						$is_weight_disabled = \lsx_health_plan\functions\get_option( 'disable_weight_checkbox', false );
220
-						$is_height_disabled = \lsx_health_plan\functions\get_option( 'disable_height_checkbox', false );
221
-						$is_waist_disabled  = \lsx_health_plan\functions\get_option( 'disable_waist_checkbox', false );
222
-						$is_bmi_disabled    = \lsx_health_plan\functions\get_option( 'disable_bmi_checkbox', false );
219
+                              $is_weight_disabled = \lsx_health_plan\functions\get_option( 'disable_weight_checkbox', false );
220
+                              $is_height_disabled = \lsx_health_plan\functions\get_option( 'disable_height_checkbox', false );
221
+                              $is_waist_disabled  = \lsx_health_plan\functions\get_option( 'disable_waist_checkbox', false );
222
+                              $is_bmi_disabled    = \lsx_health_plan\functions\get_option( 'disable_bmi_checkbox', false );
223 223
 
224
-						$weight = get_user_meta( get_current_user_id(), 'weight', true );
225
-						$waist  = get_user_meta( get_current_user_id(), 'waist', true );
226
-						$height = get_user_meta( get_current_user_id(), 'height', true );
224
+                              $weight = get_user_meta( get_current_user_id(), 'weight', true );
225
+                              $waist  = get_user_meta( get_current_user_id(), 'waist', true );
226
+                              $height = get_user_meta( get_current_user_id(), 'height', true );
227 227
 
228
-						$height_m = 0;
229
-						if ( is_numeric( $height ) ) {
230
-							$height_m = $height / 100;
231
-						}
228
+                              $height_m = 0;
229
+                              if ( is_numeric( $height ) ) {
230
+                                   $height_m = $height / 100;
231
+                              }
232 232
 
233
-						if ( 1 < $weight && 1 < $height_m ) {
234
-							$bmi = $weight / ( $height_m * $height_m );
235
-							$bmi = number_format( $bmi, 1 );
236
-						} else {
237
-							$bmi = __( 'Add more data', 'lsx-health-plan' );
238
-						}
233
+                              if ( 1 < $weight && 1 < $height_m ) {
234
+                                   $bmi = $weight / ( $height_m * $height_m );
235
+                                   $bmi = number_format( $bmi, 1 );
236
+                              } else {
237
+                                   $bmi = __( 'Add more data', 'lsx-health-plan' );
238
+                              }
239 239
 
240
-						?>
240
+                              ?>
241 241
 
242 242
 						<div>
243 243
 							<?php if ( 'on' !== $is_weight_disabled ) { ?>
244 244
 								<span><strong><?php esc_html_e( 'Weight:', 'lsx-health-plan' ); ?></strong>
245 245
 								<?php
246
-								if ( '' !== $weight ) {
247
-									echo wp_kses_post( $weight . ' kg' );
248
-								} else {
249
-									echo '/';
250
-								}
251
-								?>
246
+                                        if ( '' !== $weight ) {
247
+                                             echo wp_kses_post( $weight . ' kg' );
248
+                                        } else {
249
+                                             echo '/';
250
+                                        }
251
+                                        ?>
252 252
 								</span>
253 253
 							<?php }
254
-							if ( 'on' !== $is_waist_disabled ) {
255
-								?>
254
+                                   if ( 'on' !== $is_waist_disabled ) {
255
+                                        ?>
256 256
 								<span><strong><?php esc_html_e( 'Waist:', 'lsx-health-plan' ); ?></strong>
257 257
 								<?php
258
-								if ( '' !== $waist ) {
259
-									echo wp_kses_post( $waist . ' cm' );
260
-								} else {
261
-									echo '/';
262
-								}
263
-								?>
258
+                                        if ( '' !== $waist ) {
259
+                                             echo wp_kses_post( $waist . ' cm' );
260
+                                        } else {
261
+                                             echo '/';
262
+                                        }
263
+                                        ?>
264 264
 								</span>
265 265
 							<?php }
266
-							if ( 'on' !== $is_bmi_disabled ) {
267
-								?>
266
+                                   if ( 'on' !== $is_bmi_disabled ) {
267
+                                        ?>
268 268
 								<span><strong><?php esc_html_e( 'BMI:', 'lsx-health-plan' ); ?></strong>
269 269
 								<?php
270
-								if ( '' !== $bmi ) {
271
-									echo wp_kses_post( $bmi );
272
-								} else {
273
-									echo '/';
274
-								}
275
-								?>
270
+                                        if ( '' !== $bmi ) {
271
+                                             echo wp_kses_post( $bmi );
272
+                                        } else {
273
+                                             echo '/';
274
+                                        }
275
+                                        ?>
276 276
 								</span>
277 277
 							<?php } ?>
278 278
 						</div>
279 279
 					<?php
280
-					}
280
+                         }
281 281
 
282
-					// Only display the edit account link if woocommerce is active.
283
-					if ( function_exists( 'WC' ) ) {
284
-						?>
282
+                         // Only display the edit account link if woocommerce is active.
283
+                         if ( function_exists( 'WC' ) ) {
284
+                              ?>
285 285
 						<div class="edit-profile">
286 286
 							<?php
287
-							if ( function_exists( 'wc_get_page_id' ) ) {
288
-								$url_id = wc_get_page_id( 'myaccount' );
289
-							} else {
290
-								$url_id = '';
291
-							}
292
-							?>
287
+                                   if ( function_exists( 'wc_get_page_id' ) ) {
288
+                                        $url_id = wc_get_page_id( 'myaccount' );
289
+                                   } else {
290
+                                        $url_id = '';
291
+                                   }
292
+                                   ?>
293 293
 							<a href="<?php echo esc_url( get_permalink( $url_id ) ); ?>edit-account/"><?php esc_html_e( 'Edit', 'lsx-health-plan' ); ?></a>
294 294
 						</div>
295 295
 						<?php
296
-					}
297
-					?>
296
+                         }
297
+                         ?>
298 298
 				</div>
299 299
 			</section>
300 300
 		</div>
@@ -308,65 +308,65 @@  discard block
 block discarded – undo
308 308
  * @return void
309 309
  */
310 310
 function lsx_health_plan_all_plans_block() {
311
-	global $post, $product;
312
-
313
-	$args = array(
314
-		'orderby'        => 'menu_order',
315
-		'order'          => 'ASC',
316
-		'post_type'      => 'plan',
317
-		'nopagin'        => true,
318
-		'post_parent'    => 0,
319
-	);
320
-
321
-	if ( function_exists( '\lsx_health_plan\functions\woocommerce\get_membership_products' ) ) {
322
-		$product_ids = \lsx_health_plan\functions\woocommerce\get_membership_products();
323
-		if ( ! empty( $product_ids ) ) {
324
-			$args['meta_query'] = array(
325
-				'relation' => 'OR',
326
-				array(
327
-					'key'     => '_plan_product_id',
328
-					'value'   => $product_ids,
329
-					'compare' => 'IN',
330
-				),
331
-				array(
332
-					'key'     => '_plan_product_id',
333
-					'compare' => 'NOT EXISTS',
334
-				),
335
-			);
336
-		}
337
-	}
338
-
339
-	$the_query = new WP_Query( $args );
340
-	?>
311
+     global $post, $product;
312
+
313
+     $args = array(
314
+          'orderby'        => 'menu_order',
315
+          'order'          => 'ASC',
316
+          'post_type'      => 'plan',
317
+          'nopagin'        => true,
318
+          'post_parent'    => 0,
319
+     );
320
+
321
+     if ( function_exists( '\lsx_health_plan\functions\woocommerce\get_membership_products' ) ) {
322
+          $product_ids = \lsx_health_plan\functions\woocommerce\get_membership_products();
323
+          if ( ! empty( $product_ids ) ) {
324
+               $args['meta_query'] = array(
325
+                    'relation' => 'OR',
326
+                    array(
327
+                         'key'     => '_plan_product_id',
328
+                         'value'   => $product_ids,
329
+                         'compare' => 'IN',
330
+                    ),
331
+                    array(
332
+                         'key'     => '_plan_product_id',
333
+                         'compare' => 'NOT EXISTS',
334
+                    ),
335
+               );
336
+          }
337
+     }
338
+
339
+     $the_query = new WP_Query( $args );
340
+     ?>
341 341
 	<div class="all-plans-block plan-grid block-all-plans-block">
342 342
 		<div class="row">
343 343
 			<?php
344
-			if ( $the_query->have_posts() ) :
345
-				while ( $the_query->have_posts() ) :
346
-					$the_query->the_post();
347
-					lsx_entry_before();
348
-					$completed_class = '';
349
-					$linked_product  = false;
350
-					$restricted      = false;
351
-					$product         = null;
352
-					if ( function_exists( 'lsx_health_plan\functions\woocommerce\plan_has_products' ) && \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
353
-						$products       = \lsx_health_plan\functions\woocommerce\get_plan_products();
354
-						$linked_product = wc_get_product( $products[0] );
355
-						$product        = $linked_product;
356
-					}
357
-					if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) {
358
-						$restricted = wc_memberships_is_post_content_restricted( get_the_ID() ) && ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
359
-					}
360
-
361
-					if ( lsx_health_plan_is_plan_complete() ) {
362
-						$completed_class = 'completed';
363
-					}
364
-					$round_progress     = '';
365
-					$completed_progress = '100';
366
-					if ( false === $restricted ) {
367
-						$round_progress = round( \lsx_health_plan\functions\get_progress( get_the_ID() ), 0 );
368
-					}
369
-					?>
344
+               if ( $the_query->have_posts() ) :
345
+                    while ( $the_query->have_posts() ) :
346
+                         $the_query->the_post();
347
+                         lsx_entry_before();
348
+                         $completed_class = '';
349
+                         $linked_product  = false;
350
+                         $restricted      = false;
351
+                         $product         = null;
352
+                         if ( function_exists( 'lsx_health_plan\functions\woocommerce\plan_has_products' ) && \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
353
+                              $products       = \lsx_health_plan\functions\woocommerce\get_plan_products();
354
+                              $linked_product = wc_get_product( $products[0] );
355
+                              $product        = $linked_product;
356
+                         }
357
+                         if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) {
358
+                              $restricted = wc_memberships_is_post_content_restricted( get_the_ID() ) && ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
359
+                         }
360
+
361
+                         if ( lsx_health_plan_is_plan_complete() ) {
362
+                              $completed_class = 'completed';
363
+                         }
364
+                         $round_progress     = '';
365
+                         $completed_progress = '100';
366
+                         if ( false === $restricted ) {
367
+                              $round_progress = round( \lsx_health_plan\functions\get_progress( get_the_ID() ), 0 );
368
+                         }
369
+                         ?>
370 370
 					<div class="col-xs-12 col-sm-6 col-md-4">
371 371
 						<article class="lsx-slot lsx-hp-shadow <?php echo esc_html( 'progress-') . $round_progress; ?>">
372 372
 							<div class="plan-feature-img">
@@ -375,45 +375,45 @@  discard block
 block discarded – undo
375 375
 								<?php } ?>
376 376
 								<a href="<?php echo esc_url( get_permalink() ); ?>">
377 377
 								<?php
378
-								$featured_image = get_the_post_thumbnail();
379
-								if ( ! empty( $featured_image ) && '' !== $featured_image ) {
380
-									the_post_thumbnail( 'lsx-thumbnail', array(
381
-										'class' => 'aligncenter',
382
-									) );
383
-								} else {
384
-									?>
378
+                                        $featured_image = get_the_post_thumbnail();
379
+                                        if ( ! empty( $featured_image ) && '' !== $featured_image ) {
380
+                                             the_post_thumbnail( 'lsx-thumbnail', array(
381
+                                                  'class' => 'aligncenter',
382
+                                             ) );
383
+                                        } else {
384
+                                             ?>
385 385
 									<img loading="lazy"  class="placeholder" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>">
386 386
 									<?php
387
-								}
388
-								?>
387
+                                        }
388
+                                        ?>
389 389
 								</a>
390 390
 							</div>
391 391
 							<div class="content-box plan-content-box">
392 392
 								<h3 class="plan id-<?php the_ID(); ?> <?php echo esc_attr( $completed_class ); ?>"><a href="<?php echo esc_url( get_permalink() ); ?>"><?php the_title(); ?></a></h3>
393 393
 								<?php
394
-									echo wp_kses_post( \lsx_health_plan\functions\hp_get_plan_type_meta( $post ) );
395
-								?>
394
+                                             echo wp_kses_post( \lsx_health_plan\functions\hp_get_plan_type_meta( $post ) );
395
+                                        ?>
396 396
 								<?php
397
-								if ( false !== $linked_product && false !== $restricted ) {
398
-									echo wp_kses_post( $linked_product->get_price_html() );
399
-								}
400
-								?>
397
+                                        if ( false !== $linked_product && false !== $restricted ) {
398
+                                             echo wp_kses_post( $linked_product->get_price_html() );
399
+                                        }
400
+                                        ?>
401 401
 								<div class="excerpt">
402 402
 									<?php
403
-									if ( ! has_excerpt() ) {
404
-										$content = wp_trim_words( get_the_content(), 20 );
405
-										$content = '<p>' . $content . '</pre>';
406
-									} else {
407
-										$content = apply_filters( 'the_excerpt', get_the_excerpt() );
408
-									}
409
-									echo wp_kses_post( $content );
410
-									?>
403
+                                             if ( ! has_excerpt() ) {
404
+                                                  $content = wp_trim_words( get_the_content(), 20 );
405
+                                                  $content = '<p>' . $content . '</pre>';
406
+                                             } else {
407
+                                                  $content = apply_filters( 'the_excerpt', get_the_excerpt() );
408
+                                             }
409
+                                             echo wp_kses_post( $content );
410
+                                             ?>
411 411
 								</div>
412 412
 								<?php
413
-								if ( false === $restricted ) {
414
-									echo wp_kses_post( '<span class="progress"><progress class="bar" value="' . \lsx_health_plan\functions\get_progress( get_the_ID() ) . '" max="100"> ' . \lsx_health_plan\functions\get_progress( get_the_ID() ) . '% </progress><span>' . $round_progress . '%</span></span>' );
415
-								}
416
-								?>
413
+                                        if ( false === $restricted ) {
414
+                                             echo wp_kses_post( '<span class="progress"><progress class="bar" value="' . \lsx_health_plan\functions\get_progress( get_the_ID() ) . '" max="100"> ' . \lsx_health_plan\functions\get_progress( get_the_ID() ) . '% </progress><span>' . $round_progress . '%</span></span>' );
415
+                                        }
416
+                                        ?>
417 417
 							</div>
418 418
 						</article>
419 419
 					</div>
@@ -432,36 +432,36 @@  discard block
 block discarded – undo
432 432
  * @return void
433 433
  */
434 434
 function lsx_health_plan_day_plan_block( $args = array() ) {
435
-	$defaults = array(
436
-		'plan' => '',
437
-	);
438
-	$args     = wp_parse_args( $args, $defaults );
439
-
440
-	if ( isset( $args['plan'] ) && '' !== $args['plan'] && \lsx_health_plan\functions\plan\has_sections( $args['plan'] ) ) {
441
-		$sections = \lsx_health_plan\functions\plan\get_sections();
442
-		?>
435
+     $defaults = array(
436
+          'plan' => '',
437
+     );
438
+     $args     = wp_parse_args( $args, $defaults );
439
+
440
+     if ( isset( $args['plan'] ) && '' !== $args['plan'] && \lsx_health_plan\functions\plan\has_sections( $args['plan'] ) ) {
441
+          $sections = \lsx_health_plan\functions\plan\get_sections();
442
+          ?>
443 443
 		<div class="daily-plan-block day-grid">
444 444
 			<?php
445
-			foreach ( $sections as $section_key => $section_values ) {
446
-				$defaults    = array(
447
-					'title' => __( 'Day', 'lsx-health-plan' ) . ' ' . ( $section_key + 1 ),
448
-				);
449
-				$section_args = wp_parse_args( $section_values, $defaults );
450
-
451
-				$completed_class = '';
452
-				if ( lsx_health_plan_is_day_complete() ) {
453
-					$completed_class = 'completed';
454
-				}
455
-				?>
445
+               foreach ( $sections as $section_key => $section_values ) {
446
+                    $defaults    = array(
447
+                         'title' => __( 'Day', 'lsx-health-plan' ) . ' ' . ( $section_key + 1 ),
448
+                    );
449
+                    $section_args = wp_parse_args( $section_values, $defaults );
450
+
451
+                    $completed_class = '';
452
+                    if ( lsx_health_plan_is_day_complete() ) {
453
+                         $completed_class = 'completed';
454
+                    }
455
+                    ?>
456 456
 				<a href="<?php echo esc_attr( \lsx_health_plan\functions\plan\get_permalink( $args['plan'], $section_args['title'] ) ); ?>" class="day id-<?php echo esc_attr( $section_key + 1 ); ?> <?php echo esc_attr( $completed_class ); ?>">
457 457
 					<div class="plan-content"><?php echo esc_attr( $section_args['title'] ); ?></div>
458 458
 				</a>
459 459
 				<?php
460
-			}
461
-			?>
460
+               }
461
+               ?>
462 462
 		</div>
463 463
 		<?php
464
-	}
464
+     }
465 465
 }
466 466
 
467 467
 /**
@@ -471,44 +471,44 @@  discard block
 block discarded – undo
471 471
  * @return void
472 472
  */
473 473
 function lsx_health_plan_week_plan_block( $args = array() ) {
474
-	$defaults = array(
475
-		'show_downloads' => false,
476
-		'plan'           => '',
477
-	);
478
-	$args     = wp_parse_args( $args, $defaults );
479
-
480
-	if ( isset( $args['plan'] ) && '' !== $args['plan'] && \lsx_health_plan\functions\plan\has_sections( $args['plan'] ) ) {
481
-		$groups = \lsx_health_plan\functions\plan\get_sections( true );
482
-
483
-		if ( ! empty( $groups ) ) {
484
-			$counter    = 1;
485
-			$group_open = false;
486
-
487
-			foreach ( $groups as $group_key => $sections ) {
488
-				$collapse_class = '';
489
-				$group_title    = \lsx_health_plan\functions\plan\get_group_title( $sections );
490
-
491
-				// Determine if the current week is complete.
492
-				$day_ids = wp_list_pluck( $sections, 'title' );
493
-				if ( false === $group_open ) {
494
-					if ( 1 === $counter && ! \lsx_health_plan\functions\is_week_complete( false, $day_ids, $group_title ) ) {
495
-						$collapse_class = 'in';
496
-						$group_open   = true;
497
-					} elseif ( ! \lsx_health_plan\functions\is_week_complete( false, $day_ids, $group_title ) ) {
498
-						$collapse_class = 'in';
499
-						$group_open   = true;
500
-					}
501
-				}
502
-
503
-				// Determine if there are any weekly downloads.
504
-				$week_downloads_view = '';
505
-				if ( isset( $args['show_downloads'] ) && false !== $args['show_downloads'] ) {
506
-					$weekly_downloads = \lsx_health_plan\functions\get_weekly_downloads( $group_key );
507
-					if ( ! empty( $weekly_downloads ) ) {
508
-						$week_downloads_view = 'week-downloads-view-on';
509
-					}
510
-				}
511
-				?>
474
+     $defaults = array(
475
+          'show_downloads' => false,
476
+          'plan'           => '',
477
+     );
478
+     $args     = wp_parse_args( $args, $defaults );
479
+
480
+     if ( isset( $args['plan'] ) && '' !== $args['plan'] && \lsx_health_plan\functions\plan\has_sections( $args['plan'] ) ) {
481
+          $groups = \lsx_health_plan\functions\plan\get_sections( true );
482
+
483
+          if ( ! empty( $groups ) ) {
484
+               $counter    = 1;
485
+               $group_open = false;
486
+
487
+               foreach ( $groups as $group_key => $sections ) {
488
+                    $collapse_class = '';
489
+                    $group_title    = \lsx_health_plan\functions\plan\get_group_title( $sections );
490
+
491
+                    // Determine if the current week is complete.
492
+                    $day_ids = wp_list_pluck( $sections, 'title' );
493
+                    if ( false === $group_open ) {
494
+                         if ( 1 === $counter && ! \lsx_health_plan\functions\is_week_complete( false, $day_ids, $group_title ) ) {
495
+                              $collapse_class = 'in';
496
+                              $group_open   = true;
497
+                         } elseif ( ! \lsx_health_plan\functions\is_week_complete( false, $day_ids, $group_title ) ) {
498
+                              $collapse_class = 'in';
499
+                              $group_open   = true;
500
+                         }
501
+                    }
502
+
503
+                    // Determine if there are any weekly downloads.
504
+                    $week_downloads_view = '';
505
+                    if ( isset( $args['show_downloads'] ) && false !== $args['show_downloads'] ) {
506
+                         $weekly_downloads = \lsx_health_plan\functions\get_weekly_downloads( $group_key );
507
+                         if ( ! empty( $weekly_downloads ) ) {
508
+                              $week_downloads_view = 'week-downloads-view-on';
509
+                         }
510
+                    }
511
+                    ?>
512 512
 				<div class="daily-plan-block week-grid">
513 513
 					<a href="#group-<?php echo esc_attr( $group_key ); ?>" data-toggle="collapse" class="week-title"><?php echo esc_attr( $group_title ); ?></a>
514 514
 					<div id="group-<?php echo esc_attr( $group_key ); ?>" class="week-row collapse <?php echo esc_attr( $collapse_class ); ?>">
@@ -522,46 +522,46 @@  discard block
 block discarded – undo
522 522
 								<div class="week-meals-recipes-box-inner">
523 523
 								<?php
524 524
 
525
-								foreach ( $sections as $section_key => $section_values ) {
525
+                                        foreach ( $sections as $section_key => $section_values ) {
526 526
 
527
-									$defaults    = array(
528
-										'title' => __( 'Day', 'lsx-health-plan' ) . ' ' . ( $section_key + 1 ),
529
-									);
530
-									$section_args = wp_parse_args( $section_values, $defaults );
527
+                                             $defaults    = array(
528
+                                                  'title' => __( 'Day', 'lsx-health-plan' ) . ' ' . ( $section_key + 1 ),
529
+                                             );
530
+                                             $section_args = wp_parse_args( $section_values, $defaults );
531 531
 
532
-									$completed_class = '';
533
-									if ( lsx_health_plan_is_day_complete( $args['plan'], $section_args['title'] ) ) {
534
-										$completed_class = 'completed';
535
-									}
536
-									if ( $section_args['rest_day_enabled'] && ! $section_args['connected_meals'] ) {
537
-										?>
532
+                                             $completed_class = '';
533
+                                             if ( lsx_health_plan_is_day_complete( $args['plan'], $section_args['title'] ) ) {
534
+                                                  $completed_class = 'completed';
535
+                                             }
536
+                                             if ( $section_args['rest_day_enabled'] && ! $section_args['connected_meals'] ) {
537
+                                                  ?>
538 538
 										<span class="day id-<?php echo esc_attr( $section_key + 1 ); ?> <?php echo esc_attr( $completed_class ); ?>">
539 539
 											<div class="plan-content"><?php echo esc_attr( $section_args['title'] ); ?></div>
540 540
 										</span>
541 541
 										<?php
542
-									} else {
543
-										?>
542
+                                             } else {
543
+                                                  ?>
544 544
 										<a href="<?php echo esc_attr( \lsx_health_plan\functions\plan\get_permalink( $args['plan'], $section_args['title'] ) ); ?>" class="day id-<?php echo esc_attr( $section_key + 1 ); ?> <?php echo esc_attr( $completed_class ); ?>">
545 545
 											<div class="plan-content"><?php echo esc_attr( $section_args['title'] ); ?></div>
546 546
 										</a>
547 547
 										<?php
548
-									}
549
-								}
550
-								?>
548
+                                             }
549
+                                        }
550
+                                        ?>
551 551
 								</div>
552 552
 							</div>
553 553
 							<?php
554
-							if ( ! empty( $week_downloads_view ) ) {
555
-								lsx_health_plan_weekly_downloads( $weekly_downloads );
556
-							}
557
-							?>
554
+                                   if ( ! empty( $week_downloads_view ) ) {
555
+                                        lsx_health_plan_weekly_downloads( $weekly_downloads );
556
+                                   }
557
+                                   ?>
558 558
 						</div>
559 559
 					</div>
560 560
 				</div>
561 561
 				<?php
562
-			}
563
-		}
564
-	}
562
+               }
563
+          }
564
+     }
565 565
 }
566 566
 
567 567
 /**
@@ -571,22 +571,22 @@  discard block
 block discarded – undo
571 571
  * @return void
572 572
  */
573 573
 function lsx_health_plan_weekly_downloads( $weekly_downloads = array() ) {
574
-	if ( ! empty( $weekly_downloads ) ) {
575
-		?>
574
+     if ( ! empty( $weekly_downloads ) ) {
575
+          ?>
576 576
 		<div class="week-download-box">
577 577
 			<h3 class="title"><?php lsx_get_svg_icon( 'download.svg' ); ?><?php echo esc_html_e( 'Downloads', 'lsx-health-plan' ); ?></h3>
578 578
 			<ul class="week-download-box-list">
579 579
 				<?php
580
-				foreach ( $weekly_downloads as $weekly_download ) {
581
-					?>
580
+                    foreach ( $weekly_downloads as $weekly_download ) {
581
+                         ?>
582 582
 					<li><?php echo wp_kses_post( do_shortcode( '[download id="' . $weekly_download . '"]' ) ); ?></li>
583 583
 					<?php
584
-				}
585
-				?>
584
+                    }
585
+                    ?>
586 586
 			</ul>
587 587
 		</div>
588 588
 		<?php
589
-	}
589
+     }
590 590
 }
591 591
 
592 592
 /**
@@ -595,9 +595,9 @@  discard block
 block discarded – undo
595 595
  * @return void
596 596
  */
597 597
 function lsx_health_plan_items( $args = array() ) {
598
-	global $shortcode_args;
599
-	$shortcode_args = $args;
600
-	include LSX_HEALTH_PLAN_PATH . '/templates/partials/shortcode-loop.php';
598
+     global $shortcode_args;
599
+     $shortcode_args = $args;
600
+     include LSX_HEALTH_PLAN_PATH . '/templates/partials/shortcode-loop.php';
601 601
 }
602 602
 
603 603
 /**
@@ -606,10 +606,10 @@  discard block
 block discarded – undo
606 606
  * @return void
607 607
  */
608 608
 function lsx_health_plan_featured_video_block() {
609
-	if ( ! post_type_exists( 'video' ) ) {
610
-		return;
611
-	}
612
-	include LSX_HEALTH_PLAN_PATH . '/templates/featured-videos.php';
609
+     if ( ! post_type_exists( 'video' ) ) {
610
+          return;
611
+     }
612
+     include LSX_HEALTH_PLAN_PATH . '/templates/featured-videos.php';
613 613
 }
614 614
 
615 615
 /**
@@ -618,10 +618,10 @@  discard block
 block discarded – undo
618 618
  * @return void
619 619
  */
620 620
 function lsx_health_plan_featured_recipes_block() {
621
-	if ( ! post_type_exists( 'recipe' ) ) {
622
-		return;
623
-	}
624
-	include LSX_HEALTH_PLAN_PATH . '/templates/featured-recipes.php';
621
+     if ( ! post_type_exists( 'recipe' ) ) {
622
+          return;
623
+     }
624
+     include LSX_HEALTH_PLAN_PATH . '/templates/featured-recipes.php';
625 625
 }
626 626
 
627 627
 /**
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
  * @return void
631 631
  */
632 632
 function lsx_health_plan_featured_tips_block() {
633
-	include LSX_HEALTH_PLAN_PATH . '/templates/featured-tips.php';
633
+     include LSX_HEALTH_PLAN_PATH . '/templates/featured-tips.php';
634 634
 }
635 635
 
636 636
 /**
@@ -640,11 +640,11 @@  discard block
 block discarded – undo
640 640
  * @return void
641 641
  */
642 642
 function lsx_health_plan_day_button() {
643
-	if ( lsx_health_plan_is_day_complete() ) {
644
-		lsx_health_plan_unlock_button();
645
-	} else {
646
-		lsx_health_plan_complete_button();
647
-	}
643
+     if ( lsx_health_plan_is_day_complete() ) {
644
+          lsx_health_plan_unlock_button();
645
+     } else {
646
+          lsx_health_plan_complete_button();
647
+     }
648 648
 }
649 649
 
650 650
 /**
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
  * @return void
654 654
  */
655 655
 function lsx_health_plan_complete_button() {
656
-	?>
656
+     ?>
657 657
 	<div class="single-plan-inner-buttons">
658 658
 		<form action="<?php the_permalink(); ?>" method="post" class="form-complete-day complete-plan-btn">
659 659
 			<?php wp_nonce_field( 'complete', 'lsx-health-plan-actions' ); ?>
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
  * @return void
672 672
  */
673 673
 function lsx_health_plan_unlock_button() {
674
-	?>
674
+     ?>
675 675
 	<div class="single-plan-inner-buttons">
676 676
 		<form action="<?php the_permalink(); ?>" method="post" class="form-complete-day complete-plan-btn">
677 677
 			<?php wp_nonce_field( 'unlock', 'lsx-health-plan-actions' ); ?>
@@ -690,10 +690,10 @@  discard block
 block discarded – undo
690 690
  * @return void
691 691
  */
692 692
 function lsx_health_plan_single_nav() {
693
-	$tab_template_path = apply_filters( 'lsx_health_plan_single_nav_path', LSX_HEALTH_PLAN_PATH . '/templates/single-plan-tabs.php' );
694
-	if ( '' !== $tab_template_path ) {
695
-		require $tab_template_path;
696
-	}
693
+     $tab_template_path = apply_filters( 'lsx_health_plan_single_nav_path', LSX_HEALTH_PLAN_PATH . '/templates/single-plan-tabs.php' );
694
+     if ( '' !== $tab_template_path ) {
695
+          require $tab_template_path;
696
+     }
697 697
 }
698 698
 
699 699
 /**
@@ -703,32 +703,32 @@  discard block
 block discarded – undo
703 703
  * @return void
704 704
  */
705 705
 function lsx_health_plan_single_tabs() {
706
-	$endpoint = get_query_var( 'endpoint' );
707
-	switch ( $endpoint ) {
708
-		case 'meal':
709
-			$tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-meal.php';
710
-			break;
711
-
712
-		case 'recipes':
713
-			$tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-recipes.php';
714
-			break;
715
-
716
-		case 'workout':
717
-			$tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-workout.php';
718
-			break;
719
-
720
-		case 'warm-up':
721
-			$tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-warm-up.php';
722
-			break;
723
-
724
-		default:
725
-			$tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-plan.php';
726
-			break;
727
-	}
728
-	$tab_template_path = apply_filters( 'lsx_health_plan_single_tab_path', $tab_template_path );
729
-	if ( '' !== $tab_template_path ) {
730
-		include $tab_template_path;
731
-	}
706
+     $endpoint = get_query_var( 'endpoint' );
707
+     switch ( $endpoint ) {
708
+          case 'meal':
709
+               $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-meal.php';
710
+               break;
711
+
712
+          case 'recipes':
713
+               $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-recipes.php';
714
+               break;
715
+
716
+          case 'workout':
717
+               $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-workout.php';
718
+               break;
719
+
720
+          case 'warm-up':
721
+               $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-warm-up.php';
722
+               break;
723
+
724
+          default:
725
+               $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-plan.php';
726
+               break;
727
+     }
728
+     $tab_template_path = apply_filters( 'lsx_health_plan_single_tab_path', $tab_template_path );
729
+     if ( '' !== $tab_template_path ) {
730
+          include $tab_template_path;
731
+     }
732 732
 }
733 733
 
734 734
 /**
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
  * @return void
738 738
  */
739 739
 function lsx_health_plan_recipe_data() {
740
-	include LSX_HEALTH_PLAN_PATH . '/templates/table-recipe-data.php';
740
+     include LSX_HEALTH_PLAN_PATH . '/templates/table-recipe-data.php';
741 741
 }
742 742
 
743 743
 /**
@@ -746,11 +746,11 @@  discard block
 block discarded – undo
746 746
  * @return recipe_type
747 747
  */
748 748
 function lsx_health_plan_recipe_type() {
749
-	$term_obj_list = get_the_terms( get_the_ID(), 'recipe-type' );
750
-	$recipe_type   = $term_obj_list[0]->name;
751
-	if ( ! empty( $recipe_type ) ) {
752
-		return $recipe_type;
753
-	}
749
+     $term_obj_list = get_the_terms( get_the_ID(), 'recipe-type' );
750
+     $recipe_type   = $term_obj_list[0]->name;
751
+     if ( ! empty( $recipe_type ) ) {
752
+          return $recipe_type;
753
+     }
754 754
 }
755 755
 
756 756
 /**
@@ -761,35 +761,35 @@  discard block
 block discarded – undo
761 761
  * @return void
762 762
  */
763 763
 function lsx_health_plan_workout_video_play_button( $m, $group, $echo = true ) {
764
-	$workout_video = '';
765
-	$giphy         = '';
766
-	$youtube       = '';
767
-	if ( isset( $group['connected_videos'] ) && '' !== $group['connected_videos'] ) {
768
-		$workout_video = esc_html( $group['connected_videos'] );
769
-		$giphy         = get_post_meta( $workout_video, 'video_giphy_source', true );
770
-		$youtube       = esc_url( get_post_meta( $workout_video, 'video_youtube_source', 1 ) );
771
-		$content       = get_post_field( 'post_content', $workout_video );
772
-		$play_button   = '<button data-toggle="modal" data-target="#workout-video-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>';
773
-
774
-		$modal_body = '';
775
-		if ( ! empty( $giphy ) ) {
776
-			$giphy      = \lsx_health_plan\functions\get_video_url( $giphy );
777
-			$modal_body = $giphy; // WPCS: XSS OK.
778
-		} elseif ( ! empty( $youtube ) ) {
779
-			$modal_body = wp_oembed_get( $youtube, array( // WPCS: XSS OK.
780
-				'width' => 480,
781
-			) );
782
-		}
783
-		$modal_body .= '<h5 class="modal-title title-lined">' . $group['name'] . '</h5>';
784
-		$modal_body .= $content;
785
-		\lsx_health_plan\functions\register_modal( 'workout-video-modal-' . $m, '', $modal_body );
786
-
787
-		if ( true === $echo ) {
788
-			echo wp_kses_post( $play_button );
789
-		} else {
790
-			return $play_button;
791
-		}
792
-	}
764
+     $workout_video = '';
765
+     $giphy         = '';
766
+     $youtube       = '';
767
+     if ( isset( $group['connected_videos'] ) && '' !== $group['connected_videos'] ) {
768
+          $workout_video = esc_html( $group['connected_videos'] );
769
+          $giphy         = get_post_meta( $workout_video, 'video_giphy_source', true );
770
+          $youtube       = esc_url( get_post_meta( $workout_video, 'video_youtube_source', 1 ) );
771
+          $content       = get_post_field( 'post_content', $workout_video );
772
+          $play_button   = '<button data-toggle="modal" data-target="#workout-video-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>';
773
+
774
+          $modal_body = '';
775
+          if ( ! empty( $giphy ) ) {
776
+               $giphy      = \lsx_health_plan\functions\get_video_url( $giphy );
777
+               $modal_body = $giphy; // WPCS: XSS OK.
778
+          } elseif ( ! empty( $youtube ) ) {
779
+               $modal_body = wp_oembed_get( $youtube, array( // WPCS: XSS OK.
780
+                    'width' => 480,
781
+               ) );
782
+          }
783
+          $modal_body .= '<h5 class="modal-title title-lined">' . $group['name'] . '</h5>';
784
+          $modal_body .= $content;
785
+          \lsx_health_plan\functions\register_modal( 'workout-video-modal-' . $m, '', $modal_body );
786
+
787
+          if ( true === $echo ) {
788
+               echo wp_kses_post( $play_button );
789
+          } else {
790
+               return $play_button;
791
+          }
792
+     }
793 793
 }
794 794
 
795 795
 /**
@@ -798,21 +798,21 @@  discard block
 block discarded – undo
798 798
  * @return void
799 799
  */
800 800
 function lsx_health_plan_recipe_archive_description() {
801
-	$description = '';
802
-	if ( is_post_type_archive( 'recipe' ) ) {
803
-		$description = \lsx_health_plan\functions\get_option( 'recipe_archive_description', '' );
804
-	} elseif ( is_post_type_archive( 'exercise' ) ) {
805
-		$description = \lsx_health_plan\functions\get_option( 'exercise_archive_description', '' );
806
-	} elseif ( is_tax() ) {
807
-		$description = get_the_archive_description();
808
-	}
809
-	if ( '' !== $description ) {
810
-		?>
801
+     $description = '';
802
+     if ( is_post_type_archive( 'recipe' ) ) {
803
+          $description = \lsx_health_plan\functions\get_option( 'recipe_archive_description', '' );
804
+     } elseif ( is_post_type_archive( 'exercise' ) ) {
805
+          $description = \lsx_health_plan\functions\get_option( 'exercise_archive_description', '' );
806
+     } elseif ( is_tax() ) {
807
+          $description = get_the_archive_description();
808
+     }
809
+     if ( '' !== $description ) {
810
+          ?>
811 811
 		<div class="lsx-hp-archive-description row">
812 812
 			<div class="col-xs-12 description-wrapper"><?php echo wp_kses_post( wpautop( $description ) ); ?></div>
813 813
 		</div>
814 814
 		<?php
815
-	}
815
+     }
816 816
 }
817 817
 
818 818
 /**
@@ -821,23 +821,23 @@  discard block
 block discarded – undo
821 821
  * @return void
822 822
  */
823 823
 function lsx_health_plan_workout_main_content() {
824
-	// Getting translated endpoint.
825
-	$workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' );
826
-
827
-	$connected_members = get_post_meta( get_the_ID(), ( $workout . '_connected_team_member' ), true );
828
-	$small_description = get_post_meta( get_the_ID(), ( $workout . '_short_description' ), true );
829
-
830
-	$content = '';
831
-	if ( $small_description || $connected_members || lsx_health_plan_has_tips() ) {
832
-		$content .= '<div class="short-desc set-box set content-box entry-content">';
833
-		$content .= '<div class="the-content">';
834
-		$content .= lsx_hp_member_connected( $connected_members, $workout );
835
-		$content .= '<span>' . $small_description . '</span>';
836
-		$content .= '</div>';
837
-		$content .= do_shortcode( '[lsx_health_plan_featured_tips_block]' );
838
-		$content .= '</div>';
839
-	}
840
-	return $content;
824
+     // Getting translated endpoint.
825
+     $workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' );
826
+
827
+     $connected_members = get_post_meta( get_the_ID(), ( $workout . '_connected_team_member' ), true );
828
+     $small_description = get_post_meta( get_the_ID(), ( $workout . '_short_description' ), true );
829
+
830
+     $content = '';
831
+     if ( $small_description || $connected_members || lsx_health_plan_has_tips() ) {
832
+          $content .= '<div class="short-desc set-box set content-box entry-content">';
833
+          $content .= '<div class="the-content">';
834
+          $content .= lsx_hp_member_connected( $connected_members, $workout );
835
+          $content .= '<span>' . $small_description . '</span>';
836
+          $content .= '</div>';
837
+          $content .= do_shortcode( '[lsx_health_plan_featured_tips_block]' );
838
+          $content .= '</div>';
839
+     }
840
+     return $content;
841 841
 }
842 842
 
843 843
 /**
@@ -846,23 +846,23 @@  discard block
 block discarded – undo
846 846
  * @return void
847 847
  */
848 848
 function lsx_health_plan_meal_main_content() {
849
-	// Getting translated endpoint.
850
-	$meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' );
851
-
852
-	$connected_members = get_post_meta( get_the_ID(), ( $meal . '_connected_team_member' ), true );
853
-	$small_description = get_post_meta( get_the_ID(), ( $meal . '_short_description' ), true );
854
-
855
-	$content_meal = '';
856
-	if ( $small_description || $connected_members || lsx_health_plan_has_tips() ) {
857
-		$content_meal .= '<div class="set-box set content-box entry-content">';
858
-		$content_meal .= '<div class="the-content">';
859
-		$content_meal .= lsx_hp_member_connected( $connected_members, $meal );
860
-		$content_meal .= '<span>' . $small_description . '</span>';
861
-		$content_meal .= '</div>';
862
-		$content_meal .= do_shortcode( '[lsx_health_plan_featured_tips_block]' );
863
-		$content_meal .= '</div>';
864
-	}
865
-	return $content_meal;
849
+     // Getting translated endpoint.
850
+     $meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' );
851
+
852
+     $connected_members = get_post_meta( get_the_ID(), ( $meal . '_connected_team_member' ), true );
853
+     $small_description = get_post_meta( get_the_ID(), ( $meal . '_short_description' ), true );
854
+
855
+     $content_meal = '';
856
+     if ( $small_description || $connected_members || lsx_health_plan_has_tips() ) {
857
+          $content_meal .= '<div class="set-box set content-box entry-content">';
858
+          $content_meal .= '<div class="the-content">';
859
+          $content_meal .= lsx_hp_member_connected( $connected_members, $meal );
860
+          $content_meal .= '<span>' . $small_description . '</span>';
861
+          $content_meal .= '</div>';
862
+          $content_meal .= do_shortcode( '[lsx_health_plan_featured_tips_block]' );
863
+          $content_meal .= '</div>';
864
+     }
865
+     return $content_meal;
866 866
 }
867 867
 
868 868
 
@@ -873,36 +873,36 @@  discard block
 block discarded – undo
873 873
  * @return void
874 874
  */
875 875
 function lsx_health_plan_workout_tab_content( $index = 1 ) {
876
-	global $group_name,$shortcode_args;
877
-	$group_name = 'workout_section_' . $index;
878
-	if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) {
879
-		$layout = strtolower( \lsx_health_plan\functions\get_option( 'workout_tab_layout', 'table' ) );
880
-
881
-		// Check for shortcode overrides.
882
-		if ( null !== $shortcode_args && isset( $shortcode_args['layout'] ) ) {
883
-			$layout = $shortcode_args['layout'];
884
-		}
885
-	} else {
886
-		$layout = 'table';
887
-	}
888
-
889
-	switch ( $layout ) {
890
-		case 'list':
891
-			$tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-list.php';
892
-			break;
893
-
894
-		case 'grid':
895
-			$tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-grid.php';
896
-			break;
897
-
898
-		case 'table':
899
-			$tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-table.php';
900
-			break;
901
-	}
902
-	$tab_template_path = apply_filters( 'lsx_health_plan_workout_tab_content_path', $tab_template_path );
903
-	if ( '' !== $tab_template_path ) {
904
-		include $tab_template_path;
905
-	}
876
+     global $group_name,$shortcode_args;
877
+     $group_name = 'workout_section_' . $index;
878
+     if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) {
879
+          $layout = strtolower( \lsx_health_plan\functions\get_option( 'workout_tab_layout', 'table' ) );
880
+
881
+          // Check for shortcode overrides.
882
+          if ( null !== $shortcode_args && isset( $shortcode_args['layout'] ) ) {
883
+               $layout = $shortcode_args['layout'];
884
+          }
885
+     } else {
886
+          $layout = 'table';
887
+     }
888
+
889
+     switch ( $layout ) {
890
+          case 'list':
891
+               $tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-list.php';
892
+               break;
893
+
894
+          case 'grid':
895
+               $tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-grid.php';
896
+               break;
897
+
898
+          case 'table':
899
+               $tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-table.php';
900
+               break;
901
+     }
902
+     $tab_template_path = apply_filters( 'lsx_health_plan_workout_tab_content_path', $tab_template_path );
903
+     if ( '' !== $tab_template_path ) {
904
+          include $tab_template_path;
905
+     }
906 906
 }
907 907
 
908 908
 /**
@@ -911,28 +911,28 @@  discard block
 block discarded – undo
911 911
  * @return void
912 912
  */
913 913
 function lsx_health_plan_workout_sets() {
914
-	if ( is_singular( 'workout' ) ) {
915
-		global $connected_workouts;
916
-		$connected_workouts = array( get_the_ID() );
917
-	}
918
-	if ( is_singular( 'plan' ) ) {
919
-
920
-		global $connected_workouts;
921
-
922
-		$section_key  = get_query_var( 'section' );
923
-		if ( '' !== $section && \lsx_health_plan\functions\plan\has_sections() ) {
924
-			$section_info = \lsx_health_plan\functions\plan\get_section_info( $section_key );
925
-			if ( isset( $section_info['connected_workouts'] ) && '' !== $section_info['connected_workouts'] ) {
926
-
927
-				$connected_workouts = \lsx_health_plan\functions\prep_array( $section_info['connected_workouts'] );
928
-			}
929
-		}
930
-	}
931
-	$template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-sets.php';
932
-	$template_path = apply_filters( 'lsx_health_plan_workout_set_template_path', $template_path );
933
-	if ( '' !== $template_path && ! empty( $template_path ) ) {
934
-		include $template_path;
935
-	}
914
+     if ( is_singular( 'workout' ) ) {
915
+          global $connected_workouts;
916
+          $connected_workouts = array( get_the_ID() );
917
+     }
918
+     if ( is_singular( 'plan' ) ) {
919
+
920
+          global $connected_workouts;
921
+
922
+          $section_key  = get_query_var( 'section' );
923
+          if ( '' !== $section && \lsx_health_plan\functions\plan\has_sections() ) {
924
+               $section_info = \lsx_health_plan\functions\plan\get_section_info( $section_key );
925
+               if ( isset( $section_info['connected_workouts'] ) && '' !== $section_info['connected_workouts'] ) {
926
+
927
+                    $connected_workouts = \lsx_health_plan\functions\prep_array( $section_info['connected_workouts'] );
928
+               }
929
+          }
930
+     }
931
+     $template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-sets.php';
932
+     $template_path = apply_filters( 'lsx_health_plan_workout_set_template_path', $template_path );
933
+     if ( '' !== $template_path && ! empty( $template_path ) ) {
934
+          include $template_path;
935
+     }
936 936
 }
937 937
 
938 938
 /**
@@ -943,11 +943,11 @@  discard block
 block discarded – undo
943 943
  */
944 944
 function lsx_health_plan_warmup_sets( $connected_workouts ) {
945 945
 	
946
-	$template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-sets.php';
947
-	$template_path = apply_filters( 'lsx_health_plan_workout_set_template_path', $template_path );
948
-	if ( '' !== $template_path && ! empty( $template_path ) ) {
949
-		include $template_path;
950
-	}
946
+     $template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-sets.php';
947
+     $template_path = apply_filters( 'lsx_health_plan_workout_set_template_path', $template_path );
948
+     if ( '' !== $template_path && ! empty( $template_path ) ) {
949
+          include $template_path;
950
+     }
951 951
 }
952 952
 
953 953
 /**
@@ -957,48 +957,48 @@  discard block
 block discarded – undo
957 957
  * @return void
958 958
  */
959 959
 function lsx_hp_meal_plan_recipes( $args = array() ) {
960
-	$defaults = array(
961
-		'meal_id'   => false,
962
-		'meal_time' => '',
963
-		'modal'     => true,
964
-	);
965
-	$args     = wp_parse_args( $args, $defaults );
966
-	// Looking for recipes.
967
-	$connected_recipes = get_post_meta( $args['meal_id'], $args['meal_time'] . '_recipes', true );
968
-	if ( ! empty( $connected_recipes ) ) {
969
-		$query_args    = array(
970
-			'orderby'   => 'date',
971
-			'order'     => 'DESC',
972
-			'post_type' => 'recipe',
973
-			'post__in'  => $connected_recipes,
974
-		);
975
-		$recipes = new WP_Query( $query_args );
976
-		?>
960
+     $defaults = array(
961
+          'meal_id'   => false,
962
+          'meal_time' => '',
963
+          'modal'     => true,
964
+     );
965
+     $args     = wp_parse_args( $args, $defaults );
966
+     // Looking for recipes.
967
+     $connected_recipes = get_post_meta( $args['meal_id'], $args['meal_time'] . '_recipes', true );
968
+     if ( ! empty( $connected_recipes ) ) {
969
+          $query_args    = array(
970
+               'orderby'   => 'date',
971
+               'order'     => 'DESC',
972
+               'post_type' => 'recipe',
973
+               'post__in'  => $connected_recipes,
974
+          );
975
+          $recipes = new WP_Query( $query_args );
976
+          ?>
977 977
 		<div class="recipes">
978 978
 			<div class="row eating-row">
979 979
 			<?php
980
-			if ( $recipes->have_posts() ) {
981
-				while ( $recipes->have_posts() ) {
982
-					$recipes->the_post();
983
-					if ( false !== $args['modal'] ) {
984
-						\lsx_health_plan\functions\recipes\register_recipe_modal();
985
-					}
986
-					?>
980
+               if ( $recipes->have_posts() ) {
981
+                    while ( $recipes->have_posts() ) {
982
+                         $recipes->the_post();
983
+                         if ( false !== $args['modal'] ) {
984
+                              \lsx_health_plan\functions\recipes\register_recipe_modal();
985
+                         }
986
+                         ?>
987 987
 					<div class="recipe-column">
988 988
 						<a data-toggle="modal" data-target="#recipe-modal-<?php echo esc_attr( get_the_ID() ); ?>" href="#recipe-modal-<?php echo esc_attr( get_the_ID() ); ?>" class="recipe-box box-shadow">
989 989
 							<div class="recipe-feature-img">
990 990
 								<?php
991
-								$featured_image = get_the_post_thumbnail();
992
-								if ( ! empty( $featured_image ) && '' !== $featured_image ) {
993
-									the_post_thumbnail( 'lsx-thumbnail-square', array(
994
-										'class' => 'aligncenter',
995
-									) );
996
-								} else {
997
-									?>
991
+                                        $featured_image = get_the_post_thumbnail();
992
+                                        if ( ! empty( $featured_image ) && '' !== $featured_image ) {
993
+                                             the_post_thumbnail( 'lsx-thumbnail-square', array(
994
+                                                  'class' => 'aligncenter',
995
+                                             ) );
996
+                                        } else {
997
+                                             ?>
998 998
 									<img loading="lazy" class="placeholder" src="<?php echo esc_attr( plugin_dir_url( __DIR__ ) . 'assets/images/placeholder.jpg' ); ?>">
999 999
 									<?php
1000
-								}
1001
-								?>
1000
+                                        }
1001
+                                        ?>
1002 1002
 							</div>
1003 1003
 							<div class="recipe-content">
1004 1004
 								<h3 class="recipe-title"><?php the_title(); ?></h3>
@@ -1007,41 +1007,41 @@  discard block
 block discarded – undo
1007 1007
 						</a>
1008 1008
 					</div>
1009 1009
 				<?php
1010
-				}
1011
-			}
1012
-			wp_reset_postdata();
1013
-			?>
1010
+                    }
1011
+               }
1012
+               wp_reset_postdata();
1013
+               ?>
1014 1014
 			</div>
1015 1015
 		</div>
1016 1016
 		<?php
1017 1017
 
1018
-	}
1018
+     }
1019 1019
 }
1020 1020
 
1021 1021
 /**
1022 1022
  * Output the connected.
1023 1023
  */
1024 1024
 function lsx_hp_recipe_plan_meta( $args = array() ) {
1025
-	$defaults = array();
1026
-	$top_level_plans = array();
1027
-	// Get meals this exercise is connected to.
1028
-	$plans = get_post_meta( get_the_ID(), 'connected_plans', true );
1029
-	if ( ! empty( $plans ) ) {
1030
-		$plan       = end( $plans );
1031
-		$has_parent = wp_get_post_parent_id( $plan );
1032
-		if ( 0 === $has_parent ) {
1033
-			$top_level_plans[] = $plan;
1034
-		} elseif ( false !== $top_level_plans ) {
1035
-			$top_level_plans[] = $has_parent;
1036
-		}
1037
-	}
1038
-	if ( ! empty( $top_level_plans ) && ( '' !== $top_level_plans ) ) {
1039
-		$top_level_plans = array_unique( $top_level_plans );
1040
-		$top_level_plan  = end( $top_level_plans );
1041
-		?>
1025
+     $defaults = array();
1026
+     $top_level_plans = array();
1027
+     // Get meals this exercise is connected to.
1028
+     $plans = get_post_meta( get_the_ID(), 'connected_plans', true );
1029
+     if ( ! empty( $plans ) ) {
1030
+          $plan       = end( $plans );
1031
+          $has_parent = wp_get_post_parent_id( $plan );
1032
+          if ( 0 === $has_parent ) {
1033
+               $top_level_plans[] = $plan;
1034
+          } elseif ( false !== $top_level_plans ) {
1035
+               $top_level_plans[] = $has_parent;
1036
+          }
1037
+     }
1038
+     if ( ! empty( $top_level_plans ) && ( '' !== $top_level_plans ) ) {
1039
+          $top_level_plans = array_unique( $top_level_plans );
1040
+          $top_level_plan  = end( $top_level_plans );
1041
+          ?>
1042 1042
 			<span class="recipe-type recipe-parent"><?php echo esc_html( get_the_title( $top_level_plan ) ); ?></span>
1043 1043
 		<?php
1044
-	}
1044
+     }
1045 1045
 }
1046 1046
 
1047 1047
 /**
@@ -1049,42 +1049,42 @@  discard block
 block discarded – undo
1049 1049
  */
1050 1050
 function lsx_hp_exercise_plan_meta() {
1051 1051
 
1052
-	$top_level_plans = array();
1053
-
1054
-	// Get workouts this exercise is connected to.
1055
-	$workouts = get_post_meta( get_the_ID(), 'connected_workouts', true );
1056
-
1057
-	if ( '' !== $workouts && ! is_array( $workouts ) ) {
1058
-		$workouts = array( $workouts );
1059
-	}
1060
-	if ( ! empty( $workouts ) ) {
1061
-		foreach ( $workouts as $workout ) {
1062
-			// Get the plans this workout is connected to.
1063
-			$plans = get_post_meta( $workout, 'connected_plans', true );
1064
-
1065
-			if ( '' !== $plans && ! is_array( $plans ) ) {
1066
-				$plans = array( $plans );
1067
-			}
1068
-			if ( ! empty( $plans ) ) {
1069
-				foreach ( $plans as $plan ) {
1070
-					$has_parent = wp_get_post_parent_id( $plan );
1071
-					if ( 0 === $has_parent ) {
1072
-						$top_level_plans = $plan;
1073
-					} else {
1074
-						$top_level_plans = $has_parent;
1075
-					}
1076
-				}
1077
-			}
1078
-		}
1079
-	}
1080
-
1081
-	if ( ! empty( $top_level_plans ) && ( '' !== $top_level_plans ) ) {
1082
-		$top_level_plans = array_unique( $top_level_plans );
1083
-		$top_level_plan  = end( $top_level_plans );
1084
-		?>
1052
+     $top_level_plans = array();
1053
+
1054
+     // Get workouts this exercise is connected to.
1055
+     $workouts = get_post_meta( get_the_ID(), 'connected_workouts', true );
1056
+
1057
+     if ( '' !== $workouts && ! is_array( $workouts ) ) {
1058
+          $workouts = array( $workouts );
1059
+     }
1060
+     if ( ! empty( $workouts ) ) {
1061
+          foreach ( $workouts as $workout ) {
1062
+               // Get the plans this workout is connected to.
1063
+               $plans = get_post_meta( $workout, 'connected_plans', true );
1064
+
1065
+               if ( '' !== $plans && ! is_array( $plans ) ) {
1066
+                    $plans = array( $plans );
1067
+               }
1068
+               if ( ! empty( $plans ) ) {
1069
+                    foreach ( $plans as $plan ) {
1070
+                         $has_parent = wp_get_post_parent_id( $plan );
1071
+                         if ( 0 === $has_parent ) {
1072
+                              $top_level_plans = $plan;
1073
+                         } else {
1074
+                              $top_level_plans = $has_parent;
1075
+                         }
1076
+                    }
1077
+               }
1078
+          }
1079
+     }
1080
+
1081
+     if ( ! empty( $top_level_plans ) && ( '' !== $top_level_plans ) ) {
1082
+          $top_level_plans = array_unique( $top_level_plans );
1083
+          $top_level_plan  = end( $top_level_plans );
1084
+          ?>
1085 1085
 			<span class="recipe-type recipe-parent"><?php echo esc_html( get_the_title( $top_level_plan ) ); ?></span>
1086 1086
 		<?php
1087
-	}
1087
+     }
1088 1088
 }
1089 1089
 
1090 1090
 /**
@@ -1094,7 +1094,7 @@  discard block
 block discarded – undo
1094 1094
  * @return void
1095 1095
  */
1096 1096
 function lsx_hp_single_related( $related_content, $post_type_text ) {
1097
-	?>
1097
+     ?>
1098 1098
 	<section id="lsx-hp-related">
1099 1099
 		<div class="row lsx-related-posts lsx-related-posts-title">
1100 1100
 			<div class="col-xs-12">
@@ -1105,14 +1105,14 @@  discard block
 block discarded – undo
1105 1105
 			<div class="col-xs-12">
1106 1106
 				<div class="lsx-related-posts-wrapper">
1107 1107
 					<?php
1108
-					$i = 0;
1109
-					foreach ( $related_content as $article ) {
1110
-						$post_title      = get_the_title( $article );
1111
-						$post_categories = wp_get_post_categories( $article );
1112
-						$post_link       = get_permalink( $article );
1113
-
1114
-						$cats = array();
1115
-						?>
1108
+                         $i = 0;
1109
+                         foreach ( $related_content as $article ) {
1110
+                              $post_title      = get_the_title( $article );
1111
+                              $post_categories = wp_get_post_categories( $article );
1112
+                              $post_link       = get_permalink( $article );
1113
+
1114
+                              $cats = array();
1115
+                              ?>
1116 1116
 						<article id="post-<?php echo esc_html( $article ); ?>" class="lsx-slot post">
1117 1117
 							<div class="entry-layout lsx-hp-shadow">
1118 1118
 								<div class="entry-layout-content">
@@ -1120,25 +1120,25 @@  discard block
 block discarded – undo
1120 1120
 										<div class="entry-image">
1121 1121
 											<a href="<?php echo esc_url( $post_link ); ?>" class="thumbnail">
1122 1122
 											<?php
1123
-											$featured_image = get_the_post_thumbnail( $article, 'lsx-thumbnail-wide' );
1124
-											if ( ! empty( $featured_image ) && '' !== $featured_image ) {
1125
-												echo wp_kses_post( $featured_image );
1126
-											} else {
1127
-												?>
1123
+                                                       $featured_image = get_the_post_thumbnail( $article, 'lsx-thumbnail-wide' );
1124
+                                                       if ( ! empty( $featured_image ) && '' !== $featured_image ) {
1125
+                                                            echo wp_kses_post( $featured_image );
1126
+                                                       } else {
1127
+                                                            ?>
1128 1128
 												<img loading="lazy" class="placeholder" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>">
1129 1129
 												<?php
1130
-											}
1131
-											?>
1130
+                                                       }
1131
+                                                       ?>
1132 1132
 											</a>
1133 1133
 										</div>
1134 1134
 										<div class="entry-meta">
1135 1135
 										<?php
1136
-										foreach ( $post_categories as $c ) {
1137
-											$cat = get_category( $c );
1138
-											/* Translators: %s: category name */
1139
-											$cats[] = '<a href="' . esc_url( get_category_link( $cat->term_id ) ) . '" title="' . sprintf( esc_html__( 'Posts in %s', 'lsx-blog-customizer' ), $cat->name ) . '">' . $cat->name . '</a>';
1140
-										}
1141
-										if ( ! empty( $cats ) ) { ?>
1136
+                                                  foreach ( $post_categories as $c ) {
1137
+                                                       $cat = get_category( $c );
1138
+                                                       /* Translators: %s: category name */
1139
+                                                       $cats[] = '<a href="' . esc_url( get_category_link( $cat->term_id ) ) . '" title="' . sprintf( esc_html__( 'Posts in %s', 'lsx-blog-customizer' ), $cat->name ) . '">' . $cat->name . '</a>';
1140
+                                                  }
1141
+                                                  if ( ! empty( $cats ) ) { ?>
1142 1142
 											<div class="post-categories"><span></span><?php echo wp_kses_post( implode( ', ', $cats ) ); ?></div>
1143 1143
 										<?php } ?>
1144 1144
 										</div>
@@ -1153,8 +1153,8 @@  discard block
 block discarded – undo
1153 1153
 						</article>
1154 1154
 
1155 1155
 					<?php
1156
-					if (++$i === 3) break;
1157
-					} ?>
1156
+                         if (++$i === 3) break;
1157
+                         } ?>
1158 1158
 				</div>
1159 1159
 			</div>
1160 1160
 		</div>
@@ -1169,32 +1169,32 @@  discard block
 block discarded – undo
1169 1169
  * @return void
1170 1170
  */
1171 1171
 function lsx_hp_member_connected( $connected_members, $post_type ) {
1172
-	if ( ! empty( $connected_members ) ) {
1173
-		$content = '<div id="hp-connected-members" class="hp-connected-members connected-' . $post_type . '">';
1174
-		foreach ( $connected_members as $member ) {
1175
-			$post_link   = get_permalink( $member );
1176
-			$member_name = get_the_title( $member );
1177
-			$member_name = '<span class="lsx-team-name">' . $member_name . '</span>';
1178
-
1179
-			$member_link = '<a href="' . $post_link . '" >' . $member_name . '</a>';
1180
-
1181
-			$roles = '';
1182
-			$terms = get_the_terms( $member, 'team_role' );
1183
-
1184
-			if ( $terms && ! is_wp_error( $terms ) ) {
1185
-				$roles = array();
1186
-
1187
-				foreach ( $terms as $term ) {
1188
-					$roles[] = $term->name;
1189
-				}
1190
-
1191
-				$roles = join( ', ', $roles );
1192
-			}
1193
-			$member_roles = '' !== $roles ? "<small class='lsx-team-roles'>$roles</small>" : '';
1194
-
1195
-			$content .= '<p>' . $member_roles . ': ' . $member_link . '</p>';
1196
-		}
1197
-		$content .= '</div>';
1198
-		return $content;
1199
-	}
1172
+     if ( ! empty( $connected_members ) ) {
1173
+          $content = '<div id="hp-connected-members" class="hp-connected-members connected-' . $post_type . '">';
1174
+          foreach ( $connected_members as $member ) {
1175
+               $post_link   = get_permalink( $member );
1176
+               $member_name = get_the_title( $member );
1177
+               $member_name = '<span class="lsx-team-name">' . $member_name . '</span>';
1178
+
1179
+               $member_link = '<a href="' . $post_link . '" >' . $member_name . '</a>';
1180
+
1181
+               $roles = '';
1182
+               $terms = get_the_terms( $member, 'team_role' );
1183
+
1184
+               if ( $terms && ! is_wp_error( $terms ) ) {
1185
+                    $roles = array();
1186
+
1187
+                    foreach ( $terms as $term ) {
1188
+                         $roles[] = $term->name;
1189
+                    }
1190
+
1191
+                    $roles = join( ', ', $roles );
1192
+               }
1193
+               $member_roles = '' !== $roles ? "<small class='lsx-team-roles'>$roles</small>" : '';
1194
+
1195
+               $content .= '<p>' . $member_roles . ': ' . $member_link . '</p>';
1196
+          }
1197
+          $content .= '</div>';
1198
+          return $content;
1199
+     }
1200 1200
 }
Please login to merge, or discard this patch.
Spacing   +289 added lines, -289 removed lines patch added patch discarded remove patch
@@ -11,26 +11,26 @@  discard block
 block discarded – undo
11 11
 * @return void
12 12
 */
13 13
 function lsx_health_plan_workout_box() {
14
-	if ( ! post_type_exists( 'workout' ) ) {
14
+	if ( ! post_type_exists('workout')) {
15 15
 		return;
16 16
 	}
17
-	$intro_text = \lsx_health_plan\functions\get_option( 'workout_intro', false );
17
+	$intro_text = \lsx_health_plan\functions\get_option('workout_intro', false);
18 18
 	?>
19 19
 	<div class="workout-instructions">
20 20
 		<div class="row">
21 21
 			<div class="col-md-12">
22 22
 			<?php
23
-			if ( false !== $intro_text ) {
23
+			if (false !== $intro_text) {
24 24
 				?>
25 25
 				<div class="excerpt">
26
-					<p><?php echo wp_kses_post( wpautop( $intro_text ) ); ?></p>
26
+					<p><?php echo wp_kses_post(wpautop($intro_text)); ?></p>
27 27
 				</div>
28 28
 				<?php
29 29
 			} else {
30 30
 				?>
31 31
 				<div class="content-intro">
32
-					<h3><?php esc_html_e( "Don't forget your warm up!", 'lsx-health-plan' ); ?></h3>
33
-					<p><?php esc_html_e( 'Be sure to do the warm-up before every workout session.', 'lsx-health-plan' ); ?></p>
32
+					<h3><?php esc_html_e("Don't forget your warm up!", 'lsx-health-plan'); ?></h3>
33
+					<p><?php esc_html_e('Be sure to do the warm-up before every workout session.', 'lsx-health-plan'); ?></p>
34 34
 				</div>
35 35
 				<?php
36 36
 			} ?>
@@ -46,29 +46,29 @@  discard block
 block discarded – undo
46 46
 * @return void
47 47
 */
48 48
 function lsx_health_plan_meal_box() {
49
-	if ( ! post_type_exists( 'meal' ) ) {
49
+	if ( ! post_type_exists('meal')) {
50 50
 		return;
51 51
 	}
52 52
 	?>
53 53
 	<div class="col-md-4" >
54 54
 		<div class="lsx-health-plan-box">
55
-			<h3 class="title meal-plan-title title-lined"><?php esc_html_e( 'Your Meal Plan', 'lsx-health-plan' ); ?><?php lsx_get_svg_icon( 'meal.svg' ); ?></h3>
55
+			<h3 class="title meal-plan-title title-lined"><?php esc_html_e('Your Meal Plan', 'lsx-health-plan'); ?><?php lsx_get_svg_icon('meal.svg'); ?></h3>
56 56
 			<div class="spacer"></div>
57 57
 			<?php
58
-			$intro_text = \lsx_health_plan\functions\get_option( 'meal_plan_intro', false );
59
-			if ( false !== $intro_text ) {
58
+			$intro_text = \lsx_health_plan\functions\get_option('meal_plan_intro', false);
59
+			if (false !== $intro_text) {
60 60
 				?>
61 61
 				<div class="excerpt">
62
-					<p><?php echo wp_kses_post( $intro_text ); ?></p>
62
+					<p><?php echo wp_kses_post($intro_text); ?></p>
63 63
 				</div>
64 64
 				<?php
65 65
 			}
66
-			$meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', false );
67
-			if ( false === $meal ) {
66
+			$meal = \lsx_health_plan\functions\get_option('endpoint_meal', false);
67
+			if (false === $meal) {
68 68
 				$meal = 'meal';
69 69
 			}
70 70
 			?>
71
-			<a href="<?php the_permalink(); ?><?php echo esc_attr( $meal ); ?>/" class="btn"><?php esc_html_e( 'View your meal plan', 'lsx-health-plan' ); ?></a>
71
+			<a href="<?php the_permalink(); ?><?php echo esc_attr($meal); ?>/" class="btn"><?php esc_html_e('View your meal plan', 'lsx-health-plan'); ?></a>
72 72
 		</div>
73 73
 	</div>
74 74
 <?php
@@ -80,29 +80,29 @@  discard block
 block discarded – undo
80 80
 * @return void
81 81
 */
82 82
 function lsx_health_plan_recipe_box() {
83
-	if ( ! post_type_exists( 'recipe' ) ) {
83
+	if ( ! post_type_exists('recipe')) {
84 84
 		return;
85 85
 	}
86 86
 	?>
87 87
 	<div class="col-md-4" >
88 88
 		<div class="lsx-health-plan-box">
89
-			<h3 class="title recipes-title title-lined"><?php esc_html_e( 'Recipes', 'lsx-health-plan' ); ?><?php lsx_get_svg_icon( 'recipes.svg' ); ?></h3>
89
+			<h3 class="title recipes-title title-lined"><?php esc_html_e('Recipes', 'lsx-health-plan'); ?><?php lsx_get_svg_icon('recipes.svg'); ?></h3>
90 90
 			<div class="spacer"></div>
91 91
 			<?php
92
-			$intro_text = \lsx_health_plan\functions\get_option( 'recipes_intro', false );
93
-			if ( false !== $intro_text ) {
92
+			$intro_text = \lsx_health_plan\functions\get_option('recipes_intro', false);
93
+			if (false !== $intro_text) {
94 94
 				?>
95 95
 				<div class="excerpt">
96
-					<p><?php echo wp_kses_post( $intro_text ); ?></p>
96
+					<p><?php echo wp_kses_post($intro_text); ?></p>
97 97
 				</div>
98 98
 				<?php
99 99
 			}
100
-			$recipes = \lsx_health_plan\functions\get_option( 'endpoint_recipe', false );
101
-			if ( false === $recipes ) {
100
+			$recipes = \lsx_health_plan\functions\get_option('endpoint_recipe', false);
101
+			if (false === $recipes) {
102 102
 				$recipes = 'recipes';
103 103
 			}
104 104
 			?>
105
-			<a href="<?php the_permalink(); ?><?php echo esc_attr( $recipes ); ?>/" class="btn"><?php esc_html_e( 'View all recipes', 'lsx-health-plan' ); ?></a>
105
+			<a href="<?php the_permalink(); ?><?php echo esc_attr($recipes); ?>/" class="btn"><?php esc_html_e('View all recipes', 'lsx-health-plan'); ?></a>
106 106
 		</div>
107 107
 	</div>
108 108
 <?php
@@ -118,15 +118,15 @@  discard block
 block discarded – undo
118 118
 	?>
119 119
 	<div class="col-md-4 day-download-box" >
120 120
 		<div class="lsx-health-plan-box">
121
-			<h3 class="title downloads-title title-lined"><?php esc_html_e( 'Downloads', 'lsx-health-plan' ); ?><?php lsx_get_svg_icon( 'download.svg' ); ?></h3>
121
+			<h3 class="title downloads-title title-lined"><?php esc_html_e('Downloads', 'lsx-health-plan'); ?><?php lsx_get_svg_icon('download.svg'); ?></h3>
122 122
 			<div class="spacer"></div>
123 123
 			<div class="download-list">
124 124
 				<ul>
125 125
 					<?php
126 126
 					$downloads = \lsx_health_plan\functions\get_downloads();
127
-					if ( ! empty( $downloads ) ) {
128
-						foreach ( $downloads as $download ) {
129
-							echo wp_kses_post( '<li><a href=""><i class="fa fa-file-pdf"></i>' . do_shortcode( '[download id="' . $download . '"]' ) . '</a></li>' );
127
+					if ( ! empty($downloads)) {
128
+						foreach ($downloads as $download) {
129
+							echo wp_kses_post('<li><a href=""><i class="fa fa-file-pdf"></i>' . do_shortcode('[download id="' . $download . '"]') . '</a></li>');
130 130
 						}
131 131
 					}
132 132
 					?>
@@ -143,15 +143,15 @@  discard block
 block discarded – undo
143 143
  * @param string $tab
144 144
  * @return void
145 145
  */
146
-function lsx_health_plan_nav_class( $tab = '' ) {
146
+function lsx_health_plan_nav_class($tab = '') {
147 147
 	$nav_classes = array();
148
-	if ( function_exists( 'is_wc_endpoint_url' ) && 'edit-account' === $tab && is_wc_endpoint_url( 'edit-account' ) ) {
148
+	if (function_exists('is_wc_endpoint_url') && 'edit-account' === $tab && is_wc_endpoint_url('edit-account')) {
149 149
 		$nav_classes[] = 'active';
150
-	} elseif ( lsx_health_plan_is_current_tab( $tab ) ) {
150
+	} elseif (lsx_health_plan_is_current_tab($tab)) {
151 151
 		$nav_classes[] = 'active';
152 152
 	}
153
-	if ( ! empty( $nav_classes ) ) {
154
-		echo wp_kses_post( implode( ' ', $nav_classes ) );
153
+	if ( ! empty($nav_classes)) {
154
+		echo wp_kses_post(implode(' ', $nav_classes));
155 155
 	}
156 156
 }
157 157
 
@@ -166,25 +166,25 @@  discard block
 block discarded – undo
166 166
 		<ul class="nav nav-pills">
167 167
 			<li class="
168 168
 			<?php
169
-			if ( ( function_exists( 'is_wc_endpoint_url' ) && ! is_wc_endpoint_url( 'edit-account' ) ) || ! function_exists( 'is_wc_endpoint_url' ) ) {
170
-				echo esc_attr( 'active' );
169
+			if ((function_exists('is_wc_endpoint_url') && ! is_wc_endpoint_url('edit-account')) || ! function_exists('is_wc_endpoint_url')) {
170
+				echo esc_attr('active');
171 171
 			}
172 172
 			?>
173
-			"><a class="my-plan-tab" href="<?php the_permalink(); ?>"><?php esc_html_e( 'My Plans', 'lsx-health-plan' ); ?></a></li>
173
+			"><a class="my-plan-tab" href="<?php the_permalink(); ?>"><?php esc_html_e('My Plans', 'lsx-health-plan'); ?></a></li>
174 174
 			<?php
175
-			if ( function_exists( 'WC' ) ) {
175
+			if (function_exists('WC')) {
176 176
 				?>
177 177
 				<li class="
178 178
 				<?php
179
-				if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'edit-account' ) ) {
180
-					echo esc_attr( 'active' );
179
+				if (function_exists('is_wc_endpoint_url') && is_wc_endpoint_url('edit-account')) {
180
+					echo esc_attr('active');
181 181
 				}
182 182
 				?>
183
-				"><a class="account-details-tab" href="<?php the_permalink(); ?>edit-account/"><?php esc_html_e( 'Account Details', 'lsx-health-plan' ); ?></a></li>
183
+				"><a class="account-details-tab" href="<?php the_permalink(); ?>edit-account/"><?php esc_html_e('Account Details', 'lsx-health-plan'); ?></a></li>
184 184
 				<?php
185 185
 			}
186 186
 			?>
187
-			<li class=""><a class="logout-tab" href="<?php echo esc_url( wp_logout_url( get_permalink() ) ); ?>"><?php esc_html_e( 'Logout', 'lsx-health-plan' ); ?></a></li>
187
+			<li class=""><a class="logout-tab" href="<?php echo esc_url(wp_logout_url(get_permalink())); ?>"><?php esc_html_e('Logout', 'lsx-health-plan'); ?></a></li>
188 188
 		</ul>
189 189
 	</div>
190 190
 	<?php
@@ -199,76 +199,76 @@  discard block
 block discarded – undo
199 199
 	?>
200 200
 	<div class="lsx-health-plan my-profile-block wp-block-cover alignfull">
201 201
 		<div class="wp-block-cover__inner-container">
202
-			<h2><?php esc_html_e( 'My Dashboard', 'lsx-health-plan' ); ?></h2>
202
+			<h2><?php esc_html_e('My Dashboard', 'lsx-health-plan'); ?></h2>
203 203
 			<section id="dashboard-card">
204 204
 				<div class="profile-navigation">
205 205
 					<div class="profile-photo">
206 206
 					<?php
207 207
 						global $current_user;
208 208
 						get_current_user();
209
-						echo get_avatar( $current_user->ID, 240 );
209
+						echo get_avatar($current_user->ID, 240);
210 210
 						?>
211 211
 					</div>
212 212
 				</div>
213 213
 				<div class="profile-details">
214
-					<h1 class="title-lined has-text-color"><?php echo esc_html( $current_user->display_name ); ?></h1>
214
+					<h1 class="title-lined has-text-color"><?php echo esc_html($current_user->display_name); ?></h1>
215 215
 					<?php
216
-					$disable_stats = \lsx_health_plan\functions\get_option( 'disable_all_stats', false );
217
-					if ( 'on' !== $disable_stats && function_exists( 'WC' ) ) {
216
+					$disable_stats = \lsx_health_plan\functions\get_option('disable_all_stats', false);
217
+					if ('on' !== $disable_stats && function_exists('WC')) {
218 218
 
219
-						$is_weight_disabled = \lsx_health_plan\functions\get_option( 'disable_weight_checkbox', false );
220
-						$is_height_disabled = \lsx_health_plan\functions\get_option( 'disable_height_checkbox', false );
221
-						$is_waist_disabled  = \lsx_health_plan\functions\get_option( 'disable_waist_checkbox', false );
222
-						$is_bmi_disabled    = \lsx_health_plan\functions\get_option( 'disable_bmi_checkbox', false );
219
+						$is_weight_disabled = \lsx_health_plan\functions\get_option('disable_weight_checkbox', false);
220
+						$is_height_disabled = \lsx_health_plan\functions\get_option('disable_height_checkbox', false);
221
+						$is_waist_disabled  = \lsx_health_plan\functions\get_option('disable_waist_checkbox', false);
222
+						$is_bmi_disabled    = \lsx_health_plan\functions\get_option('disable_bmi_checkbox', false);
223 223
 
224
-						$weight = get_user_meta( get_current_user_id(), 'weight', true );
225
-						$waist  = get_user_meta( get_current_user_id(), 'waist', true );
226
-						$height = get_user_meta( get_current_user_id(), 'height', true );
224
+						$weight = get_user_meta(get_current_user_id(), 'weight', true);
225
+						$waist  = get_user_meta(get_current_user_id(), 'waist', true);
226
+						$height = get_user_meta(get_current_user_id(), 'height', true);
227 227
 
228 228
 						$height_m = 0;
229
-						if ( is_numeric( $height ) ) {
229
+						if (is_numeric($height)) {
230 230
 							$height_m = $height / 100;
231 231
 						}
232 232
 
233
-						if ( 1 < $weight && 1 < $height_m ) {
234
-							$bmi = $weight / ( $height_m * $height_m );
235
-							$bmi = number_format( $bmi, 1 );
233
+						if (1 < $weight && 1 < $height_m) {
234
+							$bmi = $weight / ($height_m * $height_m);
235
+							$bmi = number_format($bmi, 1);
236 236
 						} else {
237
-							$bmi = __( 'Add more data', 'lsx-health-plan' );
237
+							$bmi = __('Add more data', 'lsx-health-plan');
238 238
 						}
239 239
 
240 240
 						?>
241 241
 
242 242
 						<div>
243
-							<?php if ( 'on' !== $is_weight_disabled ) { ?>
244
-								<span><strong><?php esc_html_e( 'Weight:', 'lsx-health-plan' ); ?></strong>
243
+							<?php if ('on' !== $is_weight_disabled) { ?>
244
+								<span><strong><?php esc_html_e('Weight:', 'lsx-health-plan'); ?></strong>
245 245
 								<?php
246
-								if ( '' !== $weight ) {
247
-									echo wp_kses_post( $weight . ' kg' );
246
+								if ('' !== $weight) {
247
+									echo wp_kses_post($weight . ' kg');
248 248
 								} else {
249 249
 									echo '/';
250 250
 								}
251 251
 								?>
252 252
 								</span>
253 253
 							<?php }
254
-							if ( 'on' !== $is_waist_disabled ) {
254
+							if ('on' !== $is_waist_disabled) {
255 255
 								?>
256
-								<span><strong><?php esc_html_e( 'Waist:', 'lsx-health-plan' ); ?></strong>
256
+								<span><strong><?php esc_html_e('Waist:', 'lsx-health-plan'); ?></strong>
257 257
 								<?php
258
-								if ( '' !== $waist ) {
259
-									echo wp_kses_post( $waist . ' cm' );
258
+								if ('' !== $waist) {
259
+									echo wp_kses_post($waist . ' cm');
260 260
 								} else {
261 261
 									echo '/';
262 262
 								}
263 263
 								?>
264 264
 								</span>
265 265
 							<?php }
266
-							if ( 'on' !== $is_bmi_disabled ) {
266
+							if ('on' !== $is_bmi_disabled) {
267 267
 								?>
268
-								<span><strong><?php esc_html_e( 'BMI:', 'lsx-health-plan' ); ?></strong>
268
+								<span><strong><?php esc_html_e('BMI:', 'lsx-health-plan'); ?></strong>
269 269
 								<?php
270
-								if ( '' !== $bmi ) {
271
-									echo wp_kses_post( $bmi );
270
+								if ('' !== $bmi) {
271
+									echo wp_kses_post($bmi);
272 272
 								} else {
273 273
 									echo '/';
274 274
 								}
@@ -280,17 +280,17 @@  discard block
 block discarded – undo
280 280
 					}
281 281
 
282 282
 					// Only display the edit account link if woocommerce is active.
283
-					if ( function_exists( 'WC' ) ) {
283
+					if (function_exists('WC')) {
284 284
 						?>
285 285
 						<div class="edit-profile">
286 286
 							<?php
287
-							if ( function_exists( 'wc_get_page_id' ) ) {
288
-								$url_id = wc_get_page_id( 'myaccount' );
287
+							if (function_exists('wc_get_page_id')) {
288
+								$url_id = wc_get_page_id('myaccount');
289 289
 							} else {
290 290
 								$url_id = '';
291 291
 							}
292 292
 							?>
293
-							<a href="<?php echo esc_url( get_permalink( $url_id ) ); ?>edit-account/"><?php esc_html_e( 'Edit', 'lsx-health-plan' ); ?></a>
293
+							<a href="<?php echo esc_url(get_permalink($url_id)); ?>edit-account/"><?php esc_html_e('Edit', 'lsx-health-plan'); ?></a>
294 294
 						</div>
295 295
 						<?php
296 296
 					}
@@ -318,9 +318,9 @@  discard block
 block discarded – undo
318 318
 		'post_parent'    => 0,
319 319
 	);
320 320
 
321
-	if ( function_exists( '\lsx_health_plan\functions\woocommerce\get_membership_products' ) ) {
321
+	if (function_exists('\lsx_health_plan\functions\woocommerce\get_membership_products')) {
322 322
 		$product_ids = \lsx_health_plan\functions\woocommerce\get_membership_products();
323
-		if ( ! empty( $product_ids ) ) {
323
+		if ( ! empty($product_ids)) {
324 324
 			$args['meta_query'] = array(
325 325
 				'relation' => 'OR',
326 326
 				array(
@@ -336,82 +336,82 @@  discard block
 block discarded – undo
336 336
 		}
337 337
 	}
338 338
 
339
-	$the_query = new WP_Query( $args );
339
+	$the_query = new WP_Query($args);
340 340
 	?>
341 341
 	<div class="all-plans-block plan-grid block-all-plans-block">
342 342
 		<div class="row">
343 343
 			<?php
344
-			if ( $the_query->have_posts() ) :
345
-				while ( $the_query->have_posts() ) :
344
+			if ($the_query->have_posts()) :
345
+				while ($the_query->have_posts()) :
346 346
 					$the_query->the_post();
347 347
 					lsx_entry_before();
348 348
 					$completed_class = '';
349 349
 					$linked_product  = false;
350 350
 					$restricted      = false;
351 351
 					$product         = null;
352
-					if ( function_exists( 'lsx_health_plan\functions\woocommerce\plan_has_products' ) && \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
352
+					if (function_exists('lsx_health_plan\functions\woocommerce\plan_has_products') && \lsx_health_plan\functions\woocommerce\plan_has_products()) {
353 353
 						$products       = \lsx_health_plan\functions\woocommerce\get_plan_products();
354
-						$linked_product = wc_get_product( $products[0] );
354
+						$linked_product = wc_get_product($products[0]);
355 355
 						$product        = $linked_product;
356 356
 					}
357
-					if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) {
358
-						$restricted = wc_memberships_is_post_content_restricted( get_the_ID() ) && ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
357
+					if (function_exists('wc_memberships_is_post_content_restricted')) {
358
+						$restricted = wc_memberships_is_post_content_restricted(get_the_ID()) && ! current_user_can('wc_memberships_view_restricted_post_content', get_the_ID());
359 359
 					}
360 360
 
361
-					if ( lsx_health_plan_is_plan_complete() ) {
361
+					if (lsx_health_plan_is_plan_complete()) {
362 362
 						$completed_class = 'completed';
363 363
 					}
364 364
 					$round_progress     = '';
365 365
 					$completed_progress = '100';
366
-					if ( false === $restricted ) {
367
-						$round_progress = round( \lsx_health_plan\functions\get_progress( get_the_ID() ), 0 );
366
+					if (false === $restricted) {
367
+						$round_progress = round(\lsx_health_plan\functions\get_progress(get_the_ID()), 0);
368 368
 					}
369 369
 					?>
370 370
 					<div class="col-xs-12 col-sm-6 col-md-4">
371
-						<article class="lsx-slot lsx-hp-shadow <?php echo esc_html( 'progress-') . $round_progress; ?>">
371
+						<article class="lsx-slot lsx-hp-shadow <?php echo esc_html('progress-') . $round_progress; ?>">
372 372
 							<div class="plan-feature-img">
373
-								<?php if ( (int)$completed_progress === (int)$round_progress ) { ?>
374
-									<span class="featured-plan"><?php lsx_get_svg_icon( 'icon-completed.svg' ); ?></span>
373
+								<?php if ((int) $completed_progress === (int) $round_progress) { ?>
374
+									<span class="featured-plan"><?php lsx_get_svg_icon('icon-completed.svg'); ?></span>
375 375
 								<?php } ?>
376
-								<a href="<?php echo esc_url( get_permalink() ); ?>">
376
+								<a href="<?php echo esc_url(get_permalink()); ?>">
377 377
 								<?php
378 378
 								$featured_image = get_the_post_thumbnail();
379
-								if ( ! empty( $featured_image ) && '' !== $featured_image ) {
380
-									the_post_thumbnail( 'lsx-thumbnail', array(
379
+								if ( ! empty($featured_image) && '' !== $featured_image) {
380
+									the_post_thumbnail('lsx-thumbnail', array(
381 381
 										'class' => 'aligncenter',
382
-									) );
382
+									));
383 383
 								} else {
384 384
 									?>
385
-									<img loading="lazy"  class="placeholder" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>">
385
+									<img loading="lazy"  class="placeholder" src="<?php echo esc_attr(plugin_dir_url(__FILE__) . '../assets/images/placeholder.jpg'); ?>">
386 386
 									<?php
387 387
 								}
388 388
 								?>
389 389
 								</a>
390 390
 							</div>
391 391
 							<div class="content-box plan-content-box">
392
-								<h3 class="plan id-<?php the_ID(); ?> <?php echo esc_attr( $completed_class ); ?>"><a href="<?php echo esc_url( get_permalink() ); ?>"><?php the_title(); ?></a></h3>
392
+								<h3 class="plan id-<?php the_ID(); ?> <?php echo esc_attr($completed_class); ?>"><a href="<?php echo esc_url(get_permalink()); ?>"><?php the_title(); ?></a></h3>
393 393
 								<?php
394
-									echo wp_kses_post( \lsx_health_plan\functions\hp_get_plan_type_meta( $post ) );
394
+									echo wp_kses_post(\lsx_health_plan\functions\hp_get_plan_type_meta($post));
395 395
 								?>
396 396
 								<?php
397
-								if ( false !== $linked_product && false !== $restricted ) {
398
-									echo wp_kses_post( $linked_product->get_price_html() );
397
+								if (false !== $linked_product && false !== $restricted) {
398
+									echo wp_kses_post($linked_product->get_price_html());
399 399
 								}
400 400
 								?>
401 401
 								<div class="excerpt">
402 402
 									<?php
403
-									if ( ! has_excerpt() ) {
404
-										$content = wp_trim_words( get_the_content(), 20 );
403
+									if ( ! has_excerpt()) {
404
+										$content = wp_trim_words(get_the_content(), 20);
405 405
 										$content = '<p>' . $content . '</pre>';
406 406
 									} else {
407
-										$content = apply_filters( 'the_excerpt', get_the_excerpt() );
407
+										$content = apply_filters('the_excerpt', get_the_excerpt());
408 408
 									}
409
-									echo wp_kses_post( $content );
409
+									echo wp_kses_post($content);
410 410
 									?>
411 411
 								</div>
412 412
 								<?php
413
-								if ( false === $restricted ) {
414
-									echo wp_kses_post( '<span class="progress"><progress class="bar" value="' . \lsx_health_plan\functions\get_progress( get_the_ID() ) . '" max="100"> ' . \lsx_health_plan\functions\get_progress( get_the_ID() ) . '% </progress><span>' . $round_progress . '%</span></span>' );
413
+								if (false === $restricted) {
414
+									echo wp_kses_post('<span class="progress"><progress class="bar" value="' . \lsx_health_plan\functions\get_progress(get_the_ID()) . '" max="100"> ' . \lsx_health_plan\functions\get_progress(get_the_ID()) . '% </progress><span>' . $round_progress . '%</span></span>');
415 415
 								}
416 416
 								?>
417 417
 							</div>
@@ -431,30 +431,30 @@  discard block
 block discarded – undo
431 431
  *
432 432
  * @return void
433 433
  */
434
-function lsx_health_plan_day_plan_block( $args = array() ) {
434
+function lsx_health_plan_day_plan_block($args = array()) {
435 435
 	$defaults = array(
436 436
 		'plan' => '',
437 437
 	);
438
-	$args     = wp_parse_args( $args, $defaults );
438
+	$args     = wp_parse_args($args, $defaults);
439 439
 
440
-	if ( isset( $args['plan'] ) && '' !== $args['plan'] && \lsx_health_plan\functions\plan\has_sections( $args['plan'] ) ) {
440
+	if (isset($args['plan']) && '' !== $args['plan'] && \lsx_health_plan\functions\plan\has_sections($args['plan'])) {
441 441
 		$sections = \lsx_health_plan\functions\plan\get_sections();
442 442
 		?>
443 443
 		<div class="daily-plan-block day-grid">
444 444
 			<?php
445
-			foreach ( $sections as $section_key => $section_values ) {
446
-				$defaults    = array(
447
-					'title' => __( 'Day', 'lsx-health-plan' ) . ' ' . ( $section_key + 1 ),
445
+			foreach ($sections as $section_key => $section_values) {
446
+				$defaults = array(
447
+					'title' => __('Day', 'lsx-health-plan') . ' ' . ($section_key + 1),
448 448
 				);
449
-				$section_args = wp_parse_args( $section_values, $defaults );
449
+				$section_args = wp_parse_args($section_values, $defaults);
450 450
 
451 451
 				$completed_class = '';
452
-				if ( lsx_health_plan_is_day_complete() ) {
452
+				if (lsx_health_plan_is_day_complete()) {
453 453
 					$completed_class = 'completed';
454 454
 				}
455 455
 				?>
456
-				<a href="<?php echo esc_attr( \lsx_health_plan\functions\plan\get_permalink( $args['plan'], $section_args['title'] ) ); ?>" class="day id-<?php echo esc_attr( $section_key + 1 ); ?> <?php echo esc_attr( $completed_class ); ?>">
457
-					<div class="plan-content"><?php echo esc_attr( $section_args['title'] ); ?></div>
456
+				<a href="<?php echo esc_attr(\lsx_health_plan\functions\plan\get_permalink($args['plan'], $section_args['title'])); ?>" class="day id-<?php echo esc_attr($section_key + 1); ?> <?php echo esc_attr($completed_class); ?>">
457
+					<div class="plan-content"><?php echo esc_attr($section_args['title']); ?></div>
458 458
 				</a>
459 459
 				<?php
460 460
 			}
@@ -470,31 +470,31 @@  discard block
 block discarded – undo
470 470
  * @param  array $args An array of arguments.
471 471
  * @return void
472 472
  */
473
-function lsx_health_plan_week_plan_block( $args = array() ) {
473
+function lsx_health_plan_week_plan_block($args = array()) {
474 474
 	$defaults = array(
475 475
 		'show_downloads' => false,
476 476
 		'plan'           => '',
477 477
 	);
478
-	$args     = wp_parse_args( $args, $defaults );
478
+	$args = wp_parse_args($args, $defaults);
479 479
 
480
-	if ( isset( $args['plan'] ) && '' !== $args['plan'] && \lsx_health_plan\functions\plan\has_sections( $args['plan'] ) ) {
481
-		$groups = \lsx_health_plan\functions\plan\get_sections( true );
480
+	if (isset($args['plan']) && '' !== $args['plan'] && \lsx_health_plan\functions\plan\has_sections($args['plan'])) {
481
+		$groups = \lsx_health_plan\functions\plan\get_sections(true);
482 482
 
483
-		if ( ! empty( $groups ) ) {
483
+		if ( ! empty($groups)) {
484 484
 			$counter    = 1;
485 485
 			$group_open = false;
486 486
 
487
-			foreach ( $groups as $group_key => $sections ) {
487
+			foreach ($groups as $group_key => $sections) {
488 488
 				$collapse_class = '';
489
-				$group_title    = \lsx_health_plan\functions\plan\get_group_title( $sections );
489
+				$group_title    = \lsx_health_plan\functions\plan\get_group_title($sections);
490 490
 
491 491
 				// Determine if the current week is complete.
492
-				$day_ids = wp_list_pluck( $sections, 'title' );
493
-				if ( false === $group_open ) {
494
-					if ( 1 === $counter && ! \lsx_health_plan\functions\is_week_complete( false, $day_ids, $group_title ) ) {
492
+				$day_ids = wp_list_pluck($sections, 'title');
493
+				if (false === $group_open) {
494
+					if (1 === $counter && ! \lsx_health_plan\functions\is_week_complete(false, $day_ids, $group_title)) {
495 495
 						$collapse_class = 'in';
496 496
 						$group_open   = true;
497
-					} elseif ( ! \lsx_health_plan\functions\is_week_complete( false, $day_ids, $group_title ) ) {
497
+					} elseif ( ! \lsx_health_plan\functions\is_week_complete(false, $day_ids, $group_title)) {
498 498
 						$collapse_class = 'in';
499 499
 						$group_open   = true;
500 500
 					}
@@ -502,47 +502,47 @@  discard block
 block discarded – undo
502 502
 
503 503
 				// Determine if there are any weekly downloads.
504 504
 				$week_downloads_view = '';
505
-				if ( isset( $args['show_downloads'] ) && false !== $args['show_downloads'] ) {
506
-					$weekly_downloads = \lsx_health_plan\functions\get_weekly_downloads( $group_key );
507
-					if ( ! empty( $weekly_downloads ) ) {
505
+				if (isset($args['show_downloads']) && false !== $args['show_downloads']) {
506
+					$weekly_downloads = \lsx_health_plan\functions\get_weekly_downloads($group_key);
507
+					if ( ! empty($weekly_downloads)) {
508 508
 						$week_downloads_view = 'week-downloads-view-on';
509 509
 					}
510 510
 				}
511 511
 				?>
512 512
 				<div class="daily-plan-block week-grid">
513
-					<a href="#group-<?php echo esc_attr( $group_key ); ?>" data-toggle="collapse" class="week-title"><?php echo esc_attr( $group_title ); ?></a>
514
-					<div id="group-<?php echo esc_attr( $group_key ); ?>" class="week-row collapse <?php echo esc_attr( $collapse_class ); ?>">
515
-						<div class="week-row-inner <?php echo esc_html( $week_downloads_view ); ?>">
513
+					<a href="#group-<?php echo esc_attr($group_key); ?>" data-toggle="collapse" class="week-title"><?php echo esc_attr($group_title); ?></a>
514
+					<div id="group-<?php echo esc_attr($group_key); ?>" class="week-row collapse <?php echo esc_attr($collapse_class); ?>">
515
+						<div class="week-row-inner <?php echo esc_html($week_downloads_view); ?>">
516 516
 							<div class="week-meals-recipes-box">
517 517
 
518
-								<?php if ( ! empty( $week_downloads_view ) ) { ?>
519
-									<h3 class="title"><?php lsx_get_svg_icon( 'daily-plan.svg' ); ?><?php echo esc_html_e( 'Plan', 'lsx-health-plan' ); ?></h3>
518
+								<?php if ( ! empty($week_downloads_view)) { ?>
519
+									<h3 class="title"><?php lsx_get_svg_icon('daily-plan.svg'); ?><?php echo esc_html_e('Plan', 'lsx-health-plan'); ?></h3>
520 520
 								<?php } ?>
521 521
 
522 522
 								<div class="week-meals-recipes-box-inner">
523 523
 								<?php
524 524
 
525
-								foreach ( $sections as $section_key => $section_values ) {
525
+								foreach ($sections as $section_key => $section_values) {
526 526
 
527
-									$defaults    = array(
528
-										'title' => __( 'Day', 'lsx-health-plan' ) . ' ' . ( $section_key + 1 ),
527
+									$defaults = array(
528
+										'title' => __('Day', 'lsx-health-plan') . ' ' . ($section_key + 1),
529 529
 									);
530
-									$section_args = wp_parse_args( $section_values, $defaults );
530
+									$section_args = wp_parse_args($section_values, $defaults);
531 531
 
532 532
 									$completed_class = '';
533
-									if ( lsx_health_plan_is_day_complete( $args['plan'], $section_args['title'] ) ) {
533
+									if (lsx_health_plan_is_day_complete($args['plan'], $section_args['title'])) {
534 534
 										$completed_class = 'completed';
535 535
 									}
536
-									if ( $section_args['rest_day_enabled'] && ! $section_args['connected_meals'] ) {
536
+									if ($section_args['rest_day_enabled'] && ! $section_args['connected_meals']) {
537 537
 										?>
538
-										<span class="day id-<?php echo esc_attr( $section_key + 1 ); ?> <?php echo esc_attr( $completed_class ); ?>">
539
-											<div class="plan-content"><?php echo esc_attr( $section_args['title'] ); ?></div>
538
+										<span class="day id-<?php echo esc_attr($section_key + 1); ?> <?php echo esc_attr($completed_class); ?>">
539
+											<div class="plan-content"><?php echo esc_attr($section_args['title']); ?></div>
540 540
 										</span>
541 541
 										<?php
542 542
 									} else {
543 543
 										?>
544
-										<a href="<?php echo esc_attr( \lsx_health_plan\functions\plan\get_permalink( $args['plan'], $section_args['title'] ) ); ?>" class="day id-<?php echo esc_attr( $section_key + 1 ); ?> <?php echo esc_attr( $completed_class ); ?>">
545
-											<div class="plan-content"><?php echo esc_attr( $section_args['title'] ); ?></div>
544
+										<a href="<?php echo esc_attr(\lsx_health_plan\functions\plan\get_permalink($args['plan'], $section_args['title'])); ?>" class="day id-<?php echo esc_attr($section_key + 1); ?> <?php echo esc_attr($completed_class); ?>">
545
+											<div class="plan-content"><?php echo esc_attr($section_args['title']); ?></div>
546 546
 										</a>
547 547
 										<?php
548 548
 									}
@@ -551,8 +551,8 @@  discard block
 block discarded – undo
551 551
 								</div>
552 552
 							</div>
553 553
 							<?php
554
-							if ( ! empty( $week_downloads_view ) ) {
555
-								lsx_health_plan_weekly_downloads( $weekly_downloads );
554
+							if ( ! empty($week_downloads_view)) {
555
+								lsx_health_plan_weekly_downloads($weekly_downloads);
556 556
 							}
557 557
 							?>
558 558
 						</div>
@@ -570,16 +570,16 @@  discard block
 block discarded – undo
570 570
  * @param array $weekly_downloads An array of the download ids.
571 571
  * @return void
572 572
  */
573
-function lsx_health_plan_weekly_downloads( $weekly_downloads = array() ) {
574
-	if ( ! empty( $weekly_downloads ) ) {
573
+function lsx_health_plan_weekly_downloads($weekly_downloads = array()) {
574
+	if ( ! empty($weekly_downloads)) {
575 575
 		?>
576 576
 		<div class="week-download-box">
577
-			<h3 class="title"><?php lsx_get_svg_icon( 'download.svg' ); ?><?php echo esc_html_e( 'Downloads', 'lsx-health-plan' ); ?></h3>
577
+			<h3 class="title"><?php lsx_get_svg_icon('download.svg'); ?><?php echo esc_html_e('Downloads', 'lsx-health-plan'); ?></h3>
578 578
 			<ul class="week-download-box-list">
579 579
 				<?php
580
-				foreach ( $weekly_downloads as $weekly_download ) {
580
+				foreach ($weekly_downloads as $weekly_download) {
581 581
 					?>
582
-					<li><?php echo wp_kses_post( do_shortcode( '[download id="' . $weekly_download . '"]' ) ); ?></li>
582
+					<li><?php echo wp_kses_post(do_shortcode('[download id="' . $weekly_download . '"]')); ?></li>
583 583
 					<?php
584 584
 				}
585 585
 				?>
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
  *
595 595
  * @return void
596 596
  */
597
-function lsx_health_plan_items( $args = array() ) {
597
+function lsx_health_plan_items($args = array()) {
598 598
 	global $shortcode_args;
599 599
 	$shortcode_args = $args;
600 600
 	include LSX_HEALTH_PLAN_PATH . '/templates/partials/shortcode-loop.php';
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
  * @return void
607 607
  */
608 608
 function lsx_health_plan_featured_video_block() {
609
-	if ( ! post_type_exists( 'video' ) ) {
609
+	if ( ! post_type_exists('video')) {
610 610
 		return;
611 611
 	}
612 612
 	include LSX_HEALTH_PLAN_PATH . '/templates/featured-videos.php';
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
  * @return void
619 619
  */
620 620
 function lsx_health_plan_featured_recipes_block() {
621
-	if ( ! post_type_exists( 'recipe' ) ) {
621
+	if ( ! post_type_exists('recipe')) {
622 622
 		return;
623 623
 	}
624 624
 	include LSX_HEALTH_PLAN_PATH . '/templates/featured-recipes.php';
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
  * @return void
641 641
  */
642 642
 function lsx_health_plan_day_button() {
643
-	if ( lsx_health_plan_is_day_complete() ) {
643
+	if (lsx_health_plan_is_day_complete()) {
644 644
 		lsx_health_plan_unlock_button();
645 645
 	} else {
646 646
 		lsx_health_plan_complete_button();
@@ -656,9 +656,9 @@  discard block
 block discarded – undo
656 656
 	?>
657 657
 	<div class="single-plan-inner-buttons">
658 658
 		<form action="<?php the_permalink(); ?>" method="post" class="form-complete-day complete-plan-btn">
659
-			<?php wp_nonce_field( 'complete', 'lsx-health-plan-actions' ); ?>
660
-			<input type="hidden" name="lsx-health-plan-id" value="<?php echo esc_attr( \lsx_health_plan\functions\plan\generate_section_id() ); ?>" />
661
-			<button class="btn cta-btn" type="submit"><?php esc_html_e( 'Complete Day', 'lsx-health-plan' ); ?></button>
659
+			<?php wp_nonce_field('complete', 'lsx-health-plan-actions'); ?>
660
+			<input type="hidden" name="lsx-health-plan-id" value="<?php echo esc_attr(\lsx_health_plan\functions\plan\generate_section_id()); ?>" />
661
+			<button class="btn cta-btn" type="submit"><?php esc_html_e('Complete Day', 'lsx-health-plan'); ?></button>
662 662
 		</form>
663 663
 		<?php lsx_health_plan_back_to_plan_button(); ?>
664 664
 	</div>
@@ -674,9 +674,9 @@  discard block
 block discarded – undo
674 674
 	?>
675 675
 	<div class="single-plan-inner-buttons">
676 676
 		<form action="<?php the_permalink(); ?>" method="post" class="form-complete-day complete-plan-btn">
677
-			<?php wp_nonce_field( 'unlock', 'lsx-health-plan-actions' ); ?>
678
-			<input type="hidden" name="lsx-health-plan-id" value="<?php echo esc_attr( \lsx_health_plan\functions\plan\generate_section_id() ); ?>" />
679
-			<button class="btn secondary-btn" type="submit"><?php esc_html_e( 'Im not done!', 'lsx-health-plan' ); ?></button>
677
+			<?php wp_nonce_field('unlock', 'lsx-health-plan-actions'); ?>
678
+			<input type="hidden" name="lsx-health-plan-id" value="<?php echo esc_attr(\lsx_health_plan\functions\plan\generate_section_id()); ?>" />
679
+			<button class="btn secondary-btn" type="submit"><?php esc_html_e('Im not done!', 'lsx-health-plan'); ?></button>
680 680
 		</form>
681 681
 		<?php lsx_health_plan_back_to_plan_button(); ?>
682 682
 	</div>
@@ -690,8 +690,8 @@  discard block
 block discarded – undo
690 690
  * @return void
691 691
  */
692 692
 function lsx_health_plan_single_nav() {
693
-	$tab_template_path = apply_filters( 'lsx_health_plan_single_nav_path', LSX_HEALTH_PLAN_PATH . '/templates/single-plan-tabs.php' );
694
-	if ( '' !== $tab_template_path ) {
693
+	$tab_template_path = apply_filters('lsx_health_plan_single_nav_path', LSX_HEALTH_PLAN_PATH . '/templates/single-plan-tabs.php');
694
+	if ('' !== $tab_template_path) {
695 695
 		require $tab_template_path;
696 696
 	}
697 697
 }
@@ -703,8 +703,8 @@  discard block
 block discarded – undo
703 703
  * @return void
704 704
  */
705 705
 function lsx_health_plan_single_tabs() {
706
-	$endpoint = get_query_var( 'endpoint' );
707
-	switch ( $endpoint ) {
706
+	$endpoint = get_query_var('endpoint');
707
+	switch ($endpoint) {
708 708
 		case 'meal':
709 709
 			$tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-meal.php';
710 710
 			break;
@@ -725,8 +725,8 @@  discard block
 block discarded – undo
725 725
 			$tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-plan.php';
726 726
 			break;
727 727
 	}
728
-	$tab_template_path = apply_filters( 'lsx_health_plan_single_tab_path', $tab_template_path );
729
-	if ( '' !== $tab_template_path ) {
728
+	$tab_template_path = apply_filters('lsx_health_plan_single_tab_path', $tab_template_path);
729
+	if ('' !== $tab_template_path) {
730 730
 		include $tab_template_path;
731 731
 	}
732 732
 }
@@ -746,9 +746,9 @@  discard block
 block discarded – undo
746 746
  * @return recipe_type
747 747
  */
748 748
 function lsx_health_plan_recipe_type() {
749
-	$term_obj_list = get_the_terms( get_the_ID(), 'recipe-type' );
749
+	$term_obj_list = get_the_terms(get_the_ID(), 'recipe-type');
750 750
 	$recipe_type   = $term_obj_list[0]->name;
751
-	if ( ! empty( $recipe_type ) ) {
751
+	if ( ! empty($recipe_type)) {
752 752
 		return $recipe_type;
753 753
 	}
754 754
 }
@@ -760,32 +760,32 @@  discard block
 block discarded – undo
760 760
  * @param array $group
761 761
  * @return void
762 762
  */
763
-function lsx_health_plan_workout_video_play_button( $m, $group, $echo = true ) {
763
+function lsx_health_plan_workout_video_play_button($m, $group, $echo = true) {
764 764
 	$workout_video = '';
765 765
 	$giphy         = '';
766 766
 	$youtube       = '';
767
-	if ( isset( $group['connected_videos'] ) && '' !== $group['connected_videos'] ) {
768
-		$workout_video = esc_html( $group['connected_videos'] );
769
-		$giphy         = get_post_meta( $workout_video, 'video_giphy_source', true );
770
-		$youtube       = esc_url( get_post_meta( $workout_video, 'video_youtube_source', 1 ) );
771
-		$content       = get_post_field( 'post_content', $workout_video );
767
+	if (isset($group['connected_videos']) && '' !== $group['connected_videos']) {
768
+		$workout_video = esc_html($group['connected_videos']);
769
+		$giphy         = get_post_meta($workout_video, 'video_giphy_source', true);
770
+		$youtube       = esc_url(get_post_meta($workout_video, 'video_youtube_source', 1));
771
+		$content       = get_post_field('post_content', $workout_video);
772 772
 		$play_button   = '<button data-toggle="modal" data-target="#workout-video-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>';
773 773
 
774 774
 		$modal_body = '';
775
-		if ( ! empty( $giphy ) ) {
776
-			$giphy      = \lsx_health_plan\functions\get_video_url( $giphy );
775
+		if ( ! empty($giphy)) {
776
+			$giphy      = \lsx_health_plan\functions\get_video_url($giphy);
777 777
 			$modal_body = $giphy; // WPCS: XSS OK.
778
-		} elseif ( ! empty( $youtube ) ) {
779
-			$modal_body = wp_oembed_get( $youtube, array( // WPCS: XSS OK.
778
+		} elseif ( ! empty($youtube)) {
779
+			$modal_body = wp_oembed_get($youtube, array( // WPCS: XSS OK.
780 780
 				'width' => 480,
781
-			) );
781
+			));
782 782
 		}
783 783
 		$modal_body .= '<h5 class="modal-title title-lined">' . $group['name'] . '</h5>';
784 784
 		$modal_body .= $content;
785
-		\lsx_health_plan\functions\register_modal( 'workout-video-modal-' . $m, '', $modal_body );
785
+		\lsx_health_plan\functions\register_modal('workout-video-modal-' . $m, '', $modal_body);
786 786
 
787
-		if ( true === $echo ) {
788
-			echo wp_kses_post( $play_button );
787
+		if (true === $echo) {
788
+			echo wp_kses_post($play_button);
789 789
 		} else {
790 790
 			return $play_button;
791 791
 		}
@@ -799,17 +799,17 @@  discard block
 block discarded – undo
799 799
  */
800 800
 function lsx_health_plan_recipe_archive_description() {
801 801
 	$description = '';
802
-	if ( is_post_type_archive( 'recipe' ) ) {
803
-		$description = \lsx_health_plan\functions\get_option( 'recipe_archive_description', '' );
804
-	} elseif ( is_post_type_archive( 'exercise' ) ) {
805
-		$description = \lsx_health_plan\functions\get_option( 'exercise_archive_description', '' );
806
-	} elseif ( is_tax() ) {
802
+	if (is_post_type_archive('recipe')) {
803
+		$description = \lsx_health_plan\functions\get_option('recipe_archive_description', '');
804
+	} elseif (is_post_type_archive('exercise')) {
805
+		$description = \lsx_health_plan\functions\get_option('exercise_archive_description', '');
806
+	} elseif (is_tax()) {
807 807
 		$description = get_the_archive_description();
808 808
 	}
809
-	if ( '' !== $description ) {
809
+	if ('' !== $description) {
810 810
 		?>
811 811
 		<div class="lsx-hp-archive-description row">
812
-			<div class="col-xs-12 description-wrapper"><?php echo wp_kses_post( wpautop( $description ) ); ?></div>
812
+			<div class="col-xs-12 description-wrapper"><?php echo wp_kses_post(wpautop($description)); ?></div>
813 813
 		</div>
814 814
 		<?php
815 815
 	}
@@ -822,19 +822,19 @@  discard block
 block discarded – undo
822 822
  */
823 823
 function lsx_health_plan_workout_main_content() {
824 824
 	// Getting translated endpoint.
825
-	$workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' );
825
+	$workout = \lsx_health_plan\functions\get_option('endpoint_workout', 'workout');
826 826
 
827
-	$connected_members = get_post_meta( get_the_ID(), ( $workout . '_connected_team_member' ), true );
828
-	$small_description = get_post_meta( get_the_ID(), ( $workout . '_short_description' ), true );
827
+	$connected_members = get_post_meta(get_the_ID(), ($workout . '_connected_team_member'), true);
828
+	$small_description = get_post_meta(get_the_ID(), ($workout . '_short_description'), true);
829 829
 
830 830
 	$content = '';
831
-	if ( $small_description || $connected_members || lsx_health_plan_has_tips() ) {
831
+	if ($small_description || $connected_members || lsx_health_plan_has_tips()) {
832 832
 		$content .= '<div class="short-desc set-box set content-box entry-content">';
833 833
 		$content .= '<div class="the-content">';
834
-		$content .= lsx_hp_member_connected( $connected_members, $workout );
834
+		$content .= lsx_hp_member_connected($connected_members, $workout);
835 835
 		$content .= '<span>' . $small_description . '</span>';
836 836
 		$content .= '</div>';
837
-		$content .= do_shortcode( '[lsx_health_plan_featured_tips_block]' );
837
+		$content .= do_shortcode('[lsx_health_plan_featured_tips_block]');
838 838
 		$content .= '</div>';
839 839
 	}
840 840
 	return $content;
@@ -847,19 +847,19 @@  discard block
 block discarded – undo
847 847
  */
848 848
 function lsx_health_plan_meal_main_content() {
849 849
 	// Getting translated endpoint.
850
-	$meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' );
850
+	$meal = \lsx_health_plan\functions\get_option('endpoint_meal', 'meal');
851 851
 
852
-	$connected_members = get_post_meta( get_the_ID(), ( $meal . '_connected_team_member' ), true );
853
-	$small_description = get_post_meta( get_the_ID(), ( $meal . '_short_description' ), true );
852
+	$connected_members = get_post_meta(get_the_ID(), ($meal . '_connected_team_member'), true);
853
+	$small_description = get_post_meta(get_the_ID(), ($meal . '_short_description'), true);
854 854
 
855 855
 	$content_meal = '';
856
-	if ( $small_description || $connected_members || lsx_health_plan_has_tips() ) {
856
+	if ($small_description || $connected_members || lsx_health_plan_has_tips()) {
857 857
 		$content_meal .= '<div class="set-box set content-box entry-content">';
858 858
 		$content_meal .= '<div class="the-content">';
859
-		$content_meal .= lsx_hp_member_connected( $connected_members, $meal );
859
+		$content_meal .= lsx_hp_member_connected($connected_members, $meal);
860 860
 		$content_meal .= '<span>' . $small_description . '</span>';
861 861
 		$content_meal .= '</div>';
862
-		$content_meal .= do_shortcode( '[lsx_health_plan_featured_tips_block]' );
862
+		$content_meal .= do_shortcode('[lsx_health_plan_featured_tips_block]');
863 863
 		$content_meal .= '</div>';
864 864
 	}
865 865
 	return $content_meal;
@@ -872,21 +872,21 @@  discard block
 block discarded – undo
872 872
  * @param  string $index
873 873
  * @return void
874 874
  */
875
-function lsx_health_plan_workout_tab_content( $index = 1 ) {
876
-	global $group_name,$shortcode_args;
875
+function lsx_health_plan_workout_tab_content($index = 1) {
876
+	global $group_name, $shortcode_args;
877 877
 	$group_name = 'workout_section_' . $index;
878
-	if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) {
879
-		$layout = strtolower( \lsx_health_plan\functions\get_option( 'workout_tab_layout', 'table' ) );
878
+	if (false !== \lsx_health_plan\functions\get_option('exercise_enabled', false)) {
879
+		$layout = strtolower(\lsx_health_plan\functions\get_option('workout_tab_layout', 'table'));
880 880
 
881 881
 		// Check for shortcode overrides.
882
-		if ( null !== $shortcode_args && isset( $shortcode_args['layout'] ) ) {
882
+		if (null !== $shortcode_args && isset($shortcode_args['layout'])) {
883 883
 			$layout = $shortcode_args['layout'];
884 884
 		}
885 885
 	} else {
886 886
 		$layout = 'table';
887 887
 	}
888 888
 
889
-	switch ( $layout ) {
889
+	switch ($layout) {
890 890
 		case 'list':
891 891
 			$tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-list.php';
892 892
 			break;
@@ -899,8 +899,8 @@  discard block
 block discarded – undo
899 899
 			$tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-table.php';
900 900
 			break;
901 901
 	}
902
-	$tab_template_path = apply_filters( 'lsx_health_plan_workout_tab_content_path', $tab_template_path );
903
-	if ( '' !== $tab_template_path ) {
902
+	$tab_template_path = apply_filters('lsx_health_plan_workout_tab_content_path', $tab_template_path);
903
+	if ('' !== $tab_template_path) {
904 904
 		include $tab_template_path;
905 905
 	}
906 906
 }
@@ -911,26 +911,26 @@  discard block
 block discarded – undo
911 911
  * @return void
912 912
  */
913 913
 function lsx_health_plan_workout_sets() {
914
-	if ( is_singular( 'workout' ) ) {
914
+	if (is_singular('workout')) {
915 915
 		global $connected_workouts;
916
-		$connected_workouts = array( get_the_ID() );
916
+		$connected_workouts = array(get_the_ID());
917 917
 	}
918
-	if ( is_singular( 'plan' ) ) {
918
+	if (is_singular('plan')) {
919 919
 
920 920
 		global $connected_workouts;
921 921
 
922
-		$section_key  = get_query_var( 'section' );
923
-		if ( '' !== $section && \lsx_health_plan\functions\plan\has_sections() ) {
924
-			$section_info = \lsx_health_plan\functions\plan\get_section_info( $section_key );
925
-			if ( isset( $section_info['connected_workouts'] ) && '' !== $section_info['connected_workouts'] ) {
922
+		$section_key = get_query_var('section');
923
+		if ('' !== $section && \lsx_health_plan\functions\plan\has_sections()) {
924
+			$section_info = \lsx_health_plan\functions\plan\get_section_info($section_key);
925
+			if (isset($section_info['connected_workouts']) && '' !== $section_info['connected_workouts']) {
926 926
 
927
-				$connected_workouts = \lsx_health_plan\functions\prep_array( $section_info['connected_workouts'] );
927
+				$connected_workouts = \lsx_health_plan\functions\prep_array($section_info['connected_workouts']);
928 928
 			}
929 929
 		}
930 930
 	}
931 931
 	$template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-sets.php';
932
-	$template_path = apply_filters( 'lsx_health_plan_workout_set_template_path', $template_path );
933
-	if ( '' !== $template_path && ! empty( $template_path ) ) {
932
+	$template_path = apply_filters('lsx_health_plan_workout_set_template_path', $template_path);
933
+	if ('' !== $template_path && ! empty($template_path)) {
934 934
 		include $template_path;
935 935
 	}
936 936
 }
@@ -941,11 +941,11 @@  discard block
 block discarded – undo
941 941
  * @param [type] $connected_workouts
942 942
  * @return void
943 943
  */
944
-function lsx_health_plan_warmup_sets( $connected_workouts ) {
944
+function lsx_health_plan_warmup_sets($connected_workouts) {
945 945
 	
946 946
 	$template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-sets.php';
947
-	$template_path = apply_filters( 'lsx_health_plan_workout_set_template_path', $template_path );
948
-	if ( '' !== $template_path && ! empty( $template_path ) ) {
947
+	$template_path = apply_filters('lsx_health_plan_workout_set_template_path', $template_path);
948
+	if ('' !== $template_path && ! empty($template_path)) {
949 949
 		include $template_path;
950 950
 	}
951 951
 }
@@ -956,46 +956,46 @@  discard block
 block discarded – undo
956 956
  * @param array $args
957 957
  * @return void
958 958
  */
959
-function lsx_hp_meal_plan_recipes( $args = array() ) {
959
+function lsx_hp_meal_plan_recipes($args = array()) {
960 960
 	$defaults = array(
961 961
 		'meal_id'   => false,
962 962
 		'meal_time' => '',
963 963
 		'modal'     => true,
964 964
 	);
965
-	$args     = wp_parse_args( $args, $defaults );
965
+	$args = wp_parse_args($args, $defaults);
966 966
 	// Looking for recipes.
967
-	$connected_recipes = get_post_meta( $args['meal_id'], $args['meal_time'] . '_recipes', true );
968
-	if ( ! empty( $connected_recipes ) ) {
969
-		$query_args    = array(
967
+	$connected_recipes = get_post_meta($args['meal_id'], $args['meal_time'] . '_recipes', true);
968
+	if ( ! empty($connected_recipes)) {
969
+		$query_args = array(
970 970
 			'orderby'   => 'date',
971 971
 			'order'     => 'DESC',
972 972
 			'post_type' => 'recipe',
973 973
 			'post__in'  => $connected_recipes,
974 974
 		);
975
-		$recipes = new WP_Query( $query_args );
975
+		$recipes = new WP_Query($query_args);
976 976
 		?>
977 977
 		<div class="recipes">
978 978
 			<div class="row eating-row">
979 979
 			<?php
980
-			if ( $recipes->have_posts() ) {
981
-				while ( $recipes->have_posts() ) {
980
+			if ($recipes->have_posts()) {
981
+				while ($recipes->have_posts()) {
982 982
 					$recipes->the_post();
983
-					if ( false !== $args['modal'] ) {
983
+					if (false !== $args['modal']) {
984 984
 						\lsx_health_plan\functions\recipes\register_recipe_modal();
985 985
 					}
986 986
 					?>
987 987
 					<div class="recipe-column">
988
-						<a data-toggle="modal" data-target="#recipe-modal-<?php echo esc_attr( get_the_ID() ); ?>" href="#recipe-modal-<?php echo esc_attr( get_the_ID() ); ?>" class="recipe-box box-shadow">
988
+						<a data-toggle="modal" data-target="#recipe-modal-<?php echo esc_attr(get_the_ID()); ?>" href="#recipe-modal-<?php echo esc_attr(get_the_ID()); ?>" class="recipe-box box-shadow">
989 989
 							<div class="recipe-feature-img">
990 990
 								<?php
991 991
 								$featured_image = get_the_post_thumbnail();
992
-								if ( ! empty( $featured_image ) && '' !== $featured_image ) {
993
-									the_post_thumbnail( 'lsx-thumbnail-square', array(
992
+								if ( ! empty($featured_image) && '' !== $featured_image) {
993
+									the_post_thumbnail('lsx-thumbnail-square', array(
994 994
 										'class' => 'aligncenter',
995
-									) );
995
+									));
996 996
 								} else {
997 997
 									?>
998
-									<img loading="lazy" class="placeholder" src="<?php echo esc_attr( plugin_dir_url( __DIR__ ) . 'assets/images/placeholder.jpg' ); ?>">
998
+									<img loading="lazy" class="placeholder" src="<?php echo esc_attr(plugin_dir_url(__DIR__) . 'assets/images/placeholder.jpg'); ?>">
999 999
 									<?php
1000 1000
 								}
1001 1001
 								?>
@@ -1021,25 +1021,25 @@  discard block
 block discarded – undo
1021 1021
 /**
1022 1022
  * Output the connected.
1023 1023
  */
1024
-function lsx_hp_recipe_plan_meta( $args = array() ) {
1024
+function lsx_hp_recipe_plan_meta($args = array()) {
1025 1025
 	$defaults = array();
1026 1026
 	$top_level_plans = array();
1027 1027
 	// Get meals this exercise is connected to.
1028
-	$plans = get_post_meta( get_the_ID(), 'connected_plans', true );
1029
-	if ( ! empty( $plans ) ) {
1030
-		$plan       = end( $plans );
1031
-		$has_parent = wp_get_post_parent_id( $plan );
1032
-		if ( 0 === $has_parent ) {
1028
+	$plans = get_post_meta(get_the_ID(), 'connected_plans', true);
1029
+	if ( ! empty($plans)) {
1030
+		$plan       = end($plans);
1031
+		$has_parent = wp_get_post_parent_id($plan);
1032
+		if (0 === $has_parent) {
1033 1033
 			$top_level_plans[] = $plan;
1034
-		} elseif ( false !== $top_level_plans ) {
1034
+		} elseif (false !== $top_level_plans) {
1035 1035
 			$top_level_plans[] = $has_parent;
1036 1036
 		}
1037 1037
 	}
1038
-	if ( ! empty( $top_level_plans ) && ( '' !== $top_level_plans ) ) {
1039
-		$top_level_plans = array_unique( $top_level_plans );
1040
-		$top_level_plan  = end( $top_level_plans );
1038
+	if ( ! empty($top_level_plans) && ('' !== $top_level_plans)) {
1039
+		$top_level_plans = array_unique($top_level_plans);
1040
+		$top_level_plan  = end($top_level_plans);
1041 1041
 		?>
1042
-			<span class="recipe-type recipe-parent"><?php echo esc_html( get_the_title( $top_level_plan ) ); ?></span>
1042
+			<span class="recipe-type recipe-parent"><?php echo esc_html(get_the_title($top_level_plan)); ?></span>
1043 1043
 		<?php
1044 1044
 	}
1045 1045
 }
@@ -1052,23 +1052,23 @@  discard block
 block discarded – undo
1052 1052
 	$top_level_plans = array();
1053 1053
 
1054 1054
 	// Get workouts this exercise is connected to.
1055
-	$workouts = get_post_meta( get_the_ID(), 'connected_workouts', true );
1055
+	$workouts = get_post_meta(get_the_ID(), 'connected_workouts', true);
1056 1056
 
1057
-	if ( '' !== $workouts && ! is_array( $workouts ) ) {
1058
-		$workouts = array( $workouts );
1057
+	if ('' !== $workouts && ! is_array($workouts)) {
1058
+		$workouts = array($workouts);
1059 1059
 	}
1060
-	if ( ! empty( $workouts ) ) {
1061
-		foreach ( $workouts as $workout ) {
1060
+	if ( ! empty($workouts)) {
1061
+		foreach ($workouts as $workout) {
1062 1062
 			// Get the plans this workout is connected to.
1063
-			$plans = get_post_meta( $workout, 'connected_plans', true );
1063
+			$plans = get_post_meta($workout, 'connected_plans', true);
1064 1064
 
1065
-			if ( '' !== $plans && ! is_array( $plans ) ) {
1066
-				$plans = array( $plans );
1065
+			if ('' !== $plans && ! is_array($plans)) {
1066
+				$plans = array($plans);
1067 1067
 			}
1068
-			if ( ! empty( $plans ) ) {
1069
-				foreach ( $plans as $plan ) {
1070
-					$has_parent = wp_get_post_parent_id( $plan );
1071
-					if ( 0 === $has_parent ) {
1068
+			if ( ! empty($plans)) {
1069
+				foreach ($plans as $plan) {
1070
+					$has_parent = wp_get_post_parent_id($plan);
1071
+					if (0 === $has_parent) {
1072 1072
 						$top_level_plans = $plan;
1073 1073
 					} else {
1074 1074
 						$top_level_plans = $has_parent;
@@ -1078,11 +1078,11 @@  discard block
 block discarded – undo
1078 1078
 		}
1079 1079
 	}
1080 1080
 
1081
-	if ( ! empty( $top_level_plans ) && ( '' !== $top_level_plans ) ) {
1082
-		$top_level_plans = array_unique( $top_level_plans );
1083
-		$top_level_plan  = end( $top_level_plans );
1081
+	if ( ! empty($top_level_plans) && ('' !== $top_level_plans)) {
1082
+		$top_level_plans = array_unique($top_level_plans);
1083
+		$top_level_plan  = end($top_level_plans);
1084 1084
 		?>
1085
-			<span class="recipe-type recipe-parent"><?php echo esc_html( get_the_title( $top_level_plan ) ); ?></span>
1085
+			<span class="recipe-type recipe-parent"><?php echo esc_html(get_the_title($top_level_plan)); ?></span>
1086 1086
 		<?php
1087 1087
 	}
1088 1088
 }
@@ -1093,12 +1093,12 @@  discard block
 block discarded – undo
1093 1093
  * @param [type] $related_content
1094 1094
  * @return void
1095 1095
  */
1096
-function lsx_hp_single_related( $related_content, $post_type_text ) {
1096
+function lsx_hp_single_related($related_content, $post_type_text) {
1097 1097
 	?>
1098 1098
 	<section id="lsx-hp-related">
1099 1099
 		<div class="row lsx-related-posts lsx-related-posts-title">
1100 1100
 			<div class="col-xs-12">
1101
-				<h2 class="lsx-related-posts-headline"><?php echo esc_html( $post_type_text ); ?></h2>
1101
+				<h2 class="lsx-related-posts-headline"><?php echo esc_html($post_type_text); ?></h2>
1102 1102
 			</div>
1103 1103
 		</div>
1104 1104
 		<div class="row lsx-related-posts lsx-related-posts-content">
@@ -1106,26 +1106,26 @@  discard block
 block discarded – undo
1106 1106
 				<div class="lsx-related-posts-wrapper">
1107 1107
 					<?php
1108 1108
 					$i = 0;
1109
-					foreach ( $related_content as $article ) {
1110
-						$post_title      = get_the_title( $article );
1111
-						$post_categories = wp_get_post_categories( $article );
1112
-						$post_link       = get_permalink( $article );
1109
+					foreach ($related_content as $article) {
1110
+						$post_title      = get_the_title($article);
1111
+						$post_categories = wp_get_post_categories($article);
1112
+						$post_link       = get_permalink($article);
1113 1113
 
1114 1114
 						$cats = array();
1115 1115
 						?>
1116
-						<article id="post-<?php echo esc_html( $article ); ?>" class="lsx-slot post">
1116
+						<article id="post-<?php echo esc_html($article); ?>" class="lsx-slot post">
1117 1117
 							<div class="entry-layout lsx-hp-shadow">
1118 1118
 								<div class="entry-layout-content">
1119 1119
 									<header class="entry-header">
1120 1120
 										<div class="entry-image">
1121
-											<a href="<?php echo esc_url( $post_link ); ?>" class="thumbnail">
1121
+											<a href="<?php echo esc_url($post_link); ?>" class="thumbnail">
1122 1122
 											<?php
1123
-											$featured_image = get_the_post_thumbnail( $article, 'lsx-thumbnail-wide' );
1124
-											if ( ! empty( $featured_image ) && '' !== $featured_image ) {
1125
-												echo wp_kses_post( $featured_image );
1123
+											$featured_image = get_the_post_thumbnail($article, 'lsx-thumbnail-wide');
1124
+											if ( ! empty($featured_image) && '' !== $featured_image) {
1125
+												echo wp_kses_post($featured_image);
1126 1126
 											} else {
1127 1127
 												?>
1128
-												<img loading="lazy" class="placeholder" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>">
1128
+												<img loading="lazy" class="placeholder" src="<?php echo esc_attr(plugin_dir_url(__FILE__) . '../assets/images/placeholder.jpg'); ?>">
1129 1129
 												<?php
1130 1130
 											}
1131 1131
 											?>
@@ -1133,18 +1133,18 @@  discard block
 block discarded – undo
1133 1133
 										</div>
1134 1134
 										<div class="entry-meta">
1135 1135
 										<?php
1136
-										foreach ( $post_categories as $c ) {
1137
-											$cat = get_category( $c );
1136
+										foreach ($post_categories as $c) {
1137
+											$cat = get_category($c);
1138 1138
 											/* Translators: %s: category name */
1139
-											$cats[] = '<a href="' . esc_url( get_category_link( $cat->term_id ) ) . '" title="' . sprintf( esc_html__( 'Posts in %s', 'lsx-blog-customizer' ), $cat->name ) . '">' . $cat->name . '</a>';
1139
+											$cats[] = '<a href="' . esc_url(get_category_link($cat->term_id)) . '" title="' . sprintf(esc_html__('Posts in %s', 'lsx-blog-customizer'), $cat->name) . '">' . $cat->name . '</a>';
1140 1140
 										}
1141
-										if ( ! empty( $cats ) ) { ?>
1142
-											<div class="post-categories"><span></span><?php echo wp_kses_post( implode( ', ', $cats ) ); ?></div>
1141
+										if ( ! empty($cats)) { ?>
1142
+											<div class="post-categories"><span></span><?php echo wp_kses_post(implode(', ', $cats)); ?></div>
1143 1143
 										<?php } ?>
1144 1144
 										</div>
1145 1145
 										<h2 class="entry-title">
1146
-											<a href="<?php echo esc_url( $post_link ); ?>">
1147
-												<?php echo esc_html( $post_title ); ?>
1146
+											<a href="<?php echo esc_url($post_link); ?>">
1147
+												<?php echo esc_html($post_title); ?>
1148 1148
 											</a>
1149 1149
 										</h2>
1150 1150
 									</header>
@@ -1168,27 +1168,27 @@  discard block
 block discarded – undo
1168 1168
  * @param [type] $connected_members
1169 1169
  * @return void
1170 1170
  */
1171
-function lsx_hp_member_connected( $connected_members, $post_type ) {
1172
-	if ( ! empty( $connected_members ) ) {
1171
+function lsx_hp_member_connected($connected_members, $post_type) {
1172
+	if ( ! empty($connected_members)) {
1173 1173
 		$content = '<div id="hp-connected-members" class="hp-connected-members connected-' . $post_type . '">';
1174
-		foreach ( $connected_members as $member ) {
1175
-			$post_link   = get_permalink( $member );
1176
-			$member_name = get_the_title( $member );
1174
+		foreach ($connected_members as $member) {
1175
+			$post_link   = get_permalink($member);
1176
+			$member_name = get_the_title($member);
1177 1177
 			$member_name = '<span class="lsx-team-name">' . $member_name . '</span>';
1178 1178
 
1179 1179
 			$member_link = '<a href="' . $post_link . '" >' . $member_name . '</a>';
1180 1180
 
1181 1181
 			$roles = '';
1182
-			$terms = get_the_terms( $member, 'team_role' );
1182
+			$terms = get_the_terms($member, 'team_role');
1183 1183
 
1184
-			if ( $terms && ! is_wp_error( $terms ) ) {
1184
+			if ($terms && ! is_wp_error($terms)) {
1185 1185
 				$roles = array();
1186 1186
 
1187
-				foreach ( $terms as $term ) {
1187
+				foreach ($terms as $term) {
1188 1188
 					$roles[] = $term->name;
1189 1189
 				}
1190 1190
 
1191
-				$roles = join( ', ', $roles );
1191
+				$roles = join(', ', $roles);
1192 1192
 			}
1193 1193
 			$member_roles = '' !== $roles ? "<small class='lsx-team-roles'>$roles</small>" : '';
1194 1194
 
Please login to merge, or discard this patch.
classes/integrations/class-lsx-team.php 2 patches
Indentation   +132 added lines, -132 removed lines patch added patch discarded remove patch
@@ -8,148 +8,148 @@
 block discarded – undo
8 8
  */
9 9
 class LSX_Team {
10 10
 
11
-	/**
12
-	 * Holds class instance
13
-	 *
14
-	 * @var      object \lsx_health_plan\classes\LSX_Team()
15
-	 */
16
-	protected static $instance = null;
11
+     /**
12
+      * Holds class instance
13
+      *
14
+      * @var      object \lsx_health_plan\classes\LSX_Team()
15
+      */
16
+     protected static $instance = null;
17 17
 
18
-	/**
19
-	 * Constructor.
20
-	 */
21
-	public function __construct() {
22
-		$this->default_types = array(
23
-			\lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' ),
24
-			\lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ),
25
-			\lsx_health_plan\functions\get_option( 'endpoint_recipe_single', 'recipe' ),
26
-			\lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ),
27
-			\lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' ),
28
-		);
29
-		add_action( 'wp_enqueue_scripts', array( $this, 'assets' ), 5 );
30
-		add_action( 'cmb2_admin_init', array( $this, 'related_team_metabox' ) );
31
-		add_action( 'cmb2_admin_init', array( $this, 'additional_single_team_metabox' ) );
32
-		add_action( 'lsx_entry_bottom', array( $this, 'hp_team_member_tabs' ) );
33
-		add_action( 'wp_head', array( $this, 'remove_archive_original_team_header' ), 99 );
34
-	}
18
+     /**
19
+      * Constructor.
20
+      */
21
+     public function __construct() {
22
+          $this->default_types = array(
23
+               \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' ),
24
+               \lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ),
25
+               \lsx_health_plan\functions\get_option( 'endpoint_recipe_single', 'recipe' ),
26
+               \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ),
27
+               \lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' ),
28
+          );
29
+          add_action( 'wp_enqueue_scripts', array( $this, 'assets' ), 5 );
30
+          add_action( 'cmb2_admin_init', array( $this, 'related_team_metabox' ) );
31
+          add_action( 'cmb2_admin_init', array( $this, 'additional_single_team_metabox' ) );
32
+          add_action( 'lsx_entry_bottom', array( $this, 'hp_team_member_tabs' ) );
33
+          add_action( 'wp_head', array( $this, 'remove_archive_original_team_header' ), 99 );
34
+     }
35 35
 
36
-	/**
37
-	 * Return an instance of this class.
38
-	 *
39
-	 * @since 1.0.0
40
-	 *
41
-	 * @return    object \lsx_health_plan\classes\LSX_Team()    A single instance of this class.
42
-	 */
43
-	public static function get_instance() {
44
-		// If the single instance hasn't been set, set it now.
45
-		if ( null === self::$instance ) {
46
-			self::$instance = new self();
47
-		}
48
-		return self::$instance;
49
-	}
36
+     /**
37
+      * Return an instance of this class.
38
+      *
39
+      * @since 1.0.0
40
+      *
41
+      * @return    object \lsx_health_plan\classes\LSX_Team()    A single instance of this class.
42
+      */
43
+     public static function get_instance() {
44
+          // If the single instance hasn't been set, set it now.
45
+          if ( null === self::$instance ) {
46
+               self::$instance = new self();
47
+          }
48
+          return self::$instance;
49
+     }
50 50
 
51
-	/**
52
-	 * Load lsx team related css.
53
-	 *
54
-	 * @package    lsx
55
-	 * @subpackage lsx-health-plan
56
-	 *
57
-	 */
58
-	public function assets() {
59
-		wp_enqueue_style( 'lsx-health-plan-team', LSX_HEALTH_PLAN_URL . 'assets/css/lsx-health-plan-team.css', array(), LSX_HEALTH_PLAN_VER );
60
-	}
51
+     /**
52
+      * Load lsx team related css.
53
+      *
54
+      * @package    lsx
55
+      * @subpackage lsx-health-plan
56
+      *
57
+      */
58
+     public function assets() {
59
+          wp_enqueue_style( 'lsx-health-plan-team', LSX_HEALTH_PLAN_URL . 'assets/css/lsx-health-plan-team.css', array(), LSX_HEALTH_PLAN_VER );
60
+     }
61 61
 
62
-	/**
63
-	 * Define the related team member metabox and field configurations.
64
-	 */
65
-	public function related_team_metabox() {
66
-		foreach ( $this->default_types as $type => $default_type ) {
67
-			$cmb = new_cmb2_box(
68
-				array(
69
-					'id'           => $default_type . '_related_team_member__metabox',
70
-					'title'        => __( 'Related Team Member', 'lsx-health-plan' ),
71
-					'object_types' => array( $default_type ), // Post type.
72
-					'context'      => 'normal',
73
-					'priority'     => 'low',
74
-					'show_names'   => true,
75
-				)
76
-			);
62
+     /**
63
+      * Define the related team member metabox and field configurations.
64
+      */
65
+     public function related_team_metabox() {
66
+          foreach ( $this->default_types as $type => $default_type ) {
67
+               $cmb = new_cmb2_box(
68
+                    array(
69
+                         'id'           => $default_type . '_related_team_member__metabox',
70
+                         'title'        => __( 'Related Team Member', 'lsx-health-plan' ),
71
+                         'object_types' => array( $default_type ), // Post type.
72
+                         'context'      => 'normal',
73
+                         'priority'     => 'low',
74
+                         'show_names'   => true,
75
+                    )
76
+               );
77 77
 
78
-			$cmb->add_field(
79
-				array(
80
-					'name'       => __( 'Related Team Member', 'lsx-health-plan' ),
81
-					'desc'       => __( 'Connect the related team member that applies to this ', 'lsx-health-plan' ) . $default_type,
82
-					'id'         => $default_type . '_connected_team_member',
83
-					'type'       => 'post_search_ajax',
84
-					'limit'      => 4,  // Limit selection to X items only (default 1).
85
-					'sortable'   => true, // Allow selected items to be sortable (default false).
86
-					'query_args' => array(
87
-						'post_type'      => array( 'team' ),
88
-						'post_status'    => array( 'publish' ),
89
-						'posts_per_page' => -1,
90
-					),
91
-				)
92
-			);
93
-		}
78
+               $cmb->add_field(
79
+                    array(
80
+                         'name'       => __( 'Related Team Member', 'lsx-health-plan' ),
81
+                         'desc'       => __( 'Connect the related team member that applies to this ', 'lsx-health-plan' ) . $default_type,
82
+                         'id'         => $default_type . '_connected_team_member',
83
+                         'type'       => 'post_search_ajax',
84
+                         'limit'      => 4,  // Limit selection to X items only (default 1).
85
+                         'sortable'   => true, // Allow selected items to be sortable (default false).
86
+                         'query_args' => array(
87
+                              'post_type'      => array( 'team' ),
88
+                              'post_status'    => array( 'publish' ),
89
+                              'posts_per_page' => -1,
90
+                         ),
91
+                    )
92
+               );
93
+          }
94 94
 
95
-	}
95
+     }
96 96
 
97
-	/**
98
-	 * Adding additional custom fields to the single members, related with Health Plan.
99
-	 */
100
-	public function additional_single_team_metabox() {
101
-		$cmb = new_cmb2_box(
102
-			array(
103
-				'id'           => 'lsx__team',
104
-				'title'        => '',
105
-				'object_types' => array( 'team' ), // Post type.
106
-				'context'      => 'normal',
107
-				'priority'     => 'high',
108
-				'show_names'   => true,
109
-			)
110
-		);
97
+     /**
98
+      * Adding additional custom fields to the single members, related with Health Plan.
99
+      */
100
+     public function additional_single_team_metabox() {
101
+          $cmb = new_cmb2_box(
102
+               array(
103
+                    'id'           => 'lsx__team',
104
+                    'title'        => '',
105
+                    'object_types' => array( 'team' ), // Post type.
106
+                    'context'      => 'normal',
107
+                    'priority'     => 'high',
108
+                    'show_names'   => true,
109
+               )
110
+          );
111 111
 
112
-		$cmb->add_field(
113
-			array(
114
-				'name'       => __( 'Team Member Experience', 'lsx-health-plan' ),
115
-				'desc'       => __( 'Add additional experience to this team member', 'lsx-health-plan' ),
116
-				'id'         => 'team_member_experience',
117
-				'type'       => 'wysiwyg',
118
-			)
119
-		);
112
+          $cmb->add_field(
113
+               array(
114
+                    'name'       => __( 'Team Member Experience', 'lsx-health-plan' ),
115
+                    'desc'       => __( 'Add additional experience to this team member', 'lsx-health-plan' ),
116
+                    'id'         => 'team_member_experience',
117
+                    'type'       => 'wysiwyg',
118
+               )
119
+          );
120 120
 
121
-		$cmb->add_field(
122
-			array(
123
-				'name'       => __( 'Featured Plans', 'lsx-health-plan' ),
124
-				'desc'       => __( 'Connect the related plans to this team member', 'lsx-health-plan' ),
125
-				'id'         => 'connected_team_member_plan',
126
-				'type'       => 'post_search_ajax',
127
-				'limit'      => 3,
128
-				'sortable'   => true,
129
-				'query_args' => array(
130
-					'post_type'      => array( 'plan' ),
131
-					'post_status'    => array( 'publish' ),
132
-					'posts_per_page' => -1,
133
-				),
134
-			)
135
-		);
121
+          $cmb->add_field(
122
+               array(
123
+                    'name'       => __( 'Featured Plans', 'lsx-health-plan' ),
124
+                    'desc'       => __( 'Connect the related plans to this team member', 'lsx-health-plan' ),
125
+                    'id'         => 'connected_team_member_plan',
126
+                    'type'       => 'post_search_ajax',
127
+                    'limit'      => 3,
128
+                    'sortable'   => true,
129
+                    'query_args' => array(
130
+                         'post_type'      => array( 'plan' ),
131
+                         'post_status'    => array( 'publish' ),
132
+                         'posts_per_page' => -1,
133
+                    ),
134
+               )
135
+          );
136 136
 
137
-	}
137
+     }
138 138
 
139
-	/**
140
-	 * Adds custom tabs to the team member single pages.
141
-	 *
142
-	 * @return void
143
-	 */
144
-	public function hp_team_member_tabs() {
145
-		if ( is_single() && is_singular( 'team' ) ) {
146
-			require_once LSX_HEALTH_PLAN_PATH . '/includes/template-tags/team.php';
147
-		}
148
-	}
139
+     /**
140
+      * Adds custom tabs to the team member single pages.
141
+      *
142
+      * @return void
143
+      */
144
+     public function hp_team_member_tabs() {
145
+          if ( is_single() && is_singular( 'team' ) ) {
146
+               require_once LSX_HEALTH_PLAN_PATH . '/includes/template-tags/team.php';
147
+          }
148
+     }
149 149
 
150
-	public function remove_archive_original_team_header() {
151
-		if (  is_single() && is_singular( 'team' ) ) {
152
-			remove_action( 'lsx_content_wrap_before', 'lsx_global_header' );
153
-		}
154
-	}
150
+     public function remove_archive_original_team_header() {
151
+          if (  is_single() && is_singular( 'team' ) ) {
152
+               remove_action( 'lsx_content_wrap_before', 'lsx_global_header' );
153
+          }
154
+     }
155 155
 }
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -20,17 +20,17 @@  discard block
 block discarded – undo
20 20
 	 */
21 21
 	public function __construct() {
22 22
 		$this->default_types = array(
23
-			\lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' ),
24
-			\lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ),
25
-			\lsx_health_plan\functions\get_option( 'endpoint_recipe_single', 'recipe' ),
26
-			\lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ),
27
-			\lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' ),
23
+			\lsx_health_plan\functions\get_option('endpoint_meal', 'meal'),
24
+			\lsx_health_plan\functions\get_option('endpoint_exercise_single', 'exercise'),
25
+			\lsx_health_plan\functions\get_option('endpoint_recipe_single', 'recipe'),
26
+			\lsx_health_plan\functions\get_option('endpoint_workout', 'workout'),
27
+			\lsx_health_plan\functions\get_option('endpoint_plan', 'plan'),
28 28
 		);
29
-		add_action( 'wp_enqueue_scripts', array( $this, 'assets' ), 5 );
30
-		add_action( 'cmb2_admin_init', array( $this, 'related_team_metabox' ) );
31
-		add_action( 'cmb2_admin_init', array( $this, 'additional_single_team_metabox' ) );
32
-		add_action( 'lsx_entry_bottom', array( $this, 'hp_team_member_tabs' ) );
33
-		add_action( 'wp_head', array( $this, 'remove_archive_original_team_header' ), 99 );
29
+		add_action('wp_enqueue_scripts', array($this, 'assets'), 5);
30
+		add_action('cmb2_admin_init', array($this, 'related_team_metabox'));
31
+		add_action('cmb2_admin_init', array($this, 'additional_single_team_metabox'));
32
+		add_action('lsx_entry_bottom', array($this, 'hp_team_member_tabs'));
33
+		add_action('wp_head', array($this, 'remove_archive_original_team_header'), 99);
34 34
 	}
35 35
 
36 36
 	/**
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public static function get_instance() {
44 44
 		// If the single instance hasn't been set, set it now.
45
-		if ( null === self::$instance ) {
45
+		if (null === self::$instance) {
46 46
 			self::$instance = new self();
47 47
 		}
48 48
 		return self::$instance;
@@ -56,19 +56,19 @@  discard block
 block discarded – undo
56 56
 	 *
57 57
 	 */
58 58
 	public function assets() {
59
-		wp_enqueue_style( 'lsx-health-plan-team', LSX_HEALTH_PLAN_URL . 'assets/css/lsx-health-plan-team.css', array(), LSX_HEALTH_PLAN_VER );
59
+		wp_enqueue_style('lsx-health-plan-team', LSX_HEALTH_PLAN_URL . 'assets/css/lsx-health-plan-team.css', array(), LSX_HEALTH_PLAN_VER);
60 60
 	}
61 61
 
62 62
 	/**
63 63
 	 * Define the related team member metabox and field configurations.
64 64
 	 */
65 65
 	public function related_team_metabox() {
66
-		foreach ( $this->default_types as $type => $default_type ) {
66
+		foreach ($this->default_types as $type => $default_type) {
67 67
 			$cmb = new_cmb2_box(
68 68
 				array(
69 69
 					'id'           => $default_type . '_related_team_member__metabox',
70
-					'title'        => __( 'Related Team Member', 'lsx-health-plan' ),
71
-					'object_types' => array( $default_type ), // Post type.
70
+					'title'        => __('Related Team Member', 'lsx-health-plan'),
71
+					'object_types' => array($default_type), // Post type.
72 72
 					'context'      => 'normal',
73 73
 					'priority'     => 'low',
74 74
 					'show_names'   => true,
@@ -77,15 +77,15 @@  discard block
 block discarded – undo
77 77
 
78 78
 			$cmb->add_field(
79 79
 				array(
80
-					'name'       => __( 'Related Team Member', 'lsx-health-plan' ),
81
-					'desc'       => __( 'Connect the related team member that applies to this ', 'lsx-health-plan' ) . $default_type,
80
+					'name'       => __('Related Team Member', 'lsx-health-plan'),
81
+					'desc'       => __('Connect the related team member that applies to this ', 'lsx-health-plan') . $default_type,
82 82
 					'id'         => $default_type . '_connected_team_member',
83 83
 					'type'       => 'post_search_ajax',
84
-					'limit'      => 4,  // Limit selection to X items only (default 1).
84
+					'limit'      => 4, // Limit selection to X items only (default 1).
85 85
 					'sortable'   => true, // Allow selected items to be sortable (default false).
86 86
 					'query_args' => array(
87
-						'post_type'      => array( 'team' ),
88
-						'post_status'    => array( 'publish' ),
87
+						'post_type'      => array('team'),
88
+						'post_status'    => array('publish'),
89 89
 						'posts_per_page' => -1,
90 90
 					),
91 91
 				)
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 			array(
103 103
 				'id'           => 'lsx__team',
104 104
 				'title'        => '',
105
-				'object_types' => array( 'team' ), // Post type.
105
+				'object_types' => array('team'), // Post type.
106 106
 				'context'      => 'normal',
107 107
 				'priority'     => 'high',
108 108
 				'show_names'   => true,
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
 
112 112
 		$cmb->add_field(
113 113
 			array(
114
-				'name'       => __( 'Team Member Experience', 'lsx-health-plan' ),
115
-				'desc'       => __( 'Add additional experience to this team member', 'lsx-health-plan' ),
114
+				'name'       => __('Team Member Experience', 'lsx-health-plan'),
115
+				'desc'       => __('Add additional experience to this team member', 'lsx-health-plan'),
116 116
 				'id'         => 'team_member_experience',
117 117
 				'type'       => 'wysiwyg',
118 118
 			)
@@ -120,15 +120,15 @@  discard block
 block discarded – undo
120 120
 
121 121
 		$cmb->add_field(
122 122
 			array(
123
-				'name'       => __( 'Featured Plans', 'lsx-health-plan' ),
124
-				'desc'       => __( 'Connect the related plans to this team member', 'lsx-health-plan' ),
123
+				'name'       => __('Featured Plans', 'lsx-health-plan'),
124
+				'desc'       => __('Connect the related plans to this team member', 'lsx-health-plan'),
125 125
 				'id'         => 'connected_team_member_plan',
126 126
 				'type'       => 'post_search_ajax',
127 127
 				'limit'      => 3,
128 128
 				'sortable'   => true,
129 129
 				'query_args' => array(
130
-					'post_type'      => array( 'plan' ),
131
-					'post_status'    => array( 'publish' ),
130
+					'post_type'      => array('plan'),
131
+					'post_status'    => array('publish'),
132 132
 					'posts_per_page' => -1,
133 133
 				),
134 134
 			)
@@ -142,14 +142,14 @@  discard block
 block discarded – undo
142 142
 	 * @return void
143 143
 	 */
144 144
 	public function hp_team_member_tabs() {
145
-		if ( is_single() && is_singular( 'team' ) ) {
145
+		if (is_single() && is_singular('team')) {
146 146
 			require_once LSX_HEALTH_PLAN_PATH . '/includes/template-tags/team.php';
147 147
 		}
148 148
 	}
149 149
 
150 150
 	public function remove_archive_original_team_header() {
151
-		if (  is_single() && is_singular( 'team' ) ) {
152
-			remove_action( 'lsx_content_wrap_before', 'lsx_global_header' );
151
+		if (is_single() && is_singular('team')) {
152
+			remove_action('lsx_content_wrap_before', 'lsx_global_header');
153 153
 		}
154 154
 	}
155 155
 }
Please login to merge, or discard this patch.
classes/admin/settings/class-meal.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	 * Constructor
26 26
 	 */
27 27
 	public function __construct() {
28
-		add_action( 'lsx_hp_settings_page_meal_top', array( $this, 'settings' ), 1, 1 );
28
+		add_action('lsx_hp_settings_page_meal_top', array($this, 'settings'), 1, 1);
29 29
 	}
30 30
 
31 31
 	/**
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 */
38 38
 	public static function get_instance() {
39 39
 		// If the single instance hasn't been set, set it now.
40
-		if ( null === self::$instance ) {
40
+		if (null === self::$instance) {
41 41
 			self::$instance = new self();
42 42
 		}
43 43
 		return self::$instance;
@@ -49,15 +49,15 @@  discard block
 block discarded – undo
49 49
 	 * @param object $cmb new_cmb2_box().
50 50
 	 * @return void
51 51
 	 */
52
-	public function settings( $cmb ) {
52
+	public function settings($cmb) {
53 53
 		$cmb->add_field(
54 54
 			array(
55
-				'name'        => __( 'Disable Meals', 'lsx-health-plan' ),
55
+				'name'        => __('Disable Meals', 'lsx-health-plan'),
56 56
 				'id'          => 'meal_disabled',
57 57
 				'type'        => 'checkbox',
58 58
 				'value'       => 1,
59 59
 				'default'     => 0,
60
-				'description' => __( 'Disable meal post type if you are wanting a minimal site.', 'lsx-health-plan' ),
60
+				'description' => __('Disable meal post type if you are wanting a minimal site.', 'lsx-health-plan'),
61 61
 			)
62 62
 		);
63 63
 
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 			array(
66 66
 				'id'          => 'meal_archive_description',
67 67
 				'type'        => 'wysiwyg',
68
-				'name'        => __( 'Archive Description', 'lsx-health-plan' ),
69
-				'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ),
68
+				'name'        => __('Archive Description', 'lsx-health-plan'),
69
+				'description' => __('This will show up on the post type archive.', 'lsx-health-plan'),
70 70
 				'options'     => array(
71 71
 					'textarea_rows' => get_option('default_post_edit_rows', 6),
72 72
 				),
@@ -75,18 +75,18 @@  discard block
 block discarded – undo
75 75
 
76 76
 		$cmb->add_field(
77 77
 			array(
78
-				'name'    => __( 'Your Meal Plan Intro', 'lsx-health-plan' ),
78
+				'name'    => __('Your Meal Plan Intro', 'lsx-health-plan'),
79 79
 				'id'      => 'meal_plan_intro',
80 80
 				'type'    => 'textarea_small',
81 81
 				'value'   => '',
82
-				'default' => __( 'Get the right mix of nutrients to keep muscles strong & healthy.', 'lsx-health-plan' ),
82
+				'default' => __('Get the right mix of nutrients to keep muscles strong & healthy.', 'lsx-health-plan'),
83 83
 			)
84 84
 		);
85 85
 
86 86
 		$cmb->add_field(
87 87
 			array(
88 88
 				'before_row' => '<h4><b><u>URL Slug Options</u></b></h4><p style="font-style: italic;">If you need to translate the custom slug for this custom post type, do so below.</p>',
89
-				'name'       =>  __( 'Meal Slug', 'lsx-health-plan' ),
89
+				'name'       =>  __('Meal Slug', 'lsx-health-plan'),
90 90
 				'id'         => 'endpoint_meal',
91 91
 				'type'       => 'input',
92 92
 				'value'      => '',
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		);
96 96
 		$cmb->add_field(
97 97
 			array(
98
-				'name'    =>  __( 'Meals Archive Slug', 'lsx-health-plan' ),
98
+				'name'    =>  __('Meals Archive Slug', 'lsx-health-plan'),
99 99
 				'id'      => 'endpoint_meal_archive',
100 100
 				'type'    => 'input',
101 101
 				'value'   => '',
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 		);
105 105
 		$cmb->add_field(
106 106
 			array(
107
-				'name'    =>  __( 'Single Meal Slug', 'lsx-health-plan' ),
107
+				'name'    =>  __('Single Meal Slug', 'lsx-health-plan'),
108 108
 				'id'      => 'meal_single_slug',
109 109
 				'type'    => 'input',
110 110
 				'value'   => '',
@@ -115,40 +115,40 @@  discard block
 block discarded – undo
115 115
 		$cmb->add_field(
116 116
 			array(
117 117
 				'before_row'  => '<h4><b><u>Default Options</u></b></h4>',
118
-				'name'        => __( 'Default Meal Plan', 'lsx-health-plan' ),
119
-				'description' => __( 'Set a default meal plan.', 'lsx-health-plan' ),
118
+				'name'        => __('Default Meal Plan', 'lsx-health-plan'),
119
+				'description' => __('Set a default meal plan.', 'lsx-health-plan'),
120 120
 				'limit'       => 1,
121 121
 				'id'          => 'connected_meals',
122 122
 				'type'        => 'post_search_ajax',
123 123
 				'query_args'  => array(
124 124
 					'post_type'      => 'meal',
125
-					'post_status'    => array( 'publish' ),
125
+					'post_status'    => array('publish'),
126 126
 					'posts_per_page' => -1,
127 127
 				),
128 128
 			)
129 129
 		);
130
-		if ( function_exists( 'download_monitor' ) ) {
130
+		if (function_exists('download_monitor')) {
131 131
 			$page_url    = 'https://wordpress.org/plugins/download-monitor/';
132 132
 			$plugin_name = 'Download Monitor';
133 133
 			$description = sprintf(
134 134
 				/* translators: %s: The subscription info */
135
-				__( 'If you are using <a target="_blank" href="%1$s">%2$s</a> you can set a default download file for your meal here.', 'lsx-search' ),
135
+				__('If you are using <a target="_blank" href="%1$s">%2$s</a> you can set a default download file for your meal here.', 'lsx-search'),
136 136
 				$page_url,
137 137
 				$plugin_name
138 138
 			);
139 139
 			$cmb->add_field(
140 140
 				array(
141
-					'name'        => __( 'Default Meal Plan PDF', 'lsx-health-plan' ),
141
+					'name'        => __('Default Meal Plan PDF', 'lsx-health-plan'),
142 142
 					'description' => $description,
143 143
 					'id'          => 'download_meal',
144 144
 					'type'        => 'post_search_ajax',
145 145
 					'limit'       => 1,
146 146
 					'query_args'  => array(
147
-						'post_type'      => array( 'dlm_download' ),
148
-						'post_status'    => array( 'publish' ),
147
+						'post_type'      => array('dlm_download'),
148
+						'post_status'    => array('publish'),
149 149
 						'posts_per_page' => -1,
150 150
 					),
151
-					'after_row'   => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ),
151
+					'after_row'   => __('<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan'),
152 152
 				)
153 153
 			);
154 154
 		}
Please login to merge, or discard this patch.
Indentation   +134 added lines, -134 removed lines patch added patch discarded remove patch
@@ -12,146 +12,146 @@
 block discarded – undo
12 12
  */
13 13
 class Meal {
14 14
 
15
-	/**
16
-	 * Holds class instance
17
-	 *
18
-	 * @since 1.0.0
19
-	 *
20
-	 * @var      object \lsx_health_plan\classes\admin\Meal()
21
-	 */
22
-	protected static $instance = null;
15
+     /**
16
+      * Holds class instance
17
+      *
18
+      * @since 1.0.0
19
+      *
20
+      * @var      object \lsx_health_plan\classes\admin\Meal()
21
+      */
22
+     protected static $instance = null;
23 23
 
24
-	/**
25
-	 * Constructor
26
-	 */
27
-	public function __construct() {
28
-		add_action( 'lsx_hp_settings_page_meal_top', array( $this, 'settings' ), 1, 1 );
29
-	}
24
+     /**
25
+      * Constructor
26
+      */
27
+     public function __construct() {
28
+          add_action( 'lsx_hp_settings_page_meal_top', array( $this, 'settings' ), 1, 1 );
29
+     }
30 30
 
31
-	/**
32
-	 * Return an instance of this class.
33
-	 *
34
-	 * @since 1.0.0
35
-	 *
36
-	 * @return    object \lsx_health_plan\classes\admin\Meal()    A single instance of this class.
37
-	 */
38
-	public static function get_instance() {
39
-		// If the single instance hasn't been set, set it now.
40
-		if ( null === self::$instance ) {
41
-			self::$instance = new self();
42
-		}
43
-		return self::$instance;
44
-	}
31
+     /**
32
+      * Return an instance of this class.
33
+      *
34
+      * @since 1.0.0
35
+      *
36
+      * @return    object \lsx_health_plan\classes\admin\Meal()    A single instance of this class.
37
+      */
38
+     public static function get_instance() {
39
+          // If the single instance hasn't been set, set it now.
40
+          if ( null === self::$instance ) {
41
+               self::$instance = new self();
42
+          }
43
+          return self::$instance;
44
+     }
45 45
 
46
-	/**
47
-	 * Registers the general settings.
48
-	 *
49
-	 * @param object $cmb new_cmb2_box().
50
-	 * @return void
51
-	 */
52
-	public function settings( $cmb ) {
53
-		$cmb->add_field(
54
-			array(
55
-				'name'        => __( 'Disable Meals', 'lsx-health-plan' ),
56
-				'id'          => 'meal_disabled',
57
-				'type'        => 'checkbox',
58
-				'value'       => 1,
59
-				'default'     => 0,
60
-				'description' => __( 'Disable meal post type if you are wanting a minimal site.', 'lsx-health-plan' ),
61
-			)
62
-		);
46
+     /**
47
+      * Registers the general settings.
48
+      *
49
+      * @param object $cmb new_cmb2_box().
50
+      * @return void
51
+      */
52
+     public function settings( $cmb ) {
53
+          $cmb->add_field(
54
+               array(
55
+                    'name'        => __( 'Disable Meals', 'lsx-health-plan' ),
56
+                    'id'          => 'meal_disabled',
57
+                    'type'        => 'checkbox',
58
+                    'value'       => 1,
59
+                    'default'     => 0,
60
+                    'description' => __( 'Disable meal post type if you are wanting a minimal site.', 'lsx-health-plan' ),
61
+               )
62
+          );
63 63
 
64
-		$cmb->add_field(
65
-			array(
66
-				'id'          => 'meal_archive_description',
67
-				'type'        => 'wysiwyg',
68
-				'name'        => __( 'Archive Description', 'lsx-health-plan' ),
69
-				'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ),
70
-				'options'     => array(
71
-					'textarea_rows' => get_option('default_post_edit_rows', 6),
72
-				),
73
-			)
74
-		);
64
+          $cmb->add_field(
65
+               array(
66
+                    'id'          => 'meal_archive_description',
67
+                    'type'        => 'wysiwyg',
68
+                    'name'        => __( 'Archive Description', 'lsx-health-plan' ),
69
+                    'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ),
70
+                    'options'     => array(
71
+                         'textarea_rows' => get_option('default_post_edit_rows', 6),
72
+                    ),
73
+               )
74
+          );
75 75
 
76
-		$cmb->add_field(
77
-			array(
78
-				'name'    => __( 'Your Meal Plan Intro', 'lsx-health-plan' ),
79
-				'id'      => 'meal_plan_intro',
80
-				'type'    => 'textarea_small',
81
-				'value'   => '',
82
-				'default' => __( 'Get the right mix of nutrients to keep muscles strong & healthy.', 'lsx-health-plan' ),
83
-			)
84
-		);
76
+          $cmb->add_field(
77
+               array(
78
+                    'name'    => __( 'Your Meal Plan Intro', 'lsx-health-plan' ),
79
+                    'id'      => 'meal_plan_intro',
80
+                    'type'    => 'textarea_small',
81
+                    'value'   => '',
82
+                    'default' => __( 'Get the right mix of nutrients to keep muscles strong & healthy.', 'lsx-health-plan' ),
83
+               )
84
+          );
85 85
 
86
-		$cmb->add_field(
87
-			array(
88
-				'before_row' => '<h4><b><u>URL Slug Options</u></b></h4><p style="font-style: italic;">If you need to translate the custom slug for this custom post type, do so below.</p>',
89
-				'name'       =>  __( 'Meal Slug', 'lsx-health-plan' ),
90
-				'id'         => 'endpoint_meal',
91
-				'type'       => 'input',
92
-				'value'      => '',
93
-				'default'    => 'meal',
94
-			)
95
-		);
96
-		$cmb->add_field(
97
-			array(
98
-				'name'    =>  __( 'Meals Archive Slug', 'lsx-health-plan' ),
99
-				'id'      => 'endpoint_meal_archive',
100
-				'type'    => 'input',
101
-				'value'   => '',
102
-				'default' => 'meals',
103
-			)
104
-		);
105
-		$cmb->add_field(
106
-			array(
107
-				'name'    =>  __( 'Single Meal Slug', 'lsx-health-plan' ),
108
-				'id'      => 'meal_single_slug',
109
-				'type'    => 'input',
110
-				'value'   => '',
111
-				'default' => 'meal',
112
-			)
113
-		);
86
+          $cmb->add_field(
87
+               array(
88
+                    'before_row' => '<h4><b><u>URL Slug Options</u></b></h4><p style="font-style: italic;">If you need to translate the custom slug for this custom post type, do so below.</p>',
89
+                    'name'       =>  __( 'Meal Slug', 'lsx-health-plan' ),
90
+                    'id'         => 'endpoint_meal',
91
+                    'type'       => 'input',
92
+                    'value'      => '',
93
+                    'default'    => 'meal',
94
+               )
95
+          );
96
+          $cmb->add_field(
97
+               array(
98
+                    'name'    =>  __( 'Meals Archive Slug', 'lsx-health-plan' ),
99
+                    'id'      => 'endpoint_meal_archive',
100
+                    'type'    => 'input',
101
+                    'value'   => '',
102
+                    'default' => 'meals',
103
+               )
104
+          );
105
+          $cmb->add_field(
106
+               array(
107
+                    'name'    =>  __( 'Single Meal Slug', 'lsx-health-plan' ),
108
+                    'id'      => 'meal_single_slug',
109
+                    'type'    => 'input',
110
+                    'value'   => '',
111
+                    'default' => 'meal',
112
+               )
113
+          );
114 114
 
115
-		$cmb->add_field(
116
-			array(
117
-				'before_row'  => '<h4><b><u>Default Options</u></b></h4>',
118
-				'name'        => __( 'Default Meal Plan', 'lsx-health-plan' ),
119
-				'description' => __( 'Set a default meal plan.', 'lsx-health-plan' ),
120
-				'limit'       => 1,
121
-				'id'          => 'connected_meals',
122
-				'type'        => 'post_search_ajax',
123
-				'query_args'  => array(
124
-					'post_type'      => 'meal',
125
-					'post_status'    => array( 'publish' ),
126
-					'posts_per_page' => -1,
127
-				),
128
-			)
129
-		);
130
-		if ( function_exists( 'download_monitor' ) ) {
131
-			$page_url    = 'https://wordpress.org/plugins/download-monitor/';
132
-			$plugin_name = 'Download Monitor';
133
-			$description = sprintf(
134
-				/* translators: %s: The subscription info */
135
-				__( 'If you are using <a target="_blank" href="%1$s">%2$s</a> you can set a default download file for your meal here.', 'lsx-search' ),
136
-				$page_url,
137
-				$plugin_name
138
-			);
139
-			$cmb->add_field(
140
-				array(
141
-					'name'        => __( 'Default Meal Plan PDF', 'lsx-health-plan' ),
142
-					'description' => $description,
143
-					'id'          => 'download_meal',
144
-					'type'        => 'post_search_ajax',
145
-					'limit'       => 1,
146
-					'query_args'  => array(
147
-						'post_type'      => array( 'dlm_download' ),
148
-						'post_status'    => array( 'publish' ),
149
-						'posts_per_page' => -1,
150
-					),
151
-					'after_row'   => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ),
152
-				)
153
-			);
154
-		}
155
-	}
115
+          $cmb->add_field(
116
+               array(
117
+                    'before_row'  => '<h4><b><u>Default Options</u></b></h4>',
118
+                    'name'        => __( 'Default Meal Plan', 'lsx-health-plan' ),
119
+                    'description' => __( 'Set a default meal plan.', 'lsx-health-plan' ),
120
+                    'limit'       => 1,
121
+                    'id'          => 'connected_meals',
122
+                    'type'        => 'post_search_ajax',
123
+                    'query_args'  => array(
124
+                         'post_type'      => 'meal',
125
+                         'post_status'    => array( 'publish' ),
126
+                         'posts_per_page' => -1,
127
+                    ),
128
+               )
129
+          );
130
+          if ( function_exists( 'download_monitor' ) ) {
131
+               $page_url    = 'https://wordpress.org/plugins/download-monitor/';
132
+               $plugin_name = 'Download Monitor';
133
+               $description = sprintf(
134
+                    /* translators: %s: The subscription info */
135
+                    __( 'If you are using <a target="_blank" href="%1$s">%2$s</a> you can set a default download file for your meal here.', 'lsx-search' ),
136
+                    $page_url,
137
+                    $plugin_name
138
+               );
139
+               $cmb->add_field(
140
+                    array(
141
+                         'name'        => __( 'Default Meal Plan PDF', 'lsx-health-plan' ),
142
+                         'description' => $description,
143
+                         'id'          => 'download_meal',
144
+                         'type'        => 'post_search_ajax',
145
+                         'limit'       => 1,
146
+                         'query_args'  => array(
147
+                              'post_type'      => array( 'dlm_download' ),
148
+                              'post_status'    => array( 'publish' ),
149
+                              'posts_per_page' => -1,
150
+                         ),
151
+                         'after_row'   => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ),
152
+                    )
153
+               );
154
+          }
155
+     }
156 156
 }
157 157
 Meal::get_instance();
Please login to merge, or discard this patch.
classes/admin/settings/class-recipe.php 2 patches
Indentation   +116 added lines, -116 removed lines patch added patch discarded remove patch
@@ -12,128 +12,128 @@
 block discarded – undo
12 12
  */
13 13
 class Recipe {
14 14
 
15
-	/**
16
-	 * Holds class instance
17
-	 *
18
-	 * @since 1.0.0
19
-	 *
20
-	 * @var      object \lsx_health_plan\classes\admin\Recipe()
21
-	 */
22
-	protected static $instance = null;
15
+     /**
16
+      * Holds class instance
17
+      *
18
+      * @since 1.0.0
19
+      *
20
+      * @var      object \lsx_health_plan\classes\admin\Recipe()
21
+      */
22
+     protected static $instance = null;
23 23
 
24
-	/**
25
-	 * Constructor
26
-	 */
27
-	public function __construct() {
28
-		add_action( 'lsx_hp_settings_page_recipe_top', array( $this, 'settings' ), 1, 1 );
29
-	}
24
+     /**
25
+      * Constructor
26
+      */
27
+     public function __construct() {
28
+          add_action( 'lsx_hp_settings_page_recipe_top', array( $this, 'settings' ), 1, 1 );
29
+     }
30 30
 
31
-	/**
32
-	 * Return an instance of this class.
33
-	 *
34
-	 * @since 1.0.0
35
-	 *
36
-	 * @return    object \lsx_health_plan\classes\admin\Recipe()    A single instance of this class.
37
-	 */
38
-	public static function get_instance() {
39
-		// If the single instance hasn't been set, set it now.
40
-		if ( null === self::$instance ) {
41
-			self::$instance = new self();
42
-		}
43
-		return self::$instance;
44
-	}
31
+     /**
32
+      * Return an instance of this class.
33
+      *
34
+      * @since 1.0.0
35
+      *
36
+      * @return    object \lsx_health_plan\classes\admin\Recipe()    A single instance of this class.
37
+      */
38
+     public static function get_instance() {
39
+          // If the single instance hasn't been set, set it now.
40
+          if ( null === self::$instance ) {
41
+               self::$instance = new self();
42
+          }
43
+          return self::$instance;
44
+     }
45 45
 
46
-	/**
47
-	 * Registers the general settings.
48
-	 *
49
-	 * @param object $cmb new_cmb2_box().
50
-	 * @return void
51
-	 */
52
-	public function settings( $cmb ) {
53
-		$cmb->add_field(
54
-			array(
55
-				'name'        => __( 'Disable Recipes', 'lsx-health-plan' ),
56
-				'id'          => 'recipe_disabled',
57
-				'type'        => 'checkbox',
58
-				'value'       => 1,
59
-				'default'     => 0,
60
-				'description' => __( 'Disable recipe post type if you are wanting a minimal site.', 'lsx-health-plan' ),
61
-			)
62
-		);
46
+     /**
47
+      * Registers the general settings.
48
+      *
49
+      * @param object $cmb new_cmb2_box().
50
+      * @return void
51
+      */
52
+     public function settings( $cmb ) {
53
+          $cmb->add_field(
54
+               array(
55
+                    'name'        => __( 'Disable Recipes', 'lsx-health-plan' ),
56
+                    'id'          => 'recipe_disabled',
57
+                    'type'        => 'checkbox',
58
+                    'value'       => 1,
59
+                    'default'     => 0,
60
+                    'description' => __( 'Disable recipe post type if you are wanting a minimal site.', 'lsx-health-plan' ),
61
+               )
62
+          );
63 63
 
64
-		$cmb->add_field(
65
-			array(
66
-				'id'          => 'recipe_archive_description',
67
-				'type'        => 'wysiwyg',
68
-				'name'        => __( 'Archive Description', 'lsx-health-plan' ),
69
-				'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ),
70
-				'options'     => array(
71
-					'textarea_rows' => get_option('default_post_edit_rows', 6),
72
-				),
73
-			)
74
-		);
64
+          $cmb->add_field(
65
+               array(
66
+                    'id'          => 'recipe_archive_description',
67
+                    'type'        => 'wysiwyg',
68
+                    'name'        => __( 'Archive Description', 'lsx-health-plan' ),
69
+                    'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ),
70
+                    'options'     => array(
71
+                         'textarea_rows' => get_option('default_post_edit_rows', 6),
72
+                    ),
73
+               )
74
+          );
75 75
 
76
-		$cmb->add_field(
77
-			array(
78
-				'name'    => __( 'Recipes Intro', 'lsx-health-plan' ),
79
-				'id'      => 'recipes_intro',
80
-				'type'    => 'textarea_small',
81
-				'value'   => '',
82
-				'default' => __( "Let's get cooking! Delicious and easy to follow recipes.", 'lsx-health-plan' ),
83
-			)
84
-		);
76
+          $cmb->add_field(
77
+               array(
78
+                    'name'    => __( 'Recipes Intro', 'lsx-health-plan' ),
79
+                    'id'      => 'recipes_intro',
80
+                    'type'    => 'textarea_small',
81
+                    'value'   => '',
82
+                    'default' => __( "Let's get cooking! Delicious and easy to follow recipes.", 'lsx-health-plan' ),
83
+               )
84
+          );
85 85
 
86
-		$cmb->add_field(
87
-			array(
88
-				'before_row' => '<h4><b><u>URL Slug Options</u></b></h4><p style="font-style: italic;">If you need to translate the custom slug for this custom post type, do so below.</p>',
89
-				'name'       =>  __( 'Recipes Slug', 'lsx-health-plan' ),
90
-				'id'         => 'endpoint_recipe',
91
-				'type'       => 'input',
92
-				'value'      => '',
93
-				'default'    => 'recipe',
94
-			)
95
-		);
86
+          $cmb->add_field(
87
+               array(
88
+                    'before_row' => '<h4><b><u>URL Slug Options</u></b></h4><p style="font-style: italic;">If you need to translate the custom slug for this custom post type, do so below.</p>',
89
+                    'name'       =>  __( 'Recipes Slug', 'lsx-health-plan' ),
90
+                    'id'         => 'endpoint_recipe',
91
+                    'type'       => 'input',
92
+                    'value'      => '',
93
+                    'default'    => 'recipe',
94
+               )
95
+          );
96 96
 
97
-		$cmb->add_field(
98
-			array(
99
-				'before_row'  => '<h4><b><u>Default Options</u></b></h4>',
100
-				'name'        => __( 'Recipe', 'lsx-health-plan' ),
101
-				'description' => __( 'Set a default recipe.', 'lsx-health-plan' ),
102
-				'limit'       => 1,
103
-				'id'          => 'connected_recipes',
104
-				'type'        => 'post_search_ajax',
105
-				'query_args'  => array(
106
-					'post_type'      => 'recipe',
107
-					'post_status'    => array( 'publish' ),
108
-					'posts_per_page' => -1,
109
-				),
110
-			)
111
-		);
112
-		if ( function_exists( 'download_monitor' ) ) {
113
-			$page_url    = 'https://wordpress.org/plugins/download-monitor/';
114
-			$plugin_name = 'Download Monitor';
115
-			$description = sprintf(
116
-				/* translators: %s: The subscription info */
117
-				__( 'If you are using <a target="_blank" href="%1$s">%2$s</a> you can set a default download file for your recipe here.', 'lsx-search' ),
118
-				$page_url,
119
-				$plugin_name
120
-			);
121
-			$cmb->add_field(
122
-				array(
123
-					'name'        => __( 'Default Recipe PDF', 'lsx-health-plan' ),
124
-					'description' => $description,
125
-					'id'          => 'download_recipe',
126
-					'type'        => 'post_search_ajax',
127
-					'limit'       => 1,
128
-					'query_args'  => array(
129
-						'post_type'      => array( 'dlm_download' ),
130
-						'post_status'    => array( 'publish' ),
131
-						'posts_per_page' => -1,
132
-					),
133
-					'after_row'   => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ),
134
-				)
135
-			);
136
-		}
137
-	}
97
+          $cmb->add_field(
98
+               array(
99
+                    'before_row'  => '<h4><b><u>Default Options</u></b></h4>',
100
+                    'name'        => __( 'Recipe', 'lsx-health-plan' ),
101
+                    'description' => __( 'Set a default recipe.', 'lsx-health-plan' ),
102
+                    'limit'       => 1,
103
+                    'id'          => 'connected_recipes',
104
+                    'type'        => 'post_search_ajax',
105
+                    'query_args'  => array(
106
+                         'post_type'      => 'recipe',
107
+                         'post_status'    => array( 'publish' ),
108
+                         'posts_per_page' => -1,
109
+                    ),
110
+               )
111
+          );
112
+          if ( function_exists( 'download_monitor' ) ) {
113
+               $page_url    = 'https://wordpress.org/plugins/download-monitor/';
114
+               $plugin_name = 'Download Monitor';
115
+               $description = sprintf(
116
+                    /* translators: %s: The subscription info */
117
+                    __( 'If you are using <a target="_blank" href="%1$s">%2$s</a> you can set a default download file for your recipe here.', 'lsx-search' ),
118
+                    $page_url,
119
+                    $plugin_name
120
+               );
121
+               $cmb->add_field(
122
+                    array(
123
+                         'name'        => __( 'Default Recipe PDF', 'lsx-health-plan' ),
124
+                         'description' => $description,
125
+                         'id'          => 'download_recipe',
126
+                         'type'        => 'post_search_ajax',
127
+                         'limit'       => 1,
128
+                         'query_args'  => array(
129
+                              'post_type'      => array( 'dlm_download' ),
130
+                              'post_status'    => array( 'publish' ),
131
+                              'posts_per_page' => -1,
132
+                         ),
133
+                         'after_row'   => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ),
134
+                    )
135
+               );
136
+          }
137
+     }
138 138
 }
139 139
 Recipe::get_instance();
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	 * Constructor
26 26
 	 */
27 27
 	public function __construct() {
28
-		add_action( 'lsx_hp_settings_page_recipe_top', array( $this, 'settings' ), 1, 1 );
28
+		add_action('lsx_hp_settings_page_recipe_top', array($this, 'settings'), 1, 1);
29 29
 	}
30 30
 
31 31
 	/**
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 */
38 38
 	public static function get_instance() {
39 39
 		// If the single instance hasn't been set, set it now.
40
-		if ( null === self::$instance ) {
40
+		if (null === self::$instance) {
41 41
 			self::$instance = new self();
42 42
 		}
43 43
 		return self::$instance;
@@ -49,15 +49,15 @@  discard block
 block discarded – undo
49 49
 	 * @param object $cmb new_cmb2_box().
50 50
 	 * @return void
51 51
 	 */
52
-	public function settings( $cmb ) {
52
+	public function settings($cmb) {
53 53
 		$cmb->add_field(
54 54
 			array(
55
-				'name'        => __( 'Disable Recipes', 'lsx-health-plan' ),
55
+				'name'        => __('Disable Recipes', 'lsx-health-plan'),
56 56
 				'id'          => 'recipe_disabled',
57 57
 				'type'        => 'checkbox',
58 58
 				'value'       => 1,
59 59
 				'default'     => 0,
60
-				'description' => __( 'Disable recipe post type if you are wanting a minimal site.', 'lsx-health-plan' ),
60
+				'description' => __('Disable recipe post type if you are wanting a minimal site.', 'lsx-health-plan'),
61 61
 			)
62 62
 		);
63 63
 
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 			array(
66 66
 				'id'          => 'recipe_archive_description',
67 67
 				'type'        => 'wysiwyg',
68
-				'name'        => __( 'Archive Description', 'lsx-health-plan' ),
69
-				'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ),
68
+				'name'        => __('Archive Description', 'lsx-health-plan'),
69
+				'description' => __('This will show up on the post type archive.', 'lsx-health-plan'),
70 70
 				'options'     => array(
71 71
 					'textarea_rows' => get_option('default_post_edit_rows', 6),
72 72
 				),
@@ -75,18 +75,18 @@  discard block
 block discarded – undo
75 75
 
76 76
 		$cmb->add_field(
77 77
 			array(
78
-				'name'    => __( 'Recipes Intro', 'lsx-health-plan' ),
78
+				'name'    => __('Recipes Intro', 'lsx-health-plan'),
79 79
 				'id'      => 'recipes_intro',
80 80
 				'type'    => 'textarea_small',
81 81
 				'value'   => '',
82
-				'default' => __( "Let's get cooking! Delicious and easy to follow recipes.", 'lsx-health-plan' ),
82
+				'default' => __("Let's get cooking! Delicious and easy to follow recipes.", 'lsx-health-plan'),
83 83
 			)
84 84
 		);
85 85
 
86 86
 		$cmb->add_field(
87 87
 			array(
88 88
 				'before_row' => '<h4><b><u>URL Slug Options</u></b></h4><p style="font-style: italic;">If you need to translate the custom slug for this custom post type, do so below.</p>',
89
-				'name'       =>  __( 'Recipes Slug', 'lsx-health-plan' ),
89
+				'name'       =>  __('Recipes Slug', 'lsx-health-plan'),
90 90
 				'id'         => 'endpoint_recipe',
91 91
 				'type'       => 'input',
92 92
 				'value'      => '',
@@ -97,40 +97,40 @@  discard block
 block discarded – undo
97 97
 		$cmb->add_field(
98 98
 			array(
99 99
 				'before_row'  => '<h4><b><u>Default Options</u></b></h4>',
100
-				'name'        => __( 'Recipe', 'lsx-health-plan' ),
101
-				'description' => __( 'Set a default recipe.', 'lsx-health-plan' ),
100
+				'name'        => __('Recipe', 'lsx-health-plan'),
101
+				'description' => __('Set a default recipe.', 'lsx-health-plan'),
102 102
 				'limit'       => 1,
103 103
 				'id'          => 'connected_recipes',
104 104
 				'type'        => 'post_search_ajax',
105 105
 				'query_args'  => array(
106 106
 					'post_type'      => 'recipe',
107
-					'post_status'    => array( 'publish' ),
107
+					'post_status'    => array('publish'),
108 108
 					'posts_per_page' => -1,
109 109
 				),
110 110
 			)
111 111
 		);
112
-		if ( function_exists( 'download_monitor' ) ) {
112
+		if (function_exists('download_monitor')) {
113 113
 			$page_url    = 'https://wordpress.org/plugins/download-monitor/';
114 114
 			$plugin_name = 'Download Monitor';
115 115
 			$description = sprintf(
116 116
 				/* translators: %s: The subscription info */
117
-				__( 'If you are using <a target="_blank" href="%1$s">%2$s</a> you can set a default download file for your recipe here.', 'lsx-search' ),
117
+				__('If you are using <a target="_blank" href="%1$s">%2$s</a> you can set a default download file for your recipe here.', 'lsx-search'),
118 118
 				$page_url,
119 119
 				$plugin_name
120 120
 			);
121 121
 			$cmb->add_field(
122 122
 				array(
123
-					'name'        => __( 'Default Recipe PDF', 'lsx-health-plan' ),
123
+					'name'        => __('Default Recipe PDF', 'lsx-health-plan'),
124 124
 					'description' => $description,
125 125
 					'id'          => 'download_recipe',
126 126
 					'type'        => 'post_search_ajax',
127 127
 					'limit'       => 1,
128 128
 					'query_args'  => array(
129
-						'post_type'      => array( 'dlm_download' ),
130
-						'post_status'    => array( 'publish' ),
129
+						'post_type'      => array('dlm_download'),
130
+						'post_status'    => array('publish'),
131 131
 						'posts_per_page' => -1,
132 132
 					),
133
-					'after_row'   => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ),
133
+					'after_row'   => __('<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan'),
134 134
 				)
135 135
 			);
136 136
 		}
Please login to merge, or discard this patch.
classes/admin/settings/class-exercise.php 2 patches
Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -12,112 +12,112 @@
 block discarded – undo
12 12
  */
13 13
 class Exercise {
14 14
 
15
-	/**
16
-	 * Holds class instance
17
-	 *
18
-	 * @since 1.0.0
19
-	 *
20
-	 * @var      object \lsx_health_plan\classes\admin\Exercise()
21
-	 */
22
-	protected static $instance = null;
15
+     /**
16
+      * Holds class instance
17
+      *
18
+      * @since 1.0.0
19
+      *
20
+      * @var      object \lsx_health_plan\classes\admin\Exercise()
21
+      */
22
+     protected static $instance = null;
23 23
 
24
-	/**
25
-	 * Constructor
26
-	 */
27
-	public function __construct() {
28
-		add_action( 'lsx_hp_settings_page_exercise_top', array( $this, 'settings' ), 1, 1 );
29
-	}
24
+     /**
25
+      * Constructor
26
+      */
27
+     public function __construct() {
28
+          add_action( 'lsx_hp_settings_page_exercise_top', array( $this, 'settings' ), 1, 1 );
29
+     }
30 30
 
31
-	/**
32
-	 * Return an instance of this class.
33
-	 *
34
-	 * @since 1.0.0
35
-	 *
36
-	 * @return    object \lsx_health_plan\classes\admin\Exercise()    A single instance of this class.
37
-	 */
38
-	public static function get_instance() {
39
-		// If the single instance hasn't been set, set it now.
40
-		if ( null === self::$instance ) {
41
-			self::$instance = new self();
42
-		}
43
-		return self::$instance;
44
-	}
31
+     /**
32
+      * Return an instance of this class.
33
+      *
34
+      * @since 1.0.0
35
+      *
36
+      * @return    object \lsx_health_plan\classes\admin\Exercise()    A single instance of this class.
37
+      */
38
+     public static function get_instance() {
39
+          // If the single instance hasn't been set, set it now.
40
+          if ( null === self::$instance ) {
41
+               self::$instance = new self();
42
+          }
43
+          return self::$instance;
44
+     }
45 45
 
46
-	/**
47
-	 * Registers the general settings.
48
-	 *
49
-	 * @param object $cmb new_cmb2_box().
50
-	 * @return void
51
-	 */
52
-	public function settings( $cmb ) {
53
-		$cmb->add_field(
54
-			array(
55
-				'name'        => __( 'Exercises', 'lsx-health-plan' ),
56
-				'id'          => 'exercise_enabled',
57
-				'type'        => 'checkbox',
58
-				'value'       => 1,
59
-				'default'     => 0,
60
-				'description' => __( 'Enabling the exercise post type will automatically replace the Video post type.', 'lsx-health-plan' ),
61
-			)
62
-		);
63
-		$cmb->add_field(
64
-			array(
65
-				'id'          => 'exercise_archive_description',
66
-				'type'        => 'wysiwyg',
67
-				'name'        => __( 'Archive Description', 'lsx-health-plan' ),
68
-				'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ),
69
-				'options'     => array(
70
-					'textarea_rows' => get_option('default_post_edit_rows', 6),
71
-				),
72
-			)
73
-		);
74
-		$cmb->add_field(
75
-			array(
76
-				'before_row' => '<h4><b><u>URL Slug Options</u></b></h4><p style="font-style: italic;">If you need to translate the custom slug for this custom post type, do so below.</p>',
77
-				'name'       =>  __( 'Single Exercise Slug', 'lsx-health-plan' ),
78
-				'id'         => 'endpoint_exercise_single',
79
-				'type'       => 'input',
80
-				'value'      => '',
81
-				'default'    => 'exercise',
82
-			)
83
-		);
84
-		$cmb->add_field(
85
-			array(
86
-				'name'    =>  __( 'Archive Exercise Slug', 'lsx-health-plan' ),
87
-				'id'      => 'endpoint_exercise_archive',
88
-				'type'    => 'input',
89
-				'value'   => '',
90
-				'default' => 'exercises',
91
-			)
92
-		);
93
-		$cmb->add_field(
94
-			array(
95
-				'name'    =>  __( 'Exercise Type Slug', 'lsx-health-plan' ),
96
-				'id'      => 'endpoint_exercise_type',
97
-				'type'    => 'input',
98
-				'value'   => '',
99
-				'default' => 'exercise-type',
100
-			)
101
-		);
102
-		$cmb->add_field(
103
-			array(
104
-				'name'    =>  __( 'Equipment Slug', 'lsx-health-plan' ),
105
-				'id'      => 'endpoint_exercise_equipment',
106
-				'type'    => 'input',
107
-				'value'   => '',
108
-				'default' => 'equipment',
109
-			)
110
-		);
111
-		$cmb->add_field(
112
-			array(
113
-				'name'      =>  __( 'Muscle Group Slug', 'lsx-health-plan' ),
114
-				'id'        => 'endpoint_exercise_musclegroup',
115
-				'type'      => 'input',
116
-				'value'     => '',
117
-				'default'   => 'muscle-group',
118
-				'after_row' => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ),
119
-			)
120
-		);
121
-	}
46
+     /**
47
+      * Registers the general settings.
48
+      *
49
+      * @param object $cmb new_cmb2_box().
50
+      * @return void
51
+      */
52
+     public function settings( $cmb ) {
53
+          $cmb->add_field(
54
+               array(
55
+                    'name'        => __( 'Exercises', 'lsx-health-plan' ),
56
+                    'id'          => 'exercise_enabled',
57
+                    'type'        => 'checkbox',
58
+                    'value'       => 1,
59
+                    'default'     => 0,
60
+                    'description' => __( 'Enabling the exercise post type will automatically replace the Video post type.', 'lsx-health-plan' ),
61
+               )
62
+          );
63
+          $cmb->add_field(
64
+               array(
65
+                    'id'          => 'exercise_archive_description',
66
+                    'type'        => 'wysiwyg',
67
+                    'name'        => __( 'Archive Description', 'lsx-health-plan' ),
68
+                    'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ),
69
+                    'options'     => array(
70
+                         'textarea_rows' => get_option('default_post_edit_rows', 6),
71
+                    ),
72
+               )
73
+          );
74
+          $cmb->add_field(
75
+               array(
76
+                    'before_row' => '<h4><b><u>URL Slug Options</u></b></h4><p style="font-style: italic;">If you need to translate the custom slug for this custom post type, do so below.</p>',
77
+                    'name'       =>  __( 'Single Exercise Slug', 'lsx-health-plan' ),
78
+                    'id'         => 'endpoint_exercise_single',
79
+                    'type'       => 'input',
80
+                    'value'      => '',
81
+                    'default'    => 'exercise',
82
+               )
83
+          );
84
+          $cmb->add_field(
85
+               array(
86
+                    'name'    =>  __( 'Archive Exercise Slug', 'lsx-health-plan' ),
87
+                    'id'      => 'endpoint_exercise_archive',
88
+                    'type'    => 'input',
89
+                    'value'   => '',
90
+                    'default' => 'exercises',
91
+               )
92
+          );
93
+          $cmb->add_field(
94
+               array(
95
+                    'name'    =>  __( 'Exercise Type Slug', 'lsx-health-plan' ),
96
+                    'id'      => 'endpoint_exercise_type',
97
+                    'type'    => 'input',
98
+                    'value'   => '',
99
+                    'default' => 'exercise-type',
100
+               )
101
+          );
102
+          $cmb->add_field(
103
+               array(
104
+                    'name'    =>  __( 'Equipment Slug', 'lsx-health-plan' ),
105
+                    'id'      => 'endpoint_exercise_equipment',
106
+                    'type'    => 'input',
107
+                    'value'   => '',
108
+                    'default' => 'equipment',
109
+               )
110
+          );
111
+          $cmb->add_field(
112
+               array(
113
+                    'name'      =>  __( 'Muscle Group Slug', 'lsx-health-plan' ),
114
+                    'id'        => 'endpoint_exercise_musclegroup',
115
+                    'type'      => 'input',
116
+                    'value'     => '',
117
+                    'default'   => 'muscle-group',
118
+                    'after_row' => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ),
119
+               )
120
+          );
121
+     }
122 122
 }
123 123
 Exercise::get_instance();
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	 * Constructor
26 26
 	 */
27 27
 	public function __construct() {
28
-		add_action( 'lsx_hp_settings_page_exercise_top', array( $this, 'settings' ), 1, 1 );
28
+		add_action('lsx_hp_settings_page_exercise_top', array($this, 'settings'), 1, 1);
29 29
 	}
30 30
 
31 31
 	/**
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 */
38 38
 	public static function get_instance() {
39 39
 		// If the single instance hasn't been set, set it now.
40
-		if ( null === self::$instance ) {
40
+		if (null === self::$instance) {
41 41
 			self::$instance = new self();
42 42
 		}
43 43
 		return self::$instance;
@@ -49,23 +49,23 @@  discard block
 block discarded – undo
49 49
 	 * @param object $cmb new_cmb2_box().
50 50
 	 * @return void
51 51
 	 */
52
-	public function settings( $cmb ) {
52
+	public function settings($cmb) {
53 53
 		$cmb->add_field(
54 54
 			array(
55
-				'name'        => __( 'Exercises', 'lsx-health-plan' ),
55
+				'name'        => __('Exercises', 'lsx-health-plan'),
56 56
 				'id'          => 'exercise_enabled',
57 57
 				'type'        => 'checkbox',
58 58
 				'value'       => 1,
59 59
 				'default'     => 0,
60
-				'description' => __( 'Enabling the exercise post type will automatically replace the Video post type.', 'lsx-health-plan' ),
60
+				'description' => __('Enabling the exercise post type will automatically replace the Video post type.', 'lsx-health-plan'),
61 61
 			)
62 62
 		);
63 63
 		$cmb->add_field(
64 64
 			array(
65 65
 				'id'          => 'exercise_archive_description',
66 66
 				'type'        => 'wysiwyg',
67
-				'name'        => __( 'Archive Description', 'lsx-health-plan' ),
68
-				'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ),
67
+				'name'        => __('Archive Description', 'lsx-health-plan'),
68
+				'description' => __('This will show up on the post type archive.', 'lsx-health-plan'),
69 69
 				'options'     => array(
70 70
 					'textarea_rows' => get_option('default_post_edit_rows', 6),
71 71
 				),
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 		$cmb->add_field(
75 75
 			array(
76 76
 				'before_row' => '<h4><b><u>URL Slug Options</u></b></h4><p style="font-style: italic;">If you need to translate the custom slug for this custom post type, do so below.</p>',
77
-				'name'       =>  __( 'Single Exercise Slug', 'lsx-health-plan' ),
77
+				'name'       =>  __('Single Exercise Slug', 'lsx-health-plan'),
78 78
 				'id'         => 'endpoint_exercise_single',
79 79
 				'type'       => 'input',
80 80
 				'value'      => '',
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 		);
84 84
 		$cmb->add_field(
85 85
 			array(
86
-				'name'    =>  __( 'Archive Exercise Slug', 'lsx-health-plan' ),
86
+				'name'    =>  __('Archive Exercise Slug', 'lsx-health-plan'),
87 87
 				'id'      => 'endpoint_exercise_archive',
88 88
 				'type'    => 'input',
89 89
 				'value'   => '',
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 		);
93 93
 		$cmb->add_field(
94 94
 			array(
95
-				'name'    =>  __( 'Exercise Type Slug', 'lsx-health-plan' ),
95
+				'name'    =>  __('Exercise Type Slug', 'lsx-health-plan'),
96 96
 				'id'      => 'endpoint_exercise_type',
97 97
 				'type'    => 'input',
98 98
 				'value'   => '',
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		);
102 102
 		$cmb->add_field(
103 103
 			array(
104
-				'name'    =>  __( 'Equipment Slug', 'lsx-health-plan' ),
104
+				'name'    =>  __('Equipment Slug', 'lsx-health-plan'),
105 105
 				'id'      => 'endpoint_exercise_equipment',
106 106
 				'type'    => 'input',
107 107
 				'value'   => '',
@@ -110,12 +110,12 @@  discard block
 block discarded – undo
110 110
 		);
111 111
 		$cmb->add_field(
112 112
 			array(
113
-				'name'      =>  __( 'Muscle Group Slug', 'lsx-health-plan' ),
113
+				'name'      =>  __('Muscle Group Slug', 'lsx-health-plan'),
114 114
 				'id'        => 'endpoint_exercise_musclegroup',
115 115
 				'type'      => 'input',
116 116
 				'value'     => '',
117 117
 				'default'   => 'muscle-group',
118
-				'after_row' => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ),
118
+				'after_row' => __('<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan'),
119 119
 			)
120 120
 		);
121 121
 	}
Please login to merge, or discard this patch.
includes/functions.php 2 patches
Indentation   +277 added lines, -277 removed lines patch added patch discarded remove patch
@@ -17,27 +17,27 @@  discard block
 block discarded – undo
17 17
  * @return boolean
18 18
  */
19 19
 function has_attached_post( $post_id = '', $meta_key = '', $single = true ) {
20
-	$has_post = false;
21
-	if ( '' === $post_id ) {
22
-		$post_id = get_the_ID();
23
-	}
24
-	$items = get_post_meta( $post_id, $meta_key, $single );
25
-	if ( '' !== $items && false !== $items && 0 !== $items ) {
26
-		if ( ! is_array( $items ) ) {
27
-			$items = array( $items );
28
-		}
29
-		$items = check_posts_exist( $items );
30
-		if ( ! empty( $items ) ) {
31
-			$has_post = true;
32
-		}
33
-	} else {
34
-		// Check for defaults.
35
-		$options = get_option( 'all' );
36
-		if ( isset( $options[ $meta_key ] ) && '' !== $options[ $meta_key ] && ! empty( $options[ $meta_key ] ) ) {
37
-			$has_post = true;
38
-		}
39
-	}
40
-	return $has_post;
20
+     $has_post = false;
21
+     if ( '' === $post_id ) {
22
+          $post_id = get_the_ID();
23
+     }
24
+     $items = get_post_meta( $post_id, $meta_key, $single );
25
+     if ( '' !== $items && false !== $items && 0 !== $items ) {
26
+          if ( ! is_array( $items ) ) {
27
+               $items = array( $items );
28
+          }
29
+          $items = check_posts_exist( $items );
30
+          if ( ! empty( $items ) ) {
31
+               $has_post = true;
32
+          }
33
+     } else {
34
+          // Check for defaults.
35
+          $options = get_option( 'all' );
36
+          if ( isset( $options[ $meta_key ] ) && '' !== $options[ $meta_key ] && ! empty( $options[ $meta_key ] ) ) {
37
+               $has_post = true;
38
+          }
39
+     }
40
+     return $has_post;
41 41
 }
42 42
 
43 43
 /**
@@ -48,18 +48,18 @@  discard block
 block discarded – undo
48 48
  * @return mixed           Option value
49 49
  */
50 50
 function get_option( $key = '', $default = false ) {
51
-	if ( function_exists( 'cmb2_get_option' ) ) {
52
-		return cmb2_get_option( 'lsx_health_plan_options', $key, $default );
53
-	}
54
-	// Fallback to get_option if CMB2 is not loaded yet.
55
-	$opts = \get_option( 'lsx_health_plan_options', $default );
56
-	$val  = $default;
57
-	if ( 'all' === $key ) {
58
-		$val = $opts;
59
-	} elseif ( is_array( $opts ) && array_key_exists( $key, $opts ) && false !== $opts[ $key ] ) {
60
-		$val = $opts[ $key ];
61
-	}
62
-	return $val;
51
+     if ( function_exists( 'cmb2_get_option' ) ) {
52
+          return cmb2_get_option( 'lsx_health_plan_options', $key, $default );
53
+     }
54
+     // Fallback to get_option if CMB2 is not loaded yet.
55
+     $opts = \get_option( 'lsx_health_plan_options', $default );
56
+     $val  = $default;
57
+     if ( 'all' === $key ) {
58
+          $val = $opts;
59
+     } elseif ( is_array( $opts ) && array_key_exists( $key, $opts ) && false !== $opts[ $key ] ) {
60
+          $val = $opts[ $key ];
61
+     }
62
+     return $val;
63 63
 }
64 64
 
65 65
 /**
@@ -70,54 +70,54 @@  discard block
 block discarded – undo
70 70
  * @return mixed           Option value
71 71
  */
72 72
 function get_downloads( $type = 'all', $post_id = '' ) {
73
-	$lsx_health_plan = \lsx_health_plan();
74
-	$post_types      = $lsx_health_plan->get_post_types();
75
-	if ( '' === $post_id ) {
76
-		$post_id = get_the_ID();
77
-	}
78
-	$downloads = array();
79
-	$options   = get_option( 'all' );
80
-
81
-	foreach ( $post_types as $post_type ) {
82
-		if ( 'all' === $type || in_array( $type, $post_types, true ) ) {
83
-
84
-			// Get the default downloads for this post type.
85
-			$default_downloads = array();
86
-			$new_downloads     = array();
87
-			if ( isset( $options[ 'download_' . $post_type ] ) ) {
88
-				if ( is_array( $options[ 'download_' . $post_type ] ) ) {
89
-					$default_downloads = $options[ 'download_' . $post_type ];
90
-				} else {
91
-					$default_downloads[] = $options[ 'download_' . $post_type ];
92
-				}
93
-			}
94
-
95
-			if ( 'page' === $post_type ) {
96
-				$key = 'plan_warmup';
97
-			} else {
98
-				$key = 'connected_' . $post_type . 's';
99
-			}
100
-
101
-			$connected_items = get_post_meta( $post_id, $key, true );
102
-			if ( ! empty( $connected_items ) ) {
103
-				foreach ( $connected_items as $connected_item ) {
104
-					$current_downloads = get_post_meta( $connected_item, 'connected_downloads', true );
105
-					if ( false !== $current_downloads && ! empty( $current_downloads ) ) {
106
-						$new_downloads = array_merge( $new_downloads, $current_downloads );
107
-					}
108
-				}
109
-			}
110
-
111
-			if ( ! empty( $new_downloads ) ) {
112
-				$downloads = array_merge( $downloads, $new_downloads );
113
-			} elseif ( ! empty( $default_downloads ) ) {
114
-				$downloads = array_merge( $downloads, $default_downloads );
115
-			}
116
-			$downloads = array_unique( $downloads );
117
-		}
118
-	}
119
-	$downloads = check_posts_exist( $downloads );
120
-	return $downloads;
73
+     $lsx_health_plan = \lsx_health_plan();
74
+     $post_types      = $lsx_health_plan->get_post_types();
75
+     if ( '' === $post_id ) {
76
+          $post_id = get_the_ID();
77
+     }
78
+     $downloads = array();
79
+     $options   = get_option( 'all' );
80
+
81
+     foreach ( $post_types as $post_type ) {
82
+          if ( 'all' === $type || in_array( $type, $post_types, true ) ) {
83
+
84
+               // Get the default downloads for this post type.
85
+               $default_downloads = array();
86
+               $new_downloads     = array();
87
+               if ( isset( $options[ 'download_' . $post_type ] ) ) {
88
+                    if ( is_array( $options[ 'download_' . $post_type ] ) ) {
89
+                         $default_downloads = $options[ 'download_' . $post_type ];
90
+                    } else {
91
+                         $default_downloads[] = $options[ 'download_' . $post_type ];
92
+                    }
93
+               }
94
+
95
+               if ( 'page' === $post_type ) {
96
+                    $key = 'plan_warmup';
97
+               } else {
98
+                    $key = 'connected_' . $post_type . 's';
99
+               }
100
+
101
+               $connected_items = get_post_meta( $post_id, $key, true );
102
+               if ( ! empty( $connected_items ) ) {
103
+                    foreach ( $connected_items as $connected_item ) {
104
+                         $current_downloads = get_post_meta( $connected_item, 'connected_downloads', true );
105
+                         if ( false !== $current_downloads && ! empty( $current_downloads ) ) {
106
+                              $new_downloads = array_merge( $new_downloads, $current_downloads );
107
+                         }
108
+                    }
109
+               }
110
+
111
+               if ( ! empty( $new_downloads ) ) {
112
+                    $downloads = array_merge( $downloads, $new_downloads );
113
+               } elseif ( ! empty( $default_downloads ) ) {
114
+                    $downloads = array_merge( $downloads, $default_downloads );
115
+               }
116
+               $downloads = array_unique( $downloads );
117
+          }
118
+     }
119
+     $downloads = check_posts_exist( $downloads );
120
+     return $downloads;
121 121
 }
122 122
 
123 123
 /**
@@ -127,35 +127,35 @@  discard block
 block discarded – undo
127 127
  * @return array           an array of the downloads or empty.
128 128
  */
129 129
 function get_weekly_downloads( $week = '' ) {
130
-	$downloads = array();
131
-	if ( '' !== $week ) {
132
-		$saved_downloads = get_transient( 'lsx_hp_weekly_downloads_' . $week );
133
-		if ( false !== $saved_downloads && ! empty( $saved_downloads ) ) {
134
-			$downloads = $saved_downloads;
135
-		} else {
136
-			$args = array(
137
-				'orderby'        => 'title',
138
-				'order'          => 'ASC',
139
-				'post_type'      => 'dlm_download',
140
-				'posts_per_page' => -1,
141
-				'nopagin'        => true,
142
-				'fields'         => 'ids',
143
-				'tax_query'      => array(
144
-					array(
145
-						'taxonomy' => 'dlm_download_category',
146
-						'field'    => 'slug',
147
-						'terms'    => array( $week ),
148
-					),
149
-				),
150
-			);
151
-			$download_query = new \WP_Query( $args );
152
-			if ( $download_query->have_posts() ) {
153
-				$downloads = $download_query->posts;
154
-			}
155
-		}
156
-	}
157
-	$downloads = check_posts_exist( $downloads );
158
-	return $downloads;
130
+     $downloads = array();
131
+     if ( '' !== $week ) {
132
+          $saved_downloads = get_transient( 'lsx_hp_weekly_downloads_' . $week );
133
+          if ( false !== $saved_downloads && ! empty( $saved_downloads ) ) {
134
+               $downloads = $saved_downloads;
135
+          } else {
136
+               $args = array(
137
+                    'orderby'        => 'title',
138
+                    'order'          => 'ASC',
139
+                    'post_type'      => 'dlm_download',
140
+                    'posts_per_page' => -1,
141
+                    'nopagin'        => true,
142
+                    'fields'         => 'ids',
143
+                    'tax_query'      => array(
144
+                         array(
145
+                              'taxonomy' => 'dlm_download_category',
146
+                              'field'    => 'slug',
147
+                              'terms'    => array( $week ),
148
+                         ),
149
+                    ),
150
+               );
151
+               $download_query = new \WP_Query( $args );
152
+               if ( $download_query->have_posts() ) {
153
+                    $downloads = $download_query->posts;
154
+               }
155
+          }
156
+     }
157
+     $downloads = check_posts_exist( $downloads );
158
+     return $downloads;
159 159
 }
160 160
 
161 161
 /**
@@ -165,22 +165,22 @@  discard block
 block discarded – undo
165 165
  * @return void
166 166
  */
167 167
 function check_posts_exist( $post_ids = array() ) {
168
-	$new_ids = array();
169
-	global $wpdb;
170
-	if ( is_array( $post_ids ) && ! empty( $post_ids ) ) {
171
-		$post_ids = "'" . implode( "','", $post_ids ) . "'";
172
-		$query    = "
168
+     $new_ids = array();
169
+     global $wpdb;
170
+     if ( is_array( $post_ids ) && ! empty( $post_ids ) ) {
171
+          $post_ids = "'" . implode( "','", $post_ids ) . "'";
172
+          $query    = "
173 173
 			SELECT `ID` 
174 174
 			FROM `{$wpdb->posts}`
175 175
 			WHERE `ID` IN ({$post_ids})
176 176
 			AND `post_status` != 'trash'
177 177
 		";
178
-		$results = $wpdb->get_results( $query ); // WPCS: unprepared SQL
179
-		if ( ! empty( $results ) ) {
180
-			$new_ids = wp_list_pluck( $results, 'ID' );
181
-		}
182
-	}
183
-	return $new_ids;
178
+          $results = $wpdb->get_results( $query ); // WPCS: unprepared SQL
179
+          if ( ! empty( $results ) ) {
180
+               $new_ids = wp_list_pluck( $results, 'ID' );
181
+          }
182
+     }
183
+     return $new_ids;
184 184
 }
185 185
 
186 186
 /**
@@ -192,13 +192,13 @@  discard block
 block discarded – undo
192 192
  * @return void
193 193
  */
194 194
 function register_modal( $id = '', $title = '', $body = '' ) {
195
-	lsx_health_plan()->frontend->modals->register_modal(
196
-		array(
197
-			'title' => $title,
198
-			'body'  => $body,
199
-		),
200
-		$id
201
-	);
195
+     lsx_health_plan()->frontend->modals->register_modal(
196
+          array(
197
+               'title' => $title,
198
+               'body'  => $body,
199
+          ),
200
+          $id
201
+     );
202 202
 }
203 203
 
204 204
 /**
@@ -208,13 +208,13 @@  discard block
 block discarded – undo
208 208
  * @return void
209 209
  */
210 210
 function output_modal( $args = array() ) {
211
-	$defaults = array(
212
-		'id'    => '',
213
-		'title' => '',
214
-		'body'  => '',
215
-	);
216
-	$args     = wp_parse_args( $args, $defaults );
217
-	?>
211
+     $defaults = array(
212
+          'id'    => '',
213
+          'title' => '',
214
+          'body'  => '',
215
+     );
216
+     $args     = wp_parse_args( $args, $defaults );
217
+     ?>
218 218
 	<!-- Modal -->
219 219
 	<div class="modal fade lsx-health-plan-modal" id="<?php echo esc_html( $args['id'] ); ?>" tabindex="-1" role="dialog" aria-labelledby="<?php echo esc_html( $args['id'] ); ?>"  aria-hidden="true">
220 220
 		<div class="modal-dialog" role="document">
@@ -222,36 +222,36 @@  discard block
 block discarded – undo
222 222
 			<button type="button" class="close" data-dismiss="modal">&times;</button>			
223 223
 				<div class="modal-header">
224 224
 					<?php
225
-					if ( '' !== $args['title'] ) {
226
-						echo wp_kses_post( '<h2>' . $args['title'] . '</h2>' );
227
-					}
228
-					?>
225
+                         if ( '' !== $args['title'] ) {
226
+                              echo wp_kses_post( '<h2>' . $args['title'] . '</h2>' );
227
+                         }
228
+                         ?>
229 229
 				</div>
230 230
 				<div class="modal-body">
231 231
 				<?php
232
-				if ( '' !== $args['body'] ) {
233
-					$allowed_html = array(
234
-						'iframe' => array(
235
-							'data-src'        => array(),
236
-							'src'             => array(),
237
-							'width'           => array(),
238
-							'height'          => array(),
239
-							'frameBorder'     => array( '0' ),
240
-							'class'           => array(),
241
-							'allowFullScreen' => array(),
242
-							'style'           => array(),
243
-						),
244
-						'h5'     => array(
245
-							'class' => array(),
246
-						),
247
-					);
248
-					if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) {
249
-						echo wp_kses_post( $args['body'] );
250
-					} else {
251
-						echo wp_kses( $args['body'], $allowed_html );
252
-					}
253
-				}
254
-				?>
232
+                    if ( '' !== $args['body'] ) {
233
+                         $allowed_html = array(
234
+                              'iframe' => array(
235
+                                   'data-src'        => array(),
236
+                                   'src'             => array(),
237
+                                   'width'           => array(),
238
+                                   'height'          => array(),
239
+                                   'frameBorder'     => array( '0' ),
240
+                                   'class'           => array(),
241
+                                   'allowFullScreen' => array(),
242
+                                   'style'           => array(),
243
+                              ),
244
+                              'h5'     => array(
245
+                                   'class' => array(),
246
+                              ),
247
+                         );
248
+                         if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) {
249
+                              echo wp_kses_post( $args['body'] );
250
+                         } else {
251
+                              echo wp_kses( $args['body'], $allowed_html );
252
+                         }
253
+                    }
254
+                    ?>
255 255
 				</div>
256 256
 			</div>
257 257
 		</div>
@@ -267,18 +267,18 @@  discard block
 block discarded – undo
267 267
  * @return void
268 268
  */
269 269
 function get_video_url( $embed ) {
270
-	$url = '';
271
-	if ( false !== stripos( $embed, '<iframe' ) ) {
272
-		preg_match( '/src="([^"]+)"/', $embed, $match );
273
-		if ( is_array( $match ) && isset( $match[1] ) ) {
274
-			$url = '<iframe data-src="' . $match[1] . '" style="border: 0;" frameBorder="0" class="giphy-embed" allowFullScreen height="300" width="100%"></iframe>';
275
-		} else {
276
-			$url = $embed;
277
-		}
278
-	} else {
279
-		$url = $embed;
280
-	}
281
-	return $url;
270
+     $url = '';
271
+     if ( false !== stripos( $embed, '<iframe' ) ) {
272
+          preg_match( '/src="([^"]+)"/', $embed, $match );
273
+          if ( is_array( $match ) && isset( $match[1] ) ) {
274
+               $url = '<iframe data-src="' . $match[1] . '" style="border: 0;" frameBorder="0" class="giphy-embed" allowFullScreen height="300" width="100%"></iframe>';
275
+          } else {
276
+               $url = $embed;
277
+          }
278
+     } else {
279
+          $url = $embed;
280
+     }
281
+     return $url;
282 282
 }
283 283
 
284 284
 /**
@@ -289,18 +289,18 @@  discard block
 block discarded – undo
289 289
  * @return boolean
290 290
  */
291 291
 function is_week_complete( $term_id = false, $section_keys = array(), $group_title = '' ) {
292
-	$return = false;
293
-	if ( ! empty( $section_keys ) ) {
294
-		$group_count = count( $section_keys );
295
-		foreach ( $section_keys as &$pid ) {
296
-			$pid = 'day_' . \lsx_health_plan\functions\plan\generate_section_id( $pid ) . '_complete';
297
-		}
298
-		$days_complete = get_meta_amounts( $section_keys );
299
-		if ( (int) $group_count === (int) $days_complete ) {
300
-			$return = true;
301
-		}
302
-	}
303
-	return $return;
292
+     $return = false;
293
+     if ( ! empty( $section_keys ) ) {
294
+          $group_count = count( $section_keys );
295
+          foreach ( $section_keys as &$pid ) {
296
+               $pid = 'day_' . \lsx_health_plan\functions\plan\generate_section_id( $pid ) . '_complete';
297
+          }
298
+          $days_complete = get_meta_amounts( $section_keys );
299
+          if ( (int) $group_count === (int) $days_complete ) {
300
+               $return = true;
301
+          }
302
+     }
303
+     return $return;
304 304
 }
305 305
 
306 306
 /**
@@ -311,23 +311,23 @@  discard block
 block discarded – undo
311 311
  * @return void
312 312
  */
313 313
 function get_meta_amounts( $post_ids = array() ) {
314
-	global $wpdb;
315
-	$amount       = 0;
316
-	$current_user = wp_get_current_user();
317
-	if ( false !== $current_user && ! empty( $post_ids ) ) {
318
-		$post_ids = "'" . implode( "','", $post_ids ) . "'";
319
-		$query    = "
314
+     global $wpdb;
315
+     $amount       = 0;
316
+     $current_user = wp_get_current_user();
317
+     if ( false !== $current_user && ! empty( $post_ids ) ) {
318
+          $post_ids = "'" . implode( "','", $post_ids ) . "'";
319
+          $query    = "
320 320
 			SELECT COUNT(`meta_value`) 
321 321
 			FROM `{$wpdb->usermeta}`
322 322
 			WHERE `meta_key` IN ({$post_ids})
323 323
 			AND `user_id` = '{$current_user->ID}'
324 324
 		";
325
-		$results  = $wpdb->get_var( $query ); // WPCS: unprepared SQL
326
-		if ( ! empty( $results ) ) {
327
-			$amount = $results;
328
-		}
329
-	}
330
-	return $amount;
325
+          $results  = $wpdb->get_var( $query ); // WPCS: unprepared SQL
326
+          if ( ! empty( $results ) ) {
327
+               $amount = $results;
328
+          }
329
+     }
330
+     return $amount;
331 331
 }
332 332
 
333 333
 /**
@@ -337,46 +337,46 @@  discard block
 block discarded – undo
337 337
  * @return void
338 338
  */
339 339
 function hp_get_plan_type_meta( $post ) {
340
-	$plan_meta = '';
340
+     $plan_meta = '';
341 341
 
342
-	$term_obj_list = get_the_terms( $post->ID, 'plan-type' );
343
-	if ( false !== $term_obj_list ) {
344
-		$terms_string = '';
345
-		$terms_ids    = wp_list_pluck( $term_obj_list, 'term_id' );
342
+     $term_obj_list = get_the_terms( $post->ID, 'plan-type' );
343
+     if ( false !== $term_obj_list ) {
344
+          $terms_string = '';
345
+          $terms_ids    = wp_list_pluck( $term_obj_list, 'term_id' );
346 346
 		
347
-		foreach ( $term_obj_list as $term ) {
348
-			$term_link = get_term_link( $term );
349
-			$term_name = '<a href="' . $term_link . '">' .$term->name . '<span>, </span></a>';
347
+          foreach ( $term_obj_list as $term ) {
348
+               $term_link = get_term_link( $term );
349
+               $term_name = '<a href="' . $term_link . '">' .$term->name . '<span>, </span></a>';
350 350
 			
351
-			$terms_string .= $term_name;
352
-		}
351
+               $terms_string .= $term_name;
352
+          }
353 353
 		
354
-		foreach ( $terms_ids as $terms_id ) {
355
-			$term_thumbnail_id = get_term_meta( $terms_id, 'thumbnail', true );
356
-			$img               = wp_get_attachment_image_src( $term_thumbnail_id, 'thumbnail' );
357
-			if ( ! empty( $img ) ) {
358
-				$image_url = $img[0];
359
-				$img       = '<img loading="lazy" alt="thumbnail" style="width:24px; height: auto;" class="attachment-responsive wp-post-image lsx-responsive" src="' . esc_url( $image_url ) . '" />';
360
-			}
354
+          foreach ( $terms_ids as $terms_id ) {
355
+               $term_thumbnail_id = get_term_meta( $terms_id, 'thumbnail', true );
356
+               $img               = wp_get_attachment_image_src( $term_thumbnail_id, 'thumbnail' );
357
+               if ( ! empty( $img ) ) {
358
+                    $image_url = $img[0];
359
+                    $img       = '<img loading="lazy" alt="thumbnail" style="width:24px; height: auto;" class="attachment-responsive wp-post-image lsx-responsive" src="' . esc_url( $image_url ) . '" />';
360
+               }
361 361
 
362
-			$plan_meta .= $img;
363
-		}
362
+               $plan_meta .= $img;
363
+          }
364 364
 
365
-		$plan_meta = '<div class="plan-meta">' . $plan_meta . '<span>' . $terms_string . '</span></div>';
366
-	}
365
+          $plan_meta = '<div class="plan-meta">' . $plan_meta . '<span>' . $terms_string . '</span></div>';
366
+     }
367 367
 
368
-	return $plan_meta;
368
+     return $plan_meta;
369 369
 }
370 370
 
371 371
 /**
372 372
  * Limit media library access
373 373
  */
374 374
 function set_only_author( $wp_query ) {
375
-	global $current_user;
376
-	if ( is_admin() && ! current_user_can( 'edit_others_posts' ) ) {
377
-		$wp_query->set( 'administrator', $current_user->ID );
378
-		add_filter( 'views_upload', 'fix_media_counts' );
379
-	}
375
+     global $current_user;
376
+     if ( is_admin() && ! current_user_can( 'edit_others_posts' ) ) {
377
+          $wp_query->set( 'administrator', $current_user->ID );
378
+          add_filter( 'views_upload', 'fix_media_counts' );
379
+     }
380 380
 }
381 381
 add_action( 'pre_get_posts', '\lsx_health_plan\functions\set_only_author' );
382 382
 
@@ -387,12 +387,12 @@  discard block
 block discarded – undo
387 387
  * @return void
388 388
  */
389 389
 function hp_excerpt( $post_id ) {
390
-	if ( ! has_excerpt( $post_id ) ) {
391
-		$content = wp_trim_words( get_post_field( 'post_content', $post_id ), 10 );
392
-	} else {
393
-		$content = get_the_excerpt( $post_id );
394
-	}
395
-	return $content;
390
+     if ( ! has_excerpt( $post_id ) ) {
391
+          $content = wp_trim_words( get_post_field( 'post_content', $post_id ), 10 );
392
+     } else {
393
+          $content = get_the_excerpt( $post_id );
394
+     }
395
+     return $content;
396 396
 }
397 397
 
398 398
 /**
@@ -402,9 +402,9 @@  discard block
 block discarded – undo
402 402
  * @return void
403 403
  */
404 404
 function column_class( $columns = '3' ) {
405
-	$cols  = '';
406
-	$cols .= '5' === $columns ? '15' : 12 / $columns;
407
-	return $cols;
405
+     $cols  = '';
406
+     $cols .= '5' === $columns ? '15' : 12 / $columns;
407
+     return $cols;
408 408
 }
409 409
 
410 410
 /**
@@ -414,22 +414,22 @@  discard block
 block discarded – undo
414 414
  * @return void
415 415
  */
416 416
 function get_exercises_by_workout( $workout = '' ) {
417
-	$exercises = array();
418
-	$i               = 1;
419
-	$section_counter = 6;
420
-	while ( $i <= $section_counter ) {
421
-		$group_name = 'workout_section_' . $i;
422
-		$groups     = get_post_meta( $workout, $group_name, true );
423
-		if ( ! empty( $groups ) ) {
424
-			foreach ( $groups as $group ) {
425
-				if ( isset( $group['connected_exercises'] ) ) {
426
-					$exercises[] = $group['connected_exercises'];
427
-				}
428
-			}
429
-		}
430
-		$i++;
431
-	}
432
-	return $exercises;
417
+     $exercises = array();
418
+     $i               = 1;
419
+     $section_counter = 6;
420
+     while ( $i <= $section_counter ) {
421
+          $group_name = 'workout_section_' . $i;
422
+          $groups     = get_post_meta( $workout, $group_name, true );
423
+          if ( ! empty( $groups ) ) {
424
+               foreach ( $groups as $group ) {
425
+                    if ( isset( $group['connected_exercises'] ) ) {
426
+                         $exercises[] = $group['connected_exercises'];
427
+                    }
428
+               }
429
+          }
430
+          $i++;
431
+     }
432
+     return $exercises;
433 433
 }
434 434
 
435 435
 
@@ -440,20 +440,20 @@  discard block
 block discarded – undo
440 440
  * @return int
441 441
  */
442 442
 function get_progress( $plan_id = false ) {
443
-	$progress = 0;
444
-	$complete = array();
445
-	$count    = 0;
446
-	if ( false !== $plan_id &&  \lsx_health_plan\functions\plan\has_sections( $plan_id ) ) {
447
-		$sections = \lsx_health_plan\functions\plan\get_sections();
448
-		$all_count = count( $sections );
449
-		foreach ( $sections as $section_key => $section_values ) {
450
-			if ( lsx_health_plan_is_day_complete( $plan_id, $section_values['title'] ) ) {
451
-				$complete[] = true;
452
-			}
453
-		}
454
-		$progress = (int) count( $complete ) / (int) $all_count * 100;
455
-	}
456
-	return $progress;
443
+     $progress = 0;
444
+     $complete = array();
445
+     $count    = 0;
446
+     if ( false !== $plan_id &&  \lsx_health_plan\functions\plan\has_sections( $plan_id ) ) {
447
+          $sections = \lsx_health_plan\functions\plan\get_sections();
448
+          $all_count = count( $sections );
449
+          foreach ( $sections as $section_key => $section_values ) {
450
+               if ( lsx_health_plan_is_day_complete( $plan_id, $section_values['title'] ) ) {
451
+                    $complete[] = true;
452
+               }
453
+          }
454
+          $progress = (int) count( $complete ) / (int) $all_count * 100;
455
+     }
456
+     return $progress;
457 457
 }
458 458
 
459 459
 
@@ -464,18 +464,18 @@  discard block
 block discarded – undo
464 464
  * @return void
465 465
  */
466 466
 function hp_back_archive_link() {
467
-	global $wp_taxonomies;
467
+     global $wp_taxonomies;
468 468
 	
469
-	$post_type = get_queried_object()->taxonomy;
470
-	$post_type = $wp_taxonomies[$post_type]->object_type;
469
+     $post_type = get_queried_object()->taxonomy;
470
+     $post_type = $wp_taxonomies[$post_type]->object_type;
471 471
 
472
-	if ( is_tax() ) {
473
-		?>
472
+     if ( is_tax() ) {
473
+          ?>
474 474
 		<div class="archive-category-title hp-archive-category-title">
475 475
 			<a class="back-to-blog" href="<?php echo ( esc_url( get_post_type_archive_link( $post_type[0] ) ) ); ?>"><?php echo esc_html__( 'Back To ', 'lsx' ) . esc_html( $post_type[0] ) . 's'; ?></a>
476 476
 		</div>
477 477
 		<?php
478
-	}
478
+     }
479 479
 }
480 480
 add_action( 'lsx_content_wrap_before', '\lsx_health_plan\functions\hp_back_archive_link', 20 );
481 481
 
@@ -486,11 +486,11 @@  discard block
 block discarded – undo
486 486
  * @return array
487 487
  */
488 488
 function prep_array( $item ) {
489
-	if ( ! is_array( $item ) ) {
490
-		$item = explode( ',', $item );
491
-		if ( ! is_array( $item ) ) {
492
-			$item = array( $item );
493
-		}
494
-	}
495
-	return $item;
489
+     if ( ! is_array( $item ) ) {
490
+          $item = explode( ',', $item );
491
+          if ( ! is_array( $item ) ) {
492
+               $item = array( $item );
493
+          }
494
+     }
495
+     return $item;
496 496
 }
Please login to merge, or discard this patch.
Spacing   +122 added lines, -122 removed lines patch added patch discarded remove patch
@@ -16,24 +16,24 @@  discard block
 block discarded – undo
16 16
  * @param boolean $single
17 17
  * @return boolean
18 18
  */
19
-function has_attached_post( $post_id = '', $meta_key = '', $single = true ) {
19
+function has_attached_post($post_id = '', $meta_key = '', $single = true) {
20 20
 	$has_post = false;
21
-	if ( '' === $post_id ) {
21
+	if ('' === $post_id) {
22 22
 		$post_id = get_the_ID();
23 23
 	}
24
-	$items = get_post_meta( $post_id, $meta_key, $single );
25
-	if ( '' !== $items && false !== $items && 0 !== $items ) {
26
-		if ( ! is_array( $items ) ) {
27
-			$items = array( $items );
24
+	$items = get_post_meta($post_id, $meta_key, $single);
25
+	if ('' !== $items && false !== $items && 0 !== $items) {
26
+		if ( ! is_array($items)) {
27
+			$items = array($items);
28 28
 		}
29
-		$items = check_posts_exist( $items );
30
-		if ( ! empty( $items ) ) {
29
+		$items = check_posts_exist($items);
30
+		if ( ! empty($items)) {
31 31
 			$has_post = true;
32 32
 		}
33 33
 	} else {
34 34
 		// Check for defaults.
35
-		$options = get_option( 'all' );
36
-		if ( isset( $options[ $meta_key ] ) && '' !== $options[ $meta_key ] && ! empty( $options[ $meta_key ] ) ) {
35
+		$options = get_option('all');
36
+		if (isset($options[$meta_key]) && '' !== $options[$meta_key] && ! empty($options[$meta_key])) {
37 37
 			$has_post = true;
38 38
 		}
39 39
 	}
@@ -47,17 +47,17 @@  discard block
 block discarded – undo
47 47
  * @param  mixed  $default Optional default value
48 48
  * @return mixed           Option value
49 49
  */
50
-function get_option( $key = '', $default = false ) {
51
-	if ( function_exists( 'cmb2_get_option' ) ) {
52
-		return cmb2_get_option( 'lsx_health_plan_options', $key, $default );
50
+function get_option($key = '', $default = false) {
51
+	if (function_exists('cmb2_get_option')) {
52
+		return cmb2_get_option('lsx_health_plan_options', $key, $default);
53 53
 	}
54 54
 	// Fallback to get_option if CMB2 is not loaded yet.
55
-	$opts = \get_option( 'lsx_health_plan_options', $default );
55
+	$opts = \get_option('lsx_health_plan_options', $default);
56 56
 	$val  = $default;
57
-	if ( 'all' === $key ) {
57
+	if ('all' === $key) {
58 58
 		$val = $opts;
59
-	} elseif ( is_array( $opts ) && array_key_exists( $key, $opts ) && false !== $opts[ $key ] ) {
60
-		$val = $opts[ $key ];
59
+	} elseif (is_array($opts) && array_key_exists($key, $opts) && false !== $opts[$key]) {
60
+		$val = $opts[$key];
61 61
 	}
62 62
 	return $val;
63 63
 }
@@ -69,54 +69,54 @@  discard block
 block discarded – undo
69 69
  * @param  mixed  $default Optional default value
70 70
  * @return mixed           Option value
71 71
  */
72
-function get_downloads( $type = 'all', $post_id = '' ) {
72
+function get_downloads($type = 'all', $post_id = '') {
73 73
 	$lsx_health_plan = \lsx_health_plan();
74 74
 	$post_types      = $lsx_health_plan->get_post_types();
75
-	if ( '' === $post_id ) {
75
+	if ('' === $post_id) {
76 76
 		$post_id = get_the_ID();
77 77
 	}
78 78
 	$downloads = array();
79
-	$options   = get_option( 'all' );
79
+	$options   = get_option('all');
80 80
 
81
-	foreach ( $post_types as $post_type ) {
82
-		if ( 'all' === $type || in_array( $type, $post_types, true ) ) {
81
+	foreach ($post_types as $post_type) {
82
+		if ('all' === $type || in_array($type, $post_types, true)) {
83 83
 
84 84
 			// Get the default downloads for this post type.
85 85
 			$default_downloads = array();
86 86
 			$new_downloads     = array();
87
-			if ( isset( $options[ 'download_' . $post_type ] ) ) {
88
-				if ( is_array( $options[ 'download_' . $post_type ] ) ) {
89
-					$default_downloads = $options[ 'download_' . $post_type ];
87
+			if (isset($options['download_' . $post_type])) {
88
+				if (is_array($options['download_' . $post_type])) {
89
+					$default_downloads = $options['download_' . $post_type];
90 90
 				} else {
91
-					$default_downloads[] = $options[ 'download_' . $post_type ];
91
+					$default_downloads[] = $options['download_' . $post_type];
92 92
 				}
93 93
 			}
94 94
 
95
-			if ( 'page' === $post_type ) {
95
+			if ('page' === $post_type) {
96 96
 				$key = 'plan_warmup';
97 97
 			} else {
98 98
 				$key = 'connected_' . $post_type . 's';
99 99
 			}
100 100
 
101
-			$connected_items = get_post_meta( $post_id, $key, true );
102
-			if ( ! empty( $connected_items ) ) {
103
-				foreach ( $connected_items as $connected_item ) {
104
-					$current_downloads = get_post_meta( $connected_item, 'connected_downloads', true );
105
-					if ( false !== $current_downloads && ! empty( $current_downloads ) ) {
106
-						$new_downloads = array_merge( $new_downloads, $current_downloads );
101
+			$connected_items = get_post_meta($post_id, $key, true);
102
+			if ( ! empty($connected_items)) {
103
+				foreach ($connected_items as $connected_item) {
104
+					$current_downloads = get_post_meta($connected_item, 'connected_downloads', true);
105
+					if (false !== $current_downloads && ! empty($current_downloads)) {
106
+						$new_downloads = array_merge($new_downloads, $current_downloads);
107 107
 					}
108 108
 				}
109 109
 			}
110 110
 
111
-			if ( ! empty( $new_downloads ) ) {
112
-				$downloads = array_merge( $downloads, $new_downloads );
113
-			} elseif ( ! empty( $default_downloads ) ) {
114
-				$downloads = array_merge( $downloads, $default_downloads );
111
+			if ( ! empty($new_downloads)) {
112
+				$downloads = array_merge($downloads, $new_downloads);
113
+			} elseif ( ! empty($default_downloads)) {
114
+				$downloads = array_merge($downloads, $default_downloads);
115 115
 			}
116
-			$downloads = array_unique( $downloads );
116
+			$downloads = array_unique($downloads);
117 117
 		}
118 118
 	}
119
-	$downloads = check_posts_exist( $downloads );
119
+	$downloads = check_posts_exist($downloads);
120 120
 	return $downloads;
121 121
 }
122 122
 
@@ -126,11 +126,11 @@  discard block
 block discarded – undo
126 126
  * @param  string $week    Week name 'week-1'.
127 127
  * @return array           an array of the downloads or empty.
128 128
  */
129
-function get_weekly_downloads( $week = '' ) {
129
+function get_weekly_downloads($week = '') {
130 130
 	$downloads = array();
131
-	if ( '' !== $week ) {
132
-		$saved_downloads = get_transient( 'lsx_hp_weekly_downloads_' . $week );
133
-		if ( false !== $saved_downloads && ! empty( $saved_downloads ) ) {
131
+	if ('' !== $week) {
132
+		$saved_downloads = get_transient('lsx_hp_weekly_downloads_' . $week);
133
+		if (false !== $saved_downloads && ! empty($saved_downloads)) {
134 134
 			$downloads = $saved_downloads;
135 135
 		} else {
136 136
 			$args = array(
@@ -144,17 +144,17 @@  discard block
 block discarded – undo
144 144
 					array(
145 145
 						'taxonomy' => 'dlm_download_category',
146 146
 						'field'    => 'slug',
147
-						'terms'    => array( $week ),
147
+						'terms'    => array($week),
148 148
 					),
149 149
 				),
150 150
 			);
151
-			$download_query = new \WP_Query( $args );
152
-			if ( $download_query->have_posts() ) {
151
+			$download_query = new \WP_Query($args);
152
+			if ($download_query->have_posts()) {
153 153
 				$downloads = $download_query->posts;
154 154
 			}
155 155
 		}
156 156
 	}
157
-	$downloads = check_posts_exist( $downloads );
157
+	$downloads = check_posts_exist($downloads);
158 158
 	return $downloads;
159 159
 }
160 160
 
@@ -164,20 +164,20 @@  discard block
 block discarded – undo
164 164
  * @param array $post_ids
165 165
  * @return void
166 166
  */
167
-function check_posts_exist( $post_ids = array() ) {
167
+function check_posts_exist($post_ids = array()) {
168 168
 	$new_ids = array();
169 169
 	global $wpdb;
170
-	if ( is_array( $post_ids ) && ! empty( $post_ids ) ) {
171
-		$post_ids = "'" . implode( "','", $post_ids ) . "'";
170
+	if (is_array($post_ids) && ! empty($post_ids)) {
171
+		$post_ids = "'" . implode("','", $post_ids) . "'";
172 172
 		$query    = "
173 173
 			SELECT `ID` 
174 174
 			FROM `{$wpdb->posts}`
175 175
 			WHERE `ID` IN ({$post_ids})
176 176
 			AND `post_status` != 'trash'
177 177
 		";
178
-		$results = $wpdb->get_results( $query ); // WPCS: unprepared SQL
179
-		if ( ! empty( $results ) ) {
180
-			$new_ids = wp_list_pluck( $results, 'ID' );
178
+		$results = $wpdb->get_results($query); // WPCS: unprepared SQL
179
+		if ( ! empty($results)) {
180
+			$new_ids = wp_list_pluck($results, 'ID');
181 181
 		}
182 182
 	}
183 183
 	return $new_ids;
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
  * @param string $body
192 192
  * @return void
193 193
  */
194
-function register_modal( $id = '', $title = '', $body = '' ) {
194
+function register_modal($id = '', $title = '', $body = '') {
195 195
 	lsx_health_plan()->frontend->modals->register_modal(
196 196
 		array(
197 197
 			'title' => $title,
@@ -207,36 +207,36 @@  discard block
 block discarded – undo
207 207
  * @param array $args
208 208
  * @return void
209 209
  */
210
-function output_modal( $args = array() ) {
210
+function output_modal($args = array()) {
211 211
 	$defaults = array(
212 212
 		'id'    => '',
213 213
 		'title' => '',
214 214
 		'body'  => '',
215 215
 	);
216
-	$args     = wp_parse_args( $args, $defaults );
216
+	$args = wp_parse_args($args, $defaults);
217 217
 	?>
218 218
 	<!-- Modal -->
219
-	<div class="modal fade lsx-health-plan-modal" id="<?php echo esc_html( $args['id'] ); ?>" tabindex="-1" role="dialog" aria-labelledby="<?php echo esc_html( $args['id'] ); ?>"  aria-hidden="true">
219
+	<div class="modal fade lsx-health-plan-modal" id="<?php echo esc_html($args['id']); ?>" tabindex="-1" role="dialog" aria-labelledby="<?php echo esc_html($args['id']); ?>"  aria-hidden="true">
220 220
 		<div class="modal-dialog" role="document">
221 221
 			<div class="modal-content">
222 222
 			<button type="button" class="close" data-dismiss="modal">&times;</button>			
223 223
 				<div class="modal-header">
224 224
 					<?php
225
-					if ( '' !== $args['title'] ) {
226
-						echo wp_kses_post( '<h2>' . $args['title'] . '</h2>' );
225
+					if ('' !== $args['title']) {
226
+						echo wp_kses_post('<h2>' . $args['title'] . '</h2>');
227 227
 					}
228 228
 					?>
229 229
 				</div>
230 230
 				<div class="modal-body">
231 231
 				<?php
232
-				if ( '' !== $args['body'] ) {
232
+				if ('' !== $args['body']) {
233 233
 					$allowed_html = array(
234 234
 						'iframe' => array(
235 235
 							'data-src'        => array(),
236 236
 							'src'             => array(),
237 237
 							'width'           => array(),
238 238
 							'height'          => array(),
239
-							'frameBorder'     => array( '0' ),
239
+							'frameBorder'     => array('0'),
240 240
 							'class'           => array(),
241 241
 							'allowFullScreen' => array(),
242 242
 							'style'           => array(),
@@ -245,10 +245,10 @@  discard block
 block discarded – undo
245 245
 							'class' => array(),
246 246
 						),
247 247
 					);
248
-					if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) {
249
-						echo wp_kses_post( $args['body'] );
248
+					if (false !== \lsx_health_plan\functions\get_option('exercise_enabled', false)) {
249
+						echo wp_kses_post($args['body']);
250 250
 					} else {
251
-						echo wp_kses( $args['body'], $allowed_html );
251
+						echo wp_kses($args['body'], $allowed_html);
252 252
 					}
253 253
 				}
254 254
 				?>
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
  * @param [type] $embed
267 267
  * @return void
268 268
  */
269
-function get_video_url( $embed ) {
269
+function get_video_url($embed) {
270 270
 	$url = '';
271
-	if ( false !== stripos( $embed, '<iframe' ) ) {
272
-		preg_match( '/src="([^"]+)"/', $embed, $match );
273
-		if ( is_array( $match ) && isset( $match[1] ) ) {
271
+	if (false !== stripos($embed, '<iframe')) {
272
+		preg_match('/src="([^"]+)"/', $embed, $match);
273
+		if (is_array($match) && isset($match[1])) {
274 274
 			$url = '<iframe data-src="' . $match[1] . '" style="border: 0;" frameBorder="0" class="giphy-embed" allowFullScreen height="300" width="100%"></iframe>';
275 275
 		} else {
276 276
 			$url = $embed;
@@ -288,15 +288,15 @@  discard block
 block discarded – undo
288 288
  * @param array $post_ids
289 289
  * @return boolean
290 290
  */
291
-function is_week_complete( $term_id = false, $section_keys = array(), $group_title = '' ) {
291
+function is_week_complete($term_id = false, $section_keys = array(), $group_title = '') {
292 292
 	$return = false;
293
-	if ( ! empty( $section_keys ) ) {
294
-		$group_count = count( $section_keys );
295
-		foreach ( $section_keys as &$pid ) {
296
-			$pid = 'day_' . \lsx_health_plan\functions\plan\generate_section_id( $pid ) . '_complete';
293
+	if ( ! empty($section_keys)) {
294
+		$group_count = count($section_keys);
295
+		foreach ($section_keys as &$pid) {
296
+			$pid = 'day_' . \lsx_health_plan\functions\plan\generate_section_id($pid) . '_complete';
297 297
 		}
298
-		$days_complete = get_meta_amounts( $section_keys );
299
-		if ( (int) $group_count === (int) $days_complete ) {
298
+		$days_complete = get_meta_amounts($section_keys);
299
+		if ((int) $group_count === (int) $days_complete) {
300 300
 			$return = true;
301 301
 		}
302 302
 	}
@@ -310,20 +310,20 @@  discard block
 block discarded – undo
310 310
  * @param string $key
311 311
  * @return void
312 312
  */
313
-function get_meta_amounts( $post_ids = array() ) {
313
+function get_meta_amounts($post_ids = array()) {
314 314
 	global $wpdb;
315 315
 	$amount       = 0;
316 316
 	$current_user = wp_get_current_user();
317
-	if ( false !== $current_user && ! empty( $post_ids ) ) {
318
-		$post_ids = "'" . implode( "','", $post_ids ) . "'";
317
+	if (false !== $current_user && ! empty($post_ids)) {
318
+		$post_ids = "'" . implode("','", $post_ids) . "'";
319 319
 		$query    = "
320 320
 			SELECT COUNT(`meta_value`) 
321 321
 			FROM `{$wpdb->usermeta}`
322 322
 			WHERE `meta_key` IN ({$post_ids})
323 323
 			AND `user_id` = '{$current_user->ID}'
324 324
 		";
325
-		$results  = $wpdb->get_var( $query ); // WPCS: unprepared SQL
326
-		if ( ! empty( $results ) ) {
325
+		$results = $wpdb->get_var($query); // WPCS: unprepared SQL
326
+		if ( ! empty($results)) {
327 327
 			$amount = $results;
328 328
 		}
329 329
 	}
@@ -336,27 +336,27 @@  discard block
 block discarded – undo
336 336
  * @param [type] $post
337 337
  * @return void
338 338
  */
339
-function hp_get_plan_type_meta( $post ) {
339
+function hp_get_plan_type_meta($post) {
340 340
 	$plan_meta = '';
341 341
 
342
-	$term_obj_list = get_the_terms( $post->ID, 'plan-type' );
343
-	if ( false !== $term_obj_list ) {
342
+	$term_obj_list = get_the_terms($post->ID, 'plan-type');
343
+	if (false !== $term_obj_list) {
344 344
 		$terms_string = '';
345
-		$terms_ids    = wp_list_pluck( $term_obj_list, 'term_id' );
345
+		$terms_ids    = wp_list_pluck($term_obj_list, 'term_id');
346 346
 		
347
-		foreach ( $term_obj_list as $term ) {
348
-			$term_link = get_term_link( $term );
349
-			$term_name = '<a href="' . $term_link . '">' .$term->name . '<span>, </span></a>';
347
+		foreach ($term_obj_list as $term) {
348
+			$term_link = get_term_link($term);
349
+			$term_name = '<a href="' . $term_link . '">' . $term->name . '<span>, </span></a>';
350 350
 			
351 351
 			$terms_string .= $term_name;
352 352
 		}
353 353
 		
354
-		foreach ( $terms_ids as $terms_id ) {
355
-			$term_thumbnail_id = get_term_meta( $terms_id, 'thumbnail', true );
356
-			$img               = wp_get_attachment_image_src( $term_thumbnail_id, 'thumbnail' );
357
-			if ( ! empty( $img ) ) {
354
+		foreach ($terms_ids as $terms_id) {
355
+			$term_thumbnail_id = get_term_meta($terms_id, 'thumbnail', true);
356
+			$img               = wp_get_attachment_image_src($term_thumbnail_id, 'thumbnail');
357
+			if ( ! empty($img)) {
358 358
 				$image_url = $img[0];
359
-				$img       = '<img loading="lazy" alt="thumbnail" style="width:24px; height: auto;" class="attachment-responsive wp-post-image lsx-responsive" src="' . esc_url( $image_url ) . '" />';
359
+				$img       = '<img loading="lazy" alt="thumbnail" style="width:24px; height: auto;" class="attachment-responsive wp-post-image lsx-responsive" src="' . esc_url($image_url) . '" />';
360 360
 			}
361 361
 
362 362
 			$plan_meta .= $img;
@@ -371,14 +371,14 @@  discard block
 block discarded – undo
371 371
 /**
372 372
  * Limit media library access
373 373
  */
374
-function set_only_author( $wp_query ) {
374
+function set_only_author($wp_query) {
375 375
 	global $current_user;
376
-	if ( is_admin() && ! current_user_can( 'edit_others_posts' ) ) {
377
-		$wp_query->set( 'administrator', $current_user->ID );
378
-		add_filter( 'views_upload', 'fix_media_counts' );
376
+	if (is_admin() && ! current_user_can('edit_others_posts')) {
377
+		$wp_query->set('administrator', $current_user->ID);
378
+		add_filter('views_upload', 'fix_media_counts');
379 379
 	}
380 380
 }
381
-add_action( 'pre_get_posts', '\lsx_health_plan\functions\set_only_author' );
381
+add_action('pre_get_posts', '\lsx_health_plan\functions\set_only_author');
382 382
 
383 383
 /**
384 384
  * Outputs an excerpt even if there is not excerpt.
@@ -386,11 +386,11 @@  discard block
 block discarded – undo
386 386
  * @param [type] $post_id
387 387
  * @return void
388 388
  */
389
-function hp_excerpt( $post_id ) {
390
-	if ( ! has_excerpt( $post_id ) ) {
391
-		$content = wp_trim_words( get_post_field( 'post_content', $post_id ), 10 );
389
+function hp_excerpt($post_id) {
390
+	if ( ! has_excerpt($post_id)) {
391
+		$content = wp_trim_words(get_post_field('post_content', $post_id), 10);
392 392
 	} else {
393
-		$content = get_the_excerpt( $post_id );
393
+		$content = get_the_excerpt($post_id);
394 394
 	}
395 395
 	return $content;
396 396
 }
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
  * @param string $columns
402 402
  * @return void
403 403
  */
404
-function column_class( $columns = '3' ) {
404
+function column_class($columns = '3') {
405 405
 	$cols  = '';
406 406
 	$cols .= '5' === $columns ? '15' : 12 / $columns;
407 407
 	return $cols;
@@ -413,16 +413,16 @@  discard block
 block discarded – undo
413 413
  * @param string $workout
414 414
  * @return void
415 415
  */
416
-function get_exercises_by_workout( $workout = '' ) {
416
+function get_exercises_by_workout($workout = '') {
417 417
 	$exercises = array();
418 418
 	$i               = 1;
419 419
 	$section_counter = 6;
420
-	while ( $i <= $section_counter ) {
420
+	while ($i <= $section_counter) {
421 421
 		$group_name = 'workout_section_' . $i;
422
-		$groups     = get_post_meta( $workout, $group_name, true );
423
-		if ( ! empty( $groups ) ) {
424
-			foreach ( $groups as $group ) {
425
-				if ( isset( $group['connected_exercises'] ) ) {
422
+		$groups     = get_post_meta($workout, $group_name, true);
423
+		if ( ! empty($groups)) {
424
+			foreach ($groups as $group) {
425
+				if (isset($group['connected_exercises'])) {
426 426
 					$exercises[] = $group['connected_exercises'];
427 427
 				}
428 428
 			}
@@ -439,19 +439,19 @@  discard block
 block discarded – undo
439 439
  * @param  int $plan_id
440 440
  * @return int
441 441
  */
442
-function get_progress( $plan_id = false ) {
442
+function get_progress($plan_id = false) {
443 443
 	$progress = 0;
444 444
 	$complete = array();
445 445
 	$count    = 0;
446
-	if ( false !== $plan_id &&  \lsx_health_plan\functions\plan\has_sections( $plan_id ) ) {
446
+	if (false !== $plan_id && \lsx_health_plan\functions\plan\has_sections($plan_id)) {
447 447
 		$sections = \lsx_health_plan\functions\plan\get_sections();
448
-		$all_count = count( $sections );
449
-		foreach ( $sections as $section_key => $section_values ) {
450
-			if ( lsx_health_plan_is_day_complete( $plan_id, $section_values['title'] ) ) {
448
+		$all_count = count($sections);
449
+		foreach ($sections as $section_key => $section_values) {
450
+			if (lsx_health_plan_is_day_complete($plan_id, $section_values['title'])) {
451 451
 				$complete[] = true;
452 452
 			}
453 453
 		}
454
-		$progress = (int) count( $complete ) / (int) $all_count * 100;
454
+		$progress = (int) count($complete) / (int) $all_count * 100;
455 455
 	}
456 456
 	return $progress;
457 457
 }
@@ -469,15 +469,15 @@  discard block
 block discarded – undo
469 469
 	$post_type = get_queried_object()->taxonomy;
470 470
 	$post_type = $wp_taxonomies[$post_type]->object_type;
471 471
 
472
-	if ( is_tax() ) {
472
+	if (is_tax()) {
473 473
 		?>
474 474
 		<div class="archive-category-title hp-archive-category-title">
475
-			<a class="back-to-blog" href="<?php echo ( esc_url( get_post_type_archive_link( $post_type[0] ) ) ); ?>"><?php echo esc_html__( 'Back To ', 'lsx' ) . esc_html( $post_type[0] ) . 's'; ?></a>
475
+			<a class="back-to-blog" href="<?php echo (esc_url(get_post_type_archive_link($post_type[0]))); ?>"><?php echo esc_html__('Back To ', 'lsx') . esc_html($post_type[0]) . 's'; ?></a>
476 476
 		</div>
477 477
 		<?php
478 478
 	}
479 479
 }
480
-add_action( 'lsx_content_wrap_before', '\lsx_health_plan\functions\hp_back_archive_link', 20 );
480
+add_action('lsx_content_wrap_before', '\lsx_health_plan\functions\hp_back_archive_link', 20);
481 481
 
482 482
 /**
483 483
  * Returns an array.
@@ -485,11 +485,11 @@  discard block
 block discarded – undo
485 485
  * @param  mixed $item
486 486
  * @return array
487 487
  */
488
-function prep_array( $item ) {
489
-	if ( ! is_array( $item ) ) {
490
-		$item = explode( ',', $item );
491
-		if ( ! is_array( $item ) ) {
492
-			$item = array( $item );
488
+function prep_array($item) {
489
+	if ( ! is_array($item)) {
490
+		$item = explode(',', $item);
491
+		if ( ! is_array($item)) {
492
+			$item = array($item);
493 493
 		}
494 494
 	}
495 495
 	return $item;
Please login to merge, or discard this patch.
templates/tab-content-warm-up.php 2 patches
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@  discard block
 block discarded – undo
8 8
 
9 9
 $warm_up = get_post_meta( get_the_ID(), 'plan_warmup', true );
10 10
 if ( false === $warm_up || '' === $warm_up ) {
11
-	$options = \lsx_health_plan\functions\get_option( 'all' );
12
-	if ( isset( $options['plan_warmup'] ) && '' !== $options['plan_warmup'] && ! empty( $options['plan_warmup'] ) ) {
13
-		$warm_up = $options['plan_warmup'];
14
-	}
11
+     $options = \lsx_health_plan\functions\get_option( 'all' );
12
+     if ( isset( $options['plan_warmup'] ) && '' !== $options['plan_warmup'] && ! empty( $options['plan_warmup'] ) ) {
13
+          $warm_up = $options['plan_warmup'];
14
+     }
15 15
 }
16 16
 
17 17
 ?>
@@ -19,25 +19,25 @@  discard block
 block discarded – undo
19 19
 <?php
20 20
 
21 21
 if ( false !== $warm_up && '' !== $warm_up ) {
22
-	if ( ! is_array( $warm_up ) ) {
23
-		$warm_up = array( $warm_up );
24
-	}
22
+     if ( ! is_array( $warm_up ) ) {
23
+          $warm_up = array( $warm_up );
24
+     }
25 25
 
26
-	$warmup_type  = array( 'page', 'workout', 'exercise' );
27
-	$warmup_query = new WP_Query(
28
-		array(
29
-			'post__in'  => $warm_up,
30
-			'post_type' => $warmup_type,
31
-		)
32
-	);
26
+     $warmup_type  = array( 'page', 'workout', 'exercise' );
27
+     $warmup_query = new WP_Query(
28
+          array(
29
+               'post__in'  => $warm_up,
30
+               'post_type' => $warmup_type,
31
+          )
32
+     );
33 33
 
34
-	if ( $warmup_query->have_posts() ) {
35
-		while ( $warmup_query->have_posts() ) {
36
-			$warmup_query->the_post();
37
-			lsx_entry_before();
38
-			if ( 'workout' === get_post_type() ) {
39
-				$connected_workouts = array( get_the_ID() );
40
-				?>
34
+     if ( $warmup_query->have_posts() ) {
35
+          while ( $warmup_query->have_posts() ) {
36
+               $warmup_query->the_post();
37
+               lsx_entry_before();
38
+               if ( 'workout' === get_post_type() ) {
39
+                    $connected_workouts = array( get_the_ID() );
40
+                    ?>
41 41
 				<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
42 42
 					<?php lsx_entry_top(); ?>
43 43
 					<div class="entry-content">
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
 					<?php lsx_entry_bottom(); ?>
52 52
 				</article><!-- #post-## -->
53 53
 				<?php
54
-				lsx_health_plan_warmup_sets( $connected_workouts );
55
-			} else {
56
-				?>
54
+                    lsx_health_plan_warmup_sets( $connected_workouts );
55
+               } else {
56
+                    ?>
57 57
 				<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
58 58
 					<?php lsx_entry_top(); ?>
59 59
 					<div class="entry-content">
@@ -63,24 +63,24 @@  discard block
 block discarded – undo
63 63
 								<h2><?php esc_html_e( 'Warm Up', 'lsx-health-plan' ); ?></h2>
64 64
 							</div>
65 65
 						<?php
66
-							the_content();
67
-							wp_link_pages( array(
68
-								'before'      => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">',
69
-								'after'       => '</div></div>',
70
-								'link_before' => '<span>',
71
-								'link_after'  => '</span>',
72
-							) );
73
-						?>
66
+                                   the_content();
67
+                                   wp_link_pages( array(
68
+                                        'before'      => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">',
69
+                                        'after'       => '</div></div>',
70
+                                        'link_before' => '<span>',
71
+                                        'link_after'  => '</span>',
72
+                                   ) );
73
+                              ?>
74 74
 						</div>
75 75
 					</div><!-- .entry-content -->
76 76
 					<?php lsx_entry_bottom(); ?>
77 77
 				</article><!-- #post-## -->
78 78
 				<?php
79
-			}
79
+               }
80 80
 
81
-		}
82
-		wp_reset_postdata();
83
-	}
81
+          }
82
+          wp_reset_postdata();
83
+     }
84 84
 }
85 85
 ?>
86 86
 </div>
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -6,10 +6,10 @@  discard block
 block discarded – undo
6 6
  */
7 7
 global $group_name, $connected_workouts, $shortcode_args;
8 8
 
9
-$warm_up = get_post_meta( get_the_ID(), 'plan_warmup', true );
10
-if ( false === $warm_up || '' === $warm_up ) {
11
-	$options = \lsx_health_plan\functions\get_option( 'all' );
12
-	if ( isset( $options['plan_warmup'] ) && '' !== $options['plan_warmup'] && ! empty( $options['plan_warmup'] ) ) {
9
+$warm_up = get_post_meta(get_the_ID(), 'plan_warmup', true);
10
+if (false === $warm_up || '' === $warm_up) {
11
+	$options = \lsx_health_plan\functions\get_option('all');
12
+	if (isset($options['plan_warmup']) && '' !== $options['plan_warmup'] && ! empty($options['plan_warmup'])) {
13 13
 		$warm_up = $options['plan_warmup'];
14 14
 	}
15 15
 }
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
 <div class="warmup-container">
19 19
 <?php
20 20
 
21
-if ( false !== $warm_up && '' !== $warm_up ) {
22
-	if ( ! is_array( $warm_up ) ) {
23
-		$warm_up = array( $warm_up );
21
+if (false !== $warm_up && '' !== $warm_up) {
22
+	if ( ! is_array($warm_up)) {
23
+		$warm_up = array($warm_up);
24 24
 	}
25 25
 
26
-	$warmup_type  = array( 'page', 'workout', 'exercise' );
26
+	$warmup_type  = array('page', 'workout', 'exercise');
27 27
 	$warmup_query = new WP_Query(
28 28
 		array(
29 29
 			'post__in'  => $warm_up,
@@ -31,27 +31,27 @@  discard block
 block discarded – undo
31 31
 		)
32 32
 	);
33 33
 
34
-	if ( $warmup_query->have_posts() ) {
35
-		while ( $warmup_query->have_posts() ) {
34
+	if ($warmup_query->have_posts()) {
35
+		while ($warmup_query->have_posts()) {
36 36
 			$warmup_query->the_post();
37 37
 			lsx_entry_before();
38
-			if ( 'workout' === get_post_type() ) {
39
-				$connected_workouts = array( get_the_ID() );
38
+			if ('workout' === get_post_type()) {
39
+				$connected_workouts = array(get_the_ID());
40 40
 				?>
41 41
 				<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
42 42
 					<?php lsx_entry_top(); ?>
43 43
 					<div class="entry-content">
44 44
 						<div class="single-plan-inner warmup-content">
45 45
 							<div class="single-plan-section-title warmup-plan title-lined">
46
-								<?php lsx_get_svg_icon( 'warm.svg' ); ?>
47
-								<h2><?php esc_html_e( 'Warm Up', 'lsx-health-plan' ); ?></h2>
46
+								<?php lsx_get_svg_icon('warm.svg'); ?>
47
+								<h2><?php esc_html_e('Warm Up', 'lsx-health-plan'); ?></h2>
48 48
 							</div>
49 49
 						</div>
50 50
 					</div><!-- .entry-content -->
51 51
 					<?php lsx_entry_bottom(); ?>
52 52
 				</article><!-- #post-## -->
53 53
 				<?php
54
-				lsx_health_plan_warmup_sets( $connected_workouts );
54
+				lsx_health_plan_warmup_sets($connected_workouts);
55 55
 			} else {
56 56
 				?>
57 57
 				<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
@@ -59,17 +59,17 @@  discard block
 block discarded – undo
59 59
 					<div class="entry-content">
60 60
 						<div class="single-plan-inner warmup-content">
61 61
 							<div class="single-plan-section-title warmup-plan title-lined">
62
-								<?php lsx_get_svg_icon( 'warm.svg' ); ?>
63
-								<h2><?php esc_html_e( 'Warm Up', 'lsx-health-plan' ); ?></h2>
62
+								<?php lsx_get_svg_icon('warm.svg'); ?>
63
+								<h2><?php esc_html_e('Warm Up', 'lsx-health-plan'); ?></h2>
64 64
 							</div>
65 65
 						<?php
66 66
 							the_content();
67
-							wp_link_pages( array(
67
+							wp_link_pages(array(
68 68
 								'before'      => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">',
69 69
 								'after'       => '</div></div>',
70 70
 								'link_before' => '<span>',
71 71
 								'link_after'  => '</span>',
72
-							) );
72
+							));
73 73
 						?>
74 74
 						</div>
75 75
 					</div><!-- .entry-content -->
Please login to merge, or discard this patch.
templates/single-plan-tabs.php 2 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -8,14 +8,14 @@  discard block
 block discarded – undo
8 8
 $plan_link       = get_permalink();
9 9
 $current_section = get_query_var( 'section', false );
10 10
 if ( '' !== $current_section ) {
11
-	$plan_link = \lsx_health_plan\functions\plan\get_permalink( get_the_ID(), $current_section );
11
+     $plan_link = \lsx_health_plan\functions\plan\get_permalink( get_the_ID(), $current_section );
12 12
 }
13 13
 
14 14
 if ( false !== $current_section && \lsx_health_plan\functions\plan\has_sections() ) {
15
-	$section_info = \lsx_health_plan\functions\plan\get_section_info( $current_section );
16
-	if ( empty( $section_info ) || ( isset( $section_info['rest_day_enabled'] ) && ! empty( $section_info['rest_day_enabled'] ) && ! lsx_health_plan_has_meal() ) ) {
17
-		return;
18
-	}
15
+     $section_info = \lsx_health_plan\functions\plan\get_section_info( $current_section );
16
+     if ( empty( $section_info ) || ( isset( $section_info['rest_day_enabled'] ) && ! empty( $section_info['rest_day_enabled'] ) && ! lsx_health_plan_has_meal() ) ) {
17
+          return;
18
+     }
19 19
 }
20 20
 
21 21
 ?>
@@ -23,33 +23,33 @@  discard block
 block discarded – undo
23 23
 	<ul class="nav nav-pills">
24 24
 		<li class="<?php lsx_health_plan_nav_class( '' ); ?>"><a class="overview-tab" href="<?php echo esc_attr( $plan_link ); ?>"><?php lsx_get_svg_icon( 'eye.svg' ); ?> <?php esc_html_e( 'Overview', 'lsx-health-plan' ); ?></a></li>
25 25
 		<?php
26
-		if ( lsx_health_plan_has_warmup() ) {
27
-			$warm_up = \lsx_health_plan\functions\get_option( 'endpoint_warm_up', false );
28
-			if ( false === $warm_up ) {
29
-				$warm_up = 'warm-up';
30
-			}
31
-			?>
26
+          if ( lsx_health_plan_has_warmup() ) {
27
+               $warm_up = \lsx_health_plan\functions\get_option( 'endpoint_warm_up', false );
28
+               if ( false === $warm_up ) {
29
+                    $warm_up = 'warm-up';
30
+               }
31
+               ?>
32 32
 				<li class="<?php lsx_health_plan_nav_class( 'warm-up' ); ?>"><a class="warm-up-tab" href="<?php echo esc_attr( $plan_link ); ?><?php echo esc_attr( $warm_up ); ?>/"><?php lsx_get_svg_icon( 'warm.svg' ); ?> <?php esc_html_e( 'Warm-up', 'lsx-health-plan' ); ?></a></li>				
33 33
 			<?php
34
-		}
35
-		if ( lsx_health_plan_has_workout() ) {
36
-			$workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', false );
37
-			if ( false === $workout ) {
38
-				$workout = 'workout';
39
-			}
40
-			?>
34
+          }
35
+          if ( lsx_health_plan_has_workout() ) {
36
+               $workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', false );
37
+               if ( false === $workout ) {
38
+                    $workout = 'workout';
39
+               }
40
+               ?>
41 41
 				<li class="<?php lsx_health_plan_nav_class( 'workout' ); ?>"><a class="workout-tab" href="<?php echo esc_attr( $plan_link ); ?><?php echo esc_attr( $workout ); ?>/"><?php lsx_get_svg_icon( 'work.svg' ); ?> <?php esc_html_e( 'Workout', 'lsx-health-plan' ); ?></a></li>
42 42
 			<?php
43
-		}
44
-		if ( lsx_health_plan_has_meal() ) {
45
-			$meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', false );
46
-			if ( false === $meal ) {
47
-				$meal = 'meal';
48
-			}
49
-			?>
43
+          }
44
+          if ( lsx_health_plan_has_meal() ) {
45
+               $meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', false );
46
+               if ( false === $meal ) {
47
+                    $meal = 'meal';
48
+               }
49
+               ?>
50 50
 				<li class="<?php lsx_health_plan_nav_class( 'meal' ); ?>"><a class="meal-plan-tab" href="<?php echo esc_attr( $plan_link ); ?><?php echo esc_attr( $meal ); ?>/"><?php lsx_get_svg_icon( 'meal.svg' ); ?> <?php esc_html_e( 'Meal Plan', 'lsx-health-plan' ); ?></a></li>
51 51
 			<?php
52
-		}
53
-		?>
52
+          }
53
+          ?>
54 54
 	</ul>
55 55
 </div>
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -6,14 +6,14 @@  discard block
 block discarded – undo
6 6
 */
7 7
 
8 8
 $plan_link       = get_permalink();
9
-$current_section = get_query_var( 'section', false );
10
-if ( '' !== $current_section ) {
11
-	$plan_link = \lsx_health_plan\functions\plan\get_permalink( get_the_ID(), $current_section );
9
+$current_section = get_query_var('section', false);
10
+if ('' !== $current_section) {
11
+	$plan_link = \lsx_health_plan\functions\plan\get_permalink(get_the_ID(), $current_section);
12 12
 }
13 13
 
14
-if ( false !== $current_section && \lsx_health_plan\functions\plan\has_sections() ) {
15
-	$section_info = \lsx_health_plan\functions\plan\get_section_info( $current_section );
16
-	if ( empty( $section_info ) || ( isset( $section_info['rest_day_enabled'] ) && ! empty( $section_info['rest_day_enabled'] ) && ! lsx_health_plan_has_meal() ) ) {
14
+if (false !== $current_section && \lsx_health_plan\functions\plan\has_sections()) {
15
+	$section_info = \lsx_health_plan\functions\plan\get_section_info($current_section);
16
+	if (empty($section_info) || (isset($section_info['rest_day_enabled']) && ! empty($section_info['rest_day_enabled']) && ! lsx_health_plan_has_meal())) {
17 17
 		return;
18 18
 	}
19 19
 }
@@ -21,33 +21,33 @@  discard block
 block discarded – undo
21 21
 ?>
22 22
 <div id="single-plan-nav">
23 23
 	<ul class="nav nav-pills">
24
-		<li class="<?php lsx_health_plan_nav_class( '' ); ?>"><a class="overview-tab" href="<?php echo esc_attr( $plan_link ); ?>"><?php lsx_get_svg_icon( 'eye.svg' ); ?> <?php esc_html_e( 'Overview', 'lsx-health-plan' ); ?></a></li>
24
+		<li class="<?php lsx_health_plan_nav_class(''); ?>"><a class="overview-tab" href="<?php echo esc_attr($plan_link); ?>"><?php lsx_get_svg_icon('eye.svg'); ?> <?php esc_html_e('Overview', 'lsx-health-plan'); ?></a></li>
25 25
 		<?php
26
-		if ( lsx_health_plan_has_warmup() ) {
27
-			$warm_up = \lsx_health_plan\functions\get_option( 'endpoint_warm_up', false );
28
-			if ( false === $warm_up ) {
26
+		if (lsx_health_plan_has_warmup()) {
27
+			$warm_up = \lsx_health_plan\functions\get_option('endpoint_warm_up', false);
28
+			if (false === $warm_up) {
29 29
 				$warm_up = 'warm-up';
30 30
 			}
31 31
 			?>
32
-				<li class="<?php lsx_health_plan_nav_class( 'warm-up' ); ?>"><a class="warm-up-tab" href="<?php echo esc_attr( $plan_link ); ?><?php echo esc_attr( $warm_up ); ?>/"><?php lsx_get_svg_icon( 'warm.svg' ); ?> <?php esc_html_e( 'Warm-up', 'lsx-health-plan' ); ?></a></li>				
32
+				<li class="<?php lsx_health_plan_nav_class('warm-up'); ?>"><a class="warm-up-tab" href="<?php echo esc_attr($plan_link); ?><?php echo esc_attr($warm_up); ?>/"><?php lsx_get_svg_icon('warm.svg'); ?> <?php esc_html_e('Warm-up', 'lsx-health-plan'); ?></a></li>				
33 33
 			<?php
34 34
 		}
35
-		if ( lsx_health_plan_has_workout() ) {
36
-			$workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', false );
37
-			if ( false === $workout ) {
35
+		if (lsx_health_plan_has_workout()) {
36
+			$workout = \lsx_health_plan\functions\get_option('endpoint_workout', false);
37
+			if (false === $workout) {
38 38
 				$workout = 'workout';
39 39
 			}
40 40
 			?>
41
-				<li class="<?php lsx_health_plan_nav_class( 'workout' ); ?>"><a class="workout-tab" href="<?php echo esc_attr( $plan_link ); ?><?php echo esc_attr( $workout ); ?>/"><?php lsx_get_svg_icon( 'work.svg' ); ?> <?php esc_html_e( 'Workout', 'lsx-health-plan' ); ?></a></li>
41
+				<li class="<?php lsx_health_plan_nav_class('workout'); ?>"><a class="workout-tab" href="<?php echo esc_attr($plan_link); ?><?php echo esc_attr($workout); ?>/"><?php lsx_get_svg_icon('work.svg'); ?> <?php esc_html_e('Workout', 'lsx-health-plan'); ?></a></li>
42 42
 			<?php
43 43
 		}
44
-		if ( lsx_health_plan_has_meal() ) {
45
-			$meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', false );
46
-			if ( false === $meal ) {
44
+		if (lsx_health_plan_has_meal()) {
45
+			$meal = \lsx_health_plan\functions\get_option('endpoint_meal', false);
46
+			if (false === $meal) {
47 47
 				$meal = 'meal';
48 48
 			}
49 49
 			?>
50
-				<li class="<?php lsx_health_plan_nav_class( 'meal' ); ?>"><a class="meal-plan-tab" href="<?php echo esc_attr( $plan_link ); ?><?php echo esc_attr( $meal ); ?>/"><?php lsx_get_svg_icon( 'meal.svg' ); ?> <?php esc_html_e( 'Meal Plan', 'lsx-health-plan' ); ?></a></li>
50
+				<li class="<?php lsx_health_plan_nav_class('meal'); ?>"><a class="meal-plan-tab" href="<?php echo esc_attr($plan_link); ?><?php echo esc_attr($meal); ?>/"><?php lsx_get_svg_icon('meal.svg'); ?> <?php esc_html_e('Meal Plan', 'lsx-health-plan'); ?></a></li>
51 51
 			<?php
52 52
 		}
53 53
 		?>
Please login to merge, or discard this patch.