Passed
Push — master ( 28e31b...62acb0 )
by Warwick
04:33
created
includes/template-tags.php 1 patch
Indentation   +642 added lines, -642 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,34 +161,34 @@  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
-			if ( is_user_logged_in() ) {
187
-				?>
185
+               }
186
+               if ( is_user_logged_in() ) {
187
+                    ?>
188 188
 					<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>
189 189
 				<?php
190
-			}
191
-			?>
190
+               }
191
+               ?>
192 192
 		</ul>
193 193
 	</div>
194 194
 	<?php
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
  * @return void
201 201
  */
202 202
 function lsx_health_plan_my_profile_box() {
203
-	?>
203
+     ?>
204 204
 	<div class="lsx-health-plan my-profile-block wp-block-cover alignfull">
205 205
 		<div class="wp-block-cover__inner-container">
206 206
 			<h2><?php esc_html_e( 'My Dashboard', 'lsx-health-plan' ); ?></h2>
@@ -210,14 +210,14 @@  discard block
 block discarded – undo
210 210
 						<div class="profile-navigation">
211 211
 							<div class="profile-photo">
212 212
 							<?php
213
-								global $current_user;
214
-								if ( function_exists( 'WC' ) ) {
215
-									get_current_user();
216
-								}
217
-								if ( class_exists( 'WP_User_Avatar_Setup' ) ) {
218
-									echo get_avatar( $current_user->ID, 240 );
219
-								}
220
-								?>
213
+                                        global $current_user;
214
+                                        if ( function_exists( 'WC' ) ) {
215
+                                             get_current_user();
216
+                                        }
217
+                                        if ( class_exists( 'WP_User_Avatar_Setup' ) ) {
218
+                                             echo get_avatar( $current_user->ID, 240 );
219
+                                        }
220
+                                        ?>
221 221
 							</div>
222 222
 						</div>
223 223
 					<?php } ?>
@@ -225,88 +225,88 @@  discard block
 block discarded – undo
225 225
 						<div class="profile-details">
226 226
 							<h1 class="title-lined has-text-color"><?php echo esc_html( $current_user->display_name ); ?></h1>
227 227
 							<?php
228
-							$disable_stats = \lsx_health_plan\functions\get_option( 'disable_all_stats', false );
229
-							if ( 'on' !== $disable_stats && function_exists( 'WC' ) ) {
228
+                                   $disable_stats = \lsx_health_plan\functions\get_option( 'disable_all_stats', false );
229
+                                   if ( 'on' !== $disable_stats && function_exists( 'WC' ) ) {
230 230
 
231
-								$is_weight_disabled = \lsx_health_plan\functions\get_option( 'disable_weight_checkbox', false );
232
-								$is_height_disabled = \lsx_health_plan\functions\get_option( 'disable_height_checkbox', false );
233
-								$is_waist_disabled  = \lsx_health_plan\functions\get_option( 'disable_waist_checkbox', false );
234
-								$is_bmi_disabled    = \lsx_health_plan\functions\get_option( 'disable_bmi_checkbox', false );
231
+                                        $is_weight_disabled = \lsx_health_plan\functions\get_option( 'disable_weight_checkbox', false );
232
+                                        $is_height_disabled = \lsx_health_plan\functions\get_option( 'disable_height_checkbox', false );
233
+                                        $is_waist_disabled  = \lsx_health_plan\functions\get_option( 'disable_waist_checkbox', false );
234
+                                        $is_bmi_disabled    = \lsx_health_plan\functions\get_option( 'disable_bmi_checkbox', false );
235 235
 
236
-								$weight = get_user_meta( get_current_user_id(), 'weight', true );
237
-								$waist  = get_user_meta( get_current_user_id(), 'waist', true );
238
-								$height = get_user_meta( get_current_user_id(), 'height', true );
236
+                                        $weight = get_user_meta( get_current_user_id(), 'weight', true );
237
+                                        $waist  = get_user_meta( get_current_user_id(), 'waist', true );
238
+                                        $height = get_user_meta( get_current_user_id(), 'height', true );
239 239
 
240
-								$height_m = 0;
241
-								if ( is_numeric( $height ) ) {
242
-									$height_m = $height / 100;
243
-								}
240
+                                        $height_m = 0;
241
+                                        if ( is_numeric( $height ) ) {
242
+                                             $height_m = $height / 100;
243
+                                        }
244 244
 
245
-								if ( 1 < $weight && 1 < $height_m ) {
246
-									$bmi = $weight / ( $height_m * $height_m );
247
-									$bmi = number_format( $bmi, 1 );
248
-								} else {
249
-									$bmi = __( 'Add more data', 'lsx-health-plan' );
250
-								}
245
+                                        if ( 1 < $weight && 1 < $height_m ) {
246
+                                             $bmi = $weight / ( $height_m * $height_m );
247
+                                             $bmi = number_format( $bmi, 1 );
248
+                                        } else {
249
+                                             $bmi = __( 'Add more data', 'lsx-health-plan' );
250
+                                        }
251 251
 
252
-								?>
252
+                                        ?>
253 253
 
254 254
 								<div>
255 255
 									<?php if ( 'on' !== $is_weight_disabled ) { ?>
256 256
 										<span><strong><?php esc_html_e( 'Weight:', 'lsx-health-plan' ); ?></strong>
257 257
 										<?php
258
-										if ( '' !== $weight ) {
259
-											echo wp_kses_post( $weight . ' kg' );
260
-										} else {
261
-											echo '/';
262
-										}
263
-										?>
258
+                                                  if ( '' !== $weight ) {
259
+                                                       echo wp_kses_post( $weight . ' kg' );
260
+                                                  } else {
261
+                                                       echo '/';
262
+                                                  }
263
+                                                  ?>
264 264
 										</span>
265 265
 									<?php }
266
-									if ( 'on' !== $is_waist_disabled ) {
267
-										?>
266
+                                             if ( 'on' !== $is_waist_disabled ) {
267
+                                                  ?>
268 268
 										<span><strong><?php esc_html_e( 'Waist:', 'lsx-health-plan' ); ?></strong>
269 269
 										<?php
270
-										if ( '' !== $waist ) {
271
-											echo wp_kses_post( $waist . ' cm' );
272
-										} else {
273
-											echo '/';
274
-										}
275
-										?>
270
+                                                  if ( '' !== $waist ) {
271
+                                                       echo wp_kses_post( $waist . ' cm' );
272
+                                                  } else {
273
+                                                       echo '/';
274
+                                                  }
275
+                                                  ?>
276 276
 										</span>
277 277
 									<?php }
278
-									if ( 'on' !== $is_bmi_disabled ) {
279
-										?>
278
+                                             if ( 'on' !== $is_bmi_disabled ) {
279
+                                                  ?>
280 280
 										<span><strong><?php esc_html_e( 'BMI:', 'lsx-health-plan' ); ?></strong>
281 281
 										<?php
282
-										if ( '' !== $bmi ) {
283
-											echo wp_kses_post( $bmi );
284
-										} else {
285
-											echo '/';
286
-										}
287
-										?>
282
+                                                  if ( '' !== $bmi ) {
283
+                                                       echo wp_kses_post( $bmi );
284
+                                                  } else {
285
+                                                       echo '/';
286
+                                                  }
287
+                                                  ?>
288 288
 										</span>
289 289
 									<?php } ?>
290 290
 								</div>
291 291
 							<?php
292
-							}
292
+                                   }
293 293
 
294
-							// Only display the edit account link if woocommerce is active.
295
-							if ( function_exists( 'WC' ) ) {
296
-								?>
294
+                                   // Only display the edit account link if woocommerce is active.
295
+                                   if ( function_exists( 'WC' ) ) {
296
+                                        ?>
297 297
 								<div class="edit-profile">
298 298
 									<?php
299
-									if ( function_exists( 'wc_get_page_id' ) ) {
300
-										$url_id = wc_get_page_id( 'myaccount' );
301
-									} else {
302
-										$url_id = '';
303
-									}
304
-									?>
299
+                                             if ( function_exists( 'wc_get_page_id' ) ) {
300
+                                                  $url_id = wc_get_page_id( 'myaccount' );
301
+                                             } else {
302
+                                                  $url_id = '';
303
+                                             }
304
+                                             ?>
305 305
 									<a href="<?php echo esc_url( get_permalink( $url_id ) ); ?>edit-account/"><?php esc_html_e( 'Edit', 'lsx-health-plan' ); ?></a>
306 306
 								</div>
307 307
 								<?php
308
-							}
309
-							?>
308
+                                   }
309
+                                   ?>
310 310
 						</div>
311 311
 					<?php } ?>
312 312
 				</section>
@@ -322,73 +322,73 @@  discard block
 block discarded – undo
322 322
  * @return void
323 323
  */
324 324
 function lsx_health_plan_all_plans_block() {
325
-	global $post, $product;
326
-
327
-	// If this is the my plan page, and the user is logged out, show to WC login.
328
-	$plan_slug = \lsx_health_plan\functions\get_option( 'my_plan_slug', false );
329
-	if ( function_exists( 'is_wc_endpoint_url' ) && false !== $plan_slug && is_page( $plan_slug ) ) {
330
-		echo wp_kses_post( '<h2 class="title-lined my-plan"></h2>' );
331
-		echo do_shortcode( '[woocommerce_my_account]' );
332
-		return;
333
-	}
334
-
335
-	$args = array(
336
-		'orderby'        => 'menu_order',
337
-		'order'          => 'ASC',
338
-		'post_type'      => 'plan',
339
-		'nopagin'        => true,
340
-		'post_parent'    => 0,
341
-	);
342
-
343
-	if ( function_exists( '\lsx_health_plan\functions\woocommerce\get_membership_products' ) ) {
344
-		$product_ids = \lsx_health_plan\functions\woocommerce\get_membership_products();
345
-		if ( ! empty( $product_ids ) ) {
346
-			$args['meta_query'] = array(
347
-				'relation' => 'OR',
348
-				array(
349
-					'key'     => '_plan_product_id',
350
-					'value'   => $product_ids,
351
-					'compare' => 'IN',
352
-				),
353
-				array(
354
-					'key'     => '_plan_product_id',
355
-					'compare' => 'NOT EXISTS',
356
-				),
357
-			);
358
-		}
359
-	}
360
-
361
-	$the_query = new WP_Query( $args );
362
-	?>
325
+     global $post, $product;
326
+
327
+     // If this is the my plan page, and the user is logged out, show to WC login.
328
+     $plan_slug = \lsx_health_plan\functions\get_option( 'my_plan_slug', false );
329
+     if ( function_exists( 'is_wc_endpoint_url' ) && false !== $plan_slug && is_page( $plan_slug ) ) {
330
+          echo wp_kses_post( '<h2 class="title-lined my-plan"></h2>' );
331
+          echo do_shortcode( '[woocommerce_my_account]' );
332
+          return;
333
+     }
334
+
335
+     $args = array(
336
+          'orderby'        => 'menu_order',
337
+          'order'          => 'ASC',
338
+          'post_type'      => 'plan',
339
+          'nopagin'        => true,
340
+          'post_parent'    => 0,
341
+     );
342
+
343
+     if ( function_exists( '\lsx_health_plan\functions\woocommerce\get_membership_products' ) ) {
344
+          $product_ids = \lsx_health_plan\functions\woocommerce\get_membership_products();
345
+          if ( ! empty( $product_ids ) ) {
346
+               $args['meta_query'] = array(
347
+                    'relation' => 'OR',
348
+                    array(
349
+                         'key'     => '_plan_product_id',
350
+                         'value'   => $product_ids,
351
+                         'compare' => 'IN',
352
+                    ),
353
+                    array(
354
+                         'key'     => '_plan_product_id',
355
+                         'compare' => 'NOT EXISTS',
356
+                    ),
357
+               );
358
+          }
359
+     }
360
+
361
+     $the_query = new WP_Query( $args );
362
+     ?>
363 363
 	<div class="all-plans-block plan-grid block-all-plans-block">
364 364
 		<div class="row">
365 365
 			<?php
366
-			if ( $the_query->have_posts() ) :
367
-				while ( $the_query->have_posts() ) :
368
-					$the_query->the_post();
369
-					lsx_entry_before();
370
-					$completed_class = '';
371
-					$linked_product  = false;
372
-					$restricted      = false;
373
-					$product         = null;
374
-					if ( function_exists( 'lsx_health_plan\functions\woocommerce\plan_has_products' ) && \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
375
-						$products       = \lsx_health_plan\functions\woocommerce\get_plan_products();
376
-						$linked_product = wc_get_product( $products[0] );
377
-						$product        = $linked_product;
378
-					}
379
-					if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) {
380
-						$restricted = wc_memberships_is_post_content_restricted( get_the_ID() ) && ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
381
-					}
382
-
383
-					if ( lsx_health_plan_is_plan_complete() ) {
384
-						$completed_class = 'completed';
385
-					}
386
-					$round_progress     = '';
387
-					$completed_progress = '100';
388
-					if ( false === $restricted ) {
389
-						$round_progress = round( \lsx_health_plan\functions\get_progress( get_the_ID() ), 0 );
390
-					}
391
-					?>
366
+               if ( $the_query->have_posts() ) :
367
+                    while ( $the_query->have_posts() ) :
368
+                         $the_query->the_post();
369
+                         lsx_entry_before();
370
+                         $completed_class = '';
371
+                         $linked_product  = false;
372
+                         $restricted      = false;
373
+                         $product         = null;
374
+                         if ( function_exists( 'lsx_health_plan\functions\woocommerce\plan_has_products' ) && \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
375
+                              $products       = \lsx_health_plan\functions\woocommerce\get_plan_products();
376
+                              $linked_product = wc_get_product( $products[0] );
377
+                              $product        = $linked_product;
378
+                         }
379
+                         if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) {
380
+                              $restricted = wc_memberships_is_post_content_restricted( get_the_ID() ) && ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
381
+                         }
382
+
383
+                         if ( lsx_health_plan_is_plan_complete() ) {
384
+                              $completed_class = 'completed';
385
+                         }
386
+                         $round_progress     = '';
387
+                         $completed_progress = '100';
388
+                         if ( false === $restricted ) {
389
+                              $round_progress = round( \lsx_health_plan\functions\get_progress( get_the_ID() ), 0 );
390
+                         }
391
+                         ?>
392 392
 					<div class="col-xs-12 col-sm-6 col-md-4">
393 393
 						<article class="lsx-slot lsx-hp-shadow <?php echo esc_html( 'progress-') . $round_progress; ?>">
394 394
 							<div class="plan-feature-img">
@@ -397,45 +397,45 @@  discard block
 block discarded – undo
397 397
 								<?php } ?>
398 398
 								<a href="<?php echo esc_url( get_permalink() ); ?>">
399 399
 								<?php
400
-								$featured_image = get_the_post_thumbnail();
401
-								if ( ! empty( $featured_image ) && '' !== $featured_image ) {
402
-									the_post_thumbnail( 'lsx-thumbnail', array(
403
-										'class' => 'aligncenter',
404
-									) );
405
-								} else {
406
-									?>
400
+                                        $featured_image = get_the_post_thumbnail();
401
+                                        if ( ! empty( $featured_image ) && '' !== $featured_image ) {
402
+                                             the_post_thumbnail( 'lsx-thumbnail', array(
403
+                                                  'class' => 'aligncenter',
404
+                                             ) );
405
+                                        } else {
406
+                                             ?>
407 407
 									<img loading="lazy"  class="placeholder" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>">
408 408
 									<?php
409
-								}
410
-								?>
409
+                                        }
410
+                                        ?>
411 411
 								</a>
412 412
 							</div>
413 413
 							<div class="content-box plan-content-box">
414 414
 								<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>
415 415
 								<?php
416
-									echo wp_kses_post( \lsx_health_plan\functions\hp_get_plan_type_meta( $post ) );
417
-								?>
416
+                                             echo wp_kses_post( \lsx_health_plan\functions\hp_get_plan_type_meta( $post ) );
417
+                                        ?>
418 418
 								<?php
419
-								if ( false !== $linked_product && false !== $restricted ) {
420
-									echo wp_kses_post( $linked_product->get_price_html() );
421
-								}
422
-								?>
419
+                                        if ( false !== $linked_product && false !== $restricted ) {
420
+                                             echo wp_kses_post( $linked_product->get_price_html() );
421
+                                        }
422
+                                        ?>
423 423
 								<div class="excerpt">
424 424
 									<?php
425
-									if ( ! has_excerpt() ) {
426
-										$content = wp_trim_words( get_the_content(), 20 );
427
-										$content = '<p>' . $content . '</pre>';
428
-									} else {
429
-										$content = apply_filters( 'the_excerpt', get_the_excerpt() );
430
-									}
431
-									echo wp_kses_post( $content );
432
-									?>
425
+                                             if ( ! has_excerpt() ) {
426
+                                                  $content = wp_trim_words( get_the_content(), 20 );
427
+                                                  $content = '<p>' . $content . '</pre>';
428
+                                             } else {
429
+                                                  $content = apply_filters( 'the_excerpt', get_the_excerpt() );
430
+                                             }
431
+                                             echo wp_kses_post( $content );
432
+                                             ?>
433 433
 								</div>
434 434
 								<?php
435
-								if ( false === $restricted ) {
436
-									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>' );
437
-								}
438
-								?>
435
+                                        if ( false === $restricted ) {
436
+                                             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>' );
437
+                                        }
438
+                                        ?>
439 439
 							</div>
440 440
 						</article>
441 441
 					</div>
@@ -454,36 +454,36 @@  discard block
 block discarded – undo
454 454
  * @return void
455 455
  */
456 456
 function lsx_health_plan_day_plan_block( $args = array() ) {
457
-	$defaults = array(
458
-		'plan' => '',
459
-	);
460
-	$args     = wp_parse_args( $args, $defaults );
461
-
462
-	if ( isset( $args['plan'] ) && '' !== $args['plan'] && \lsx_health_plan\functions\plan\has_sections( $args['plan'] ) ) {
463
-		$sections = \lsx_health_plan\functions\plan\get_sections();
464
-		?>
457
+     $defaults = array(
458
+          'plan' => '',
459
+     );
460
+     $args     = wp_parse_args( $args, $defaults );
461
+
462
+     if ( isset( $args['plan'] ) && '' !== $args['plan'] && \lsx_health_plan\functions\plan\has_sections( $args['plan'] ) ) {
463
+          $sections = \lsx_health_plan\functions\plan\get_sections();
464
+          ?>
465 465
 		<div class="daily-plan-block day-grid">
466 466
 			<?php
467
-			foreach ( $sections as $section_key => $section_values ) {
468
-				$defaults    = array(
469
-					'title' => __( 'Day', 'lsx-health-plan' ) . ' ' . ( $section_key + 1 ),
470
-				);
471
-				$section_args = wp_parse_args( $section_values, $defaults );
472
-
473
-				$completed_class = '';
474
-				if ( lsx_health_plan_is_day_complete() ) {
475
-					$completed_class = 'completed';
476
-				}
477
-				?>
467
+               foreach ( $sections as $section_key => $section_values ) {
468
+                    $defaults    = array(
469
+                         'title' => __( 'Day', 'lsx-health-plan' ) . ' ' . ( $section_key + 1 ),
470
+                    );
471
+                    $section_args = wp_parse_args( $section_values, $defaults );
472
+
473
+                    $completed_class = '';
474
+                    if ( lsx_health_plan_is_day_complete() ) {
475
+                         $completed_class = 'completed';
476
+                    }
477
+                    ?>
478 478
 				<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 ); ?>">
479 479
 					<div class="plan-content"><?php echo esc_attr( $section_args['title'] ); ?></div>
480 480
 				</a>
481 481
 				<?php
482
-			}
483
-			?>
482
+               }
483
+               ?>
484 484
 		</div>
485 485
 		<?php
486
-	}
486
+     }
487 487
 }
488 488
 
489 489
 /**
@@ -493,44 +493,44 @@  discard block
 block discarded – undo
493 493
  * @return void
494 494
  */
495 495
 function lsx_health_plan_week_plan_block( $args = array() ) {
496
-	$defaults = array(
497
-		'show_downloads' => false,
498
-		'plan'           => '',
499
-	);
500
-	$args     = wp_parse_args( $args, $defaults );
501
-
502
-	if ( isset( $args['plan'] ) && '' !== $args['plan'] && \lsx_health_plan\functions\plan\has_sections( $args['plan'] ) ) {
503
-		$groups = \lsx_health_plan\functions\plan\get_sections( true );
504
-
505
-		if ( ! empty( $groups ) ) {
506
-			$counter    = 1;
507
-			$group_open = false;
508
-
509
-			foreach ( $groups as $group_key => $sections ) {
510
-				$collapse_class = '';
511
-				$group_title    = \lsx_health_plan\functions\plan\get_group_title( $sections );
512
-
513
-				// Determine if the current week is complete.
514
-				$day_ids = wp_list_pluck( $sections, 'title' );
515
-				if ( false === $group_open ) {
516
-					if ( 1 === $counter && ! \lsx_health_plan\functions\is_week_complete( false, $day_ids, $group_title ) ) {
517
-						$collapse_class = 'in';
518
-						$group_open   = true;
519
-					} elseif ( ! \lsx_health_plan\functions\is_week_complete( false, $day_ids, $group_title ) ) {
520
-						$collapse_class = 'in';
521
-						$group_open   = true;
522
-					}
523
-				}
524
-
525
-				// Determine if there are any weekly downloads.
526
-				$week_downloads_view = '';
527
-				if ( isset( $args['show_downloads'] ) && false !== $args['show_downloads'] ) {
528
-					$weekly_downloads = \lsx_health_plan\functions\get_weekly_downloads( $group_key );
529
-					if ( ! empty( $weekly_downloads ) ) {
530
-						$week_downloads_view = 'week-downloads-view-on';
531
-					}
532
-				}
533
-				?>
496
+     $defaults = array(
497
+          'show_downloads' => false,
498
+          'plan'           => '',
499
+     );
500
+     $args     = wp_parse_args( $args, $defaults );
501
+
502
+     if ( isset( $args['plan'] ) && '' !== $args['plan'] && \lsx_health_plan\functions\plan\has_sections( $args['plan'] ) ) {
503
+          $groups = \lsx_health_plan\functions\plan\get_sections( true );
504
+
505
+          if ( ! empty( $groups ) ) {
506
+               $counter    = 1;
507
+               $group_open = false;
508
+
509
+               foreach ( $groups as $group_key => $sections ) {
510
+                    $collapse_class = '';
511
+                    $group_title    = \lsx_health_plan\functions\plan\get_group_title( $sections );
512
+
513
+                    // Determine if the current week is complete.
514
+                    $day_ids = wp_list_pluck( $sections, 'title' );
515
+                    if ( false === $group_open ) {
516
+                         if ( 1 === $counter && ! \lsx_health_plan\functions\is_week_complete( false, $day_ids, $group_title ) ) {
517
+                              $collapse_class = 'in';
518
+                              $group_open   = true;
519
+                         } elseif ( ! \lsx_health_plan\functions\is_week_complete( false, $day_ids, $group_title ) ) {
520
+                              $collapse_class = 'in';
521
+                              $group_open   = true;
522
+                         }
523
+                    }
524
+
525
+                    // Determine if there are any weekly downloads.
526
+                    $week_downloads_view = '';
527
+                    if ( isset( $args['show_downloads'] ) && false !== $args['show_downloads'] ) {
528
+                         $weekly_downloads = \lsx_health_plan\functions\get_weekly_downloads( $group_key );
529
+                         if ( ! empty( $weekly_downloads ) ) {
530
+                              $week_downloads_view = 'week-downloads-view-on';
531
+                         }
532
+                    }
533
+                    ?>
534 534
 				<div class="daily-plan-block week-grid">
535 535
 					<a href="#group-<?php echo esc_attr( $group_key ); ?>" data-toggle="collapse" class="week-title"><?php echo esc_attr( $group_title ); ?></a>
536 536
 					<div id="group-<?php echo esc_attr( $group_key ); ?>" class="week-row collapse <?php echo esc_attr( $collapse_class ); ?>">
@@ -544,46 +544,46 @@  discard block
 block discarded – undo
544 544
 								<div class="week-meals-recipes-box-inner">
545 545
 								<?php
546 546
 
547
-								foreach ( $sections as $section_key => $section_values ) {
547
+                                        foreach ( $sections as $section_key => $section_values ) {
548 548
 
549
-									$defaults    = array(
550
-										'title' => __( 'Day', 'lsx-health-plan' ) . ' ' . ( $section_key + 1 ),
551
-									);
552
-									$section_args = wp_parse_args( $section_values, $defaults );
549
+                                             $defaults    = array(
550
+                                                  'title' => __( 'Day', 'lsx-health-plan' ) . ' ' . ( $section_key + 1 ),
551
+                                             );
552
+                                             $section_args = wp_parse_args( $section_values, $defaults );
553 553
 
554
-									$completed_class = '';
555
-									if ( lsx_health_plan_is_day_complete( $args['plan'], $section_args['title'] ) ) {
556
-										$completed_class = 'completed';
557
-									}
558
-									if ( $section_args['rest_day_enabled'] && ! $section_args['connected_meals'] ) {
559
-										?>
554
+                                             $completed_class = '';
555
+                                             if ( lsx_health_plan_is_day_complete( $args['plan'], $section_args['title'] ) ) {
556
+                                                  $completed_class = 'completed';
557
+                                             }
558
+                                             if ( $section_args['rest_day_enabled'] && ! $section_args['connected_meals'] ) {
559
+                                                  ?>
560 560
 										<span class="day id-<?php echo esc_attr( $section_key + 1 ); ?> <?php echo esc_attr( $completed_class ); ?>">
561 561
 											<div class="plan-content"><?php echo esc_attr( $section_args['title'] ); ?></div>
562 562
 										</span>
563 563
 										<?php
564
-									} else {
565
-										?>
564
+                                             } else {
565
+                                                  ?>
566 566
 										<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 ); ?>">
567 567
 											<div class="plan-content"><?php echo esc_attr( $section_args['title'] ); ?></div>
568 568
 										</a>
569 569
 										<?php
570
-									}
571
-								}
572
-								?>
570
+                                             }
571
+                                        }
572
+                                        ?>
573 573
 								</div>
574 574
 							</div>
575 575
 							<?php
576
-							if ( ! empty( $week_downloads_view ) ) {
577
-								lsx_health_plan_weekly_downloads( $weekly_downloads );
578
-							}
579
-							?>
576
+                                   if ( ! empty( $week_downloads_view ) ) {
577
+                                        lsx_health_plan_weekly_downloads( $weekly_downloads );
578
+                                   }
579
+                                   ?>
580 580
 						</div>
581 581
 					</div>
582 582
 				</div>
583 583
 				<?php
584
-			}
585
-		}
586
-	}
584
+               }
585
+          }
586
+     }
587 587
 }
588 588
 
589 589
 /**
@@ -593,22 +593,22 @@  discard block
 block discarded – undo
593 593
  * @return void
594 594
  */
595 595
 function lsx_health_plan_weekly_downloads( $weekly_downloads = array() ) {
596
-	if ( ! empty( $weekly_downloads ) ) {
597
-		?>
596
+     if ( ! empty( $weekly_downloads ) ) {
597
+          ?>
598 598
 		<div class="week-download-box">
599 599
 			<h3 class="title"><?php lsx_get_svg_icon( 'download.svg' ); ?><?php echo esc_html_e( 'Downloads', 'lsx-health-plan' ); ?></h3>
600 600
 			<ul class="week-download-box-list">
601 601
 				<?php
602
-				foreach ( $weekly_downloads as $weekly_download ) {
603
-					?>
602
+                    foreach ( $weekly_downloads as $weekly_download ) {
603
+                         ?>
604 604
 					<li><?php echo wp_kses_post( do_shortcode( '[download id="' . $weekly_download . '"]' ) ); ?></li>
605 605
 					<?php
606
-				}
607
-				?>
606
+                    }
607
+                    ?>
608 608
 			</ul>
609 609
 		</div>
610 610
 		<?php
611
-	}
611
+     }
612 612
 }
613 613
 
614 614
 /**
@@ -617,9 +617,9 @@  discard block
 block discarded – undo
617 617
  * @return void
618 618
  */
619 619
 function lsx_health_plan_items( $args = array() ) {
620
-	global $shortcode_args;
621
-	$shortcode_args = $args;
622
-	include LSX_HEALTH_PLAN_PATH . '/templates/partials/shortcode-loop.php';
620
+     global $shortcode_args;
621
+     $shortcode_args = $args;
622
+     include LSX_HEALTH_PLAN_PATH . '/templates/partials/shortcode-loop.php';
623 623
 }
624 624
 
625 625
 /**
@@ -628,10 +628,10 @@  discard block
 block discarded – undo
628 628
  * @return void
629 629
  */
630 630
 function lsx_health_plan_featured_video_block() {
631
-	if ( ! post_type_exists( 'video' ) ) {
632
-		return;
633
-	}
634
-	include LSX_HEALTH_PLAN_PATH . '/templates/featured-videos.php';
631
+     if ( ! post_type_exists( 'video' ) ) {
632
+          return;
633
+     }
634
+     include LSX_HEALTH_PLAN_PATH . '/templates/featured-videos.php';
635 635
 }
636 636
 
637 637
 /**
@@ -640,10 +640,10 @@  discard block
 block discarded – undo
640 640
  * @return void
641 641
  */
642 642
 function lsx_health_plan_featured_recipes_block() {
643
-	if ( ! post_type_exists( 'recipe' ) ) {
644
-		return;
645
-	}
646
-	include LSX_HEALTH_PLAN_PATH . '/templates/featured-recipes.php';
643
+     if ( ! post_type_exists( 'recipe' ) ) {
644
+          return;
645
+     }
646
+     include LSX_HEALTH_PLAN_PATH . '/templates/featured-recipes.php';
647 647
 }
648 648
 
649 649
 /**
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
  * @return void
653 653
  */
654 654
 function lsx_health_plan_featured_tips_block() {
655
-	include LSX_HEALTH_PLAN_PATH . '/templates/featured-tips.php';
655
+     include LSX_HEALTH_PLAN_PATH . '/templates/featured-tips.php';
656 656
 }
657 657
 
658 658
 /**
@@ -662,11 +662,11 @@  discard block
 block discarded – undo
662 662
  * @return void
663 663
  */
664 664
 function lsx_health_plan_day_button() {
665
-	if ( lsx_health_plan_is_day_complete() ) {
666
-		lsx_health_plan_unlock_button();
667
-	} else {
668
-		lsx_health_plan_complete_button();
669
-	}
665
+     if ( lsx_health_plan_is_day_complete() ) {
666
+          lsx_health_plan_unlock_button();
667
+     } else {
668
+          lsx_health_plan_complete_button();
669
+     }
670 670
 }
671 671
 
672 672
 /**
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
  * @return void
676 676
  */
677 677
 function lsx_health_plan_complete_button() {
678
-	?>
678
+     ?>
679 679
 	<div class="single-plan-inner-buttons">
680 680
 		<form action="<?php the_permalink(); ?>" method="post" class="form-complete-day complete-plan-btn">
681 681
 			<?php wp_nonce_field( 'complete', 'lsx-health-plan-actions' ); ?>
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
  * @return void
694 694
  */
695 695
 function lsx_health_plan_unlock_button() {
696
-	?>
696
+     ?>
697 697
 	<div class="single-plan-inner-buttons">
698 698
 		<form action="<?php the_permalink(); ?>" method="post" class="form-complete-day complete-plan-btn">
699 699
 			<?php wp_nonce_field( 'unlock', 'lsx-health-plan-actions' ); ?>
@@ -712,10 +712,10 @@  discard block
 block discarded – undo
712 712
  * @return void
713 713
  */
714 714
 function lsx_health_plan_single_nav() {
715
-	$tab_template_path = apply_filters( 'lsx_health_plan_single_nav_path', LSX_HEALTH_PLAN_PATH . '/templates/single-plan-tabs.php' );
716
-	if ( '' !== $tab_template_path ) {
717
-		require $tab_template_path;
718
-	}
715
+     $tab_template_path = apply_filters( 'lsx_health_plan_single_nav_path', LSX_HEALTH_PLAN_PATH . '/templates/single-plan-tabs.php' );
716
+     if ( '' !== $tab_template_path ) {
717
+          require $tab_template_path;
718
+     }
719 719
 }
720 720
 
721 721
 /**
@@ -725,32 +725,32 @@  discard block
 block discarded – undo
725 725
  * @return void
726 726
  */
727 727
 function lsx_health_plan_single_tabs() {
728
-	$endpoint = get_query_var( 'endpoint' );
729
-	switch ( $endpoint ) {
730
-		case 'meal':
731
-			$tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-meal.php';
732
-			break;
733
-
734
-		case 'recipes':
735
-			$tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-recipes.php';
736
-			break;
737
-
738
-		case 'workout':
739
-			$tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-workout.php';
740
-			break;
741
-
742
-		case 'warm-up':
743
-			$tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-warm-up.php';
744
-			break;
745
-
746
-		default:
747
-			$tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-plan.php';
748
-			break;
749
-	}
750
-	$tab_template_path = apply_filters( 'lsx_health_plan_single_tab_path', $tab_template_path );
751
-	if ( '' !== $tab_template_path ) {
752
-		include $tab_template_path;
753
-	}
728
+     $endpoint = get_query_var( 'endpoint' );
729
+     switch ( $endpoint ) {
730
+          case 'meal':
731
+               $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-meal.php';
732
+               break;
733
+
734
+          case 'recipes':
735
+               $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-recipes.php';
736
+               break;
737
+
738
+          case 'workout':
739
+               $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-workout.php';
740
+               break;
741
+
742
+          case 'warm-up':
743
+               $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-warm-up.php';
744
+               break;
745
+
746
+          default:
747
+               $tab_template_path = LSX_HEALTH_PLAN_PATH . '/templates/tab-content-plan.php';
748
+               break;
749
+     }
750
+     $tab_template_path = apply_filters( 'lsx_health_plan_single_tab_path', $tab_template_path );
751
+     if ( '' !== $tab_template_path ) {
752
+          include $tab_template_path;
753
+     }
754 754
 }
755 755
 
756 756
 /**
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
  * @return void
760 760
  */
761 761
 function lsx_health_plan_recipe_data() {
762
-	include LSX_HEALTH_PLAN_PATH . '/templates/table-recipe-data.php';
762
+     include LSX_HEALTH_PLAN_PATH . '/templates/table-recipe-data.php';
763 763
 }
764 764
 
765 765
 /**
@@ -768,11 +768,11 @@  discard block
 block discarded – undo
768 768
  * @return recipe_type
769 769
  */
770 770
 function lsx_health_plan_recipe_type() {
771
-	$term_obj_list = get_the_terms( get_the_ID(), 'recipe-type' );
772
-	$recipe_type   = $term_obj_list[0]->name;
773
-	if ( ! empty( $recipe_type ) ) {
774
-		return $recipe_type;
775
-	}
771
+     $term_obj_list = get_the_terms( get_the_ID(), 'recipe-type' );
772
+     $recipe_type   = $term_obj_list[0]->name;
773
+     if ( ! empty( $recipe_type ) ) {
774
+          return $recipe_type;
775
+     }
776 776
 }
777 777
 
778 778
 /**
@@ -783,35 +783,35 @@  discard block
 block discarded – undo
783 783
  * @return void
784 784
  */
785 785
 function lsx_health_plan_workout_video_play_button( $m, $group, $echo = true ) {
786
-	$workout_video = '';
787
-	$giphy         = '';
788
-	$youtube       = '';
789
-	if ( isset( $group['connected_videos'] ) && '' !== $group['connected_videos'] ) {
790
-		$workout_video = esc_html( $group['connected_videos'] );
791
-		$giphy         = get_post_meta( $workout_video, 'video_giphy_source', true );
792
-		$youtube       = esc_url( get_post_meta( $workout_video, 'video_youtube_source', 1 ) );
793
-		$content       = get_post_field( 'post_content', $workout_video );
794
-		$play_button   = '<button data-toggle="modal" data-target="#workout-video-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>';
795
-
796
-		$modal_body = '';
797
-		if ( ! empty( $giphy ) ) {
798
-			$giphy      = \lsx_health_plan\functions\get_video_url( $giphy );
799
-			$modal_body = $giphy; // WPCS: XSS OK.
800
-		} elseif ( ! empty( $youtube ) ) {
801
-			$modal_body = wp_oembed_get( $youtube, array( // WPCS: XSS OK.
802
-				'width' => 480,
803
-			) );
804
-		}
805
-		$modal_body .= '<h5 class="modal-title title-lined">' . $group['name'] . '</h5>';
806
-		$modal_body .= $content;
807
-		\lsx_health_plan\functions\register_modal( 'workout-video-modal-' . $m, '', $modal_body );
808
-
809
-		if ( true === $echo ) {
810
-			echo wp_kses_post( $play_button );
811
-		} else {
812
-			return $play_button;
813
-		}
814
-	}
786
+     $workout_video = '';
787
+     $giphy         = '';
788
+     $youtube       = '';
789
+     if ( isset( $group['connected_videos'] ) && '' !== $group['connected_videos'] ) {
790
+          $workout_video = esc_html( $group['connected_videos'] );
791
+          $giphy         = get_post_meta( $workout_video, 'video_giphy_source', true );
792
+          $youtube       = esc_url( get_post_meta( $workout_video, 'video_youtube_source', 1 ) );
793
+          $content       = get_post_field( 'post_content', $workout_video );
794
+          $play_button   = '<button data-toggle="modal" data-target="#workout-video-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>';
795
+
796
+          $modal_body = '';
797
+          if ( ! empty( $giphy ) ) {
798
+               $giphy      = \lsx_health_plan\functions\get_video_url( $giphy );
799
+               $modal_body = $giphy; // WPCS: XSS OK.
800
+          } elseif ( ! empty( $youtube ) ) {
801
+               $modal_body = wp_oembed_get( $youtube, array( // WPCS: XSS OK.
802
+                    'width' => 480,
803
+               ) );
804
+          }
805
+          $modal_body .= '<h5 class="modal-title title-lined">' . $group['name'] . '</h5>';
806
+          $modal_body .= $content;
807
+          \lsx_health_plan\functions\register_modal( 'workout-video-modal-' . $m, '', $modal_body );
808
+
809
+          if ( true === $echo ) {
810
+               echo wp_kses_post( $play_button );
811
+          } else {
812
+               return $play_button;
813
+          }
814
+     }
815 815
 }
816 816
 
817 817
 /**
@@ -820,21 +820,21 @@  discard block
 block discarded – undo
820 820
  * @return void
821 821
  */
822 822
 function lsx_health_plan_recipe_archive_description() {
823
-	$description = '';
824
-	if ( is_post_type_archive( 'recipe' ) ) {
825
-		$description = \lsx_health_plan\functions\get_option( 'recipe_archive_description', '' );
826
-	} elseif ( is_post_type_archive( 'exercise' ) ) {
827
-		$description = \lsx_health_plan\functions\get_option( 'exercise_archive_description', '' );
828
-	} elseif ( is_tax() ) {
829
-		$description = get_the_archive_description();
830
-	}
831
-	if ( '' !== $description ) {
832
-		?>
823
+     $description = '';
824
+     if ( is_post_type_archive( 'recipe' ) ) {
825
+          $description = \lsx_health_plan\functions\get_option( 'recipe_archive_description', '' );
826
+     } elseif ( is_post_type_archive( 'exercise' ) ) {
827
+          $description = \lsx_health_plan\functions\get_option( 'exercise_archive_description', '' );
828
+     } elseif ( is_tax() ) {
829
+          $description = get_the_archive_description();
830
+     }
831
+     if ( '' !== $description ) {
832
+          ?>
833 833
 		<div class="lsx-hp-archive-description row">
834 834
 			<div class="col-xs-12 description-wrapper"><?php echo wp_kses_post( wpautop( $description ) ); ?></div>
835 835
 		</div>
836 836
 		<?php
837
-	}
837
+     }
838 838
 }
839 839
 
840 840
 /**
@@ -843,23 +843,23 @@  discard block
 block discarded – undo
843 843
  * @return void
844 844
  */
845 845
 function lsx_health_plan_workout_main_content() {
846
-	// Getting translated endpoint.
847
-	$workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' );
848
-
849
-	$connected_members = get_post_meta( get_the_ID(), ( $workout . '_connected_team_member' ), true );
850
-	$small_description = get_post_meta( get_the_ID(), ( $workout . '_short_description' ), true );
851
-
852
-	$content = '';
853
-	if ( $small_description || $connected_members || lsx_health_plan_has_tips() ) {
854
-		$content .= '<div class="short-desc set-box set content-box entry-content">';
855
-		$content .= '<div class="the-content">';
856
-		$content .= lsx_hp_member_connected( $connected_members, $workout );
857
-		$content .= '<span>' . $small_description . '</span>';
858
-		$content .= '</div>';
859
-		$content .= do_shortcode( '[lsx_health_plan_featured_tips_block]' );
860
-		$content .= '</div>';
861
-	}
862
-	return $content;
846
+     // Getting translated endpoint.
847
+     $workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' );
848
+
849
+     $connected_members = get_post_meta( get_the_ID(), ( $workout . '_connected_team_member' ), true );
850
+     $small_description = get_post_meta( get_the_ID(), ( $workout . '_short_description' ), true );
851
+
852
+     $content = '';
853
+     if ( $small_description || $connected_members || lsx_health_plan_has_tips() ) {
854
+          $content .= '<div class="short-desc set-box set content-box entry-content">';
855
+          $content .= '<div class="the-content">';
856
+          $content .= lsx_hp_member_connected( $connected_members, $workout );
857
+          $content .= '<span>' . $small_description . '</span>';
858
+          $content .= '</div>';
859
+          $content .= do_shortcode( '[lsx_health_plan_featured_tips_block]' );
860
+          $content .= '</div>';
861
+     }
862
+     return $content;
863 863
 }
864 864
 
865 865
 /**
@@ -868,23 +868,23 @@  discard block
 block discarded – undo
868 868
  * @return void
869 869
  */
870 870
 function lsx_health_plan_meal_main_content() {
871
-	// Getting translated endpoint.
872
-	$meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' );
873
-
874
-	$connected_members = get_post_meta( get_the_ID(), ( $meal . '_connected_team_member' ), true );
875
-	$small_description = get_post_meta( get_the_ID(), ( $meal . '_short_description' ), true );
876
-
877
-	$content_meal = '';
878
-	if ( $small_description || $connected_members || lsx_health_plan_has_tips() ) {
879
-		$content_meal .= '<div class="set-box set content-box entry-content">';
880
-		$content_meal .= '<div class="the-content">';
881
-		$content_meal .= lsx_hp_member_connected( $connected_members, $meal );
882
-		$content_meal .= '<span>' . $small_description . '</span>';
883
-		$content_meal .= '</div>';
884
-		$content_meal .= do_shortcode( '[lsx_health_plan_featured_tips_block]' );
885
-		$content_meal .= '</div>';
886
-	}
887
-	return $content_meal;
871
+     // Getting translated endpoint.
872
+     $meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' );
873
+
874
+     $connected_members = get_post_meta( get_the_ID(), ( $meal . '_connected_team_member' ), true );
875
+     $small_description = get_post_meta( get_the_ID(), ( $meal . '_short_description' ), true );
876
+
877
+     $content_meal = '';
878
+     if ( $small_description || $connected_members || lsx_health_plan_has_tips() ) {
879
+          $content_meal .= '<div class="set-box set content-box entry-content">';
880
+          $content_meal .= '<div class="the-content">';
881
+          $content_meal .= lsx_hp_member_connected( $connected_members, $meal );
882
+          $content_meal .= '<span>' . $small_description . '</span>';
883
+          $content_meal .= '</div>';
884
+          $content_meal .= do_shortcode( '[lsx_health_plan_featured_tips_block]' );
885
+          $content_meal .= '</div>';
886
+     }
887
+     return $content_meal;
888 888
 }
889 889
 
890 890
 
@@ -895,36 +895,36 @@  discard block
 block discarded – undo
895 895
  * @return void
896 896
  */
897 897
 function lsx_health_plan_workout_tab_content( $index = 1 ) {
898
-	global $group_name,$shortcode_args;
899
-	$group_name = 'workout_section_' . $index;
900
-	if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) {
901
-		$layout = strtolower( \lsx_health_plan\functions\get_option( 'workout_tab_layout', 'table' ) );
902
-
903
-		// Check for shortcode overrides.
904
-		if ( null !== $shortcode_args && isset( $shortcode_args['layout'] ) ) {
905
-			$layout = $shortcode_args['layout'];
906
-		}
907
-	} else {
908
-		$layout = 'table';
909
-	}
910
-
911
-	switch ( $layout ) {
912
-		case 'list':
913
-			$tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-list.php';
914
-			break;
915
-
916
-		case 'grid':
917
-			$tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-grid.php';
918
-			break;
919
-
920
-		case 'table':
921
-			$tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-table.php';
922
-			break;
923
-	}
924
-	$tab_template_path = apply_filters( 'lsx_health_plan_workout_tab_content_path', $tab_template_path );
925
-	if ( '' !== $tab_template_path ) {
926
-		include $tab_template_path;
927
-	}
898
+     global $group_name,$shortcode_args;
899
+     $group_name = 'workout_section_' . $index;
900
+     if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) {
901
+          $layout = strtolower( \lsx_health_plan\functions\get_option( 'workout_tab_layout', 'table' ) );
902
+
903
+          // Check for shortcode overrides.
904
+          if ( null !== $shortcode_args && isset( $shortcode_args['layout'] ) ) {
905
+               $layout = $shortcode_args['layout'];
906
+          }
907
+     } else {
908
+          $layout = 'table';
909
+     }
910
+
911
+     switch ( $layout ) {
912
+          case 'list':
913
+               $tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-list.php';
914
+               break;
915
+
916
+          case 'grid':
917
+               $tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-grid.php';
918
+               break;
919
+
920
+          case 'table':
921
+               $tab_template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-table.php';
922
+               break;
923
+     }
924
+     $tab_template_path = apply_filters( 'lsx_health_plan_workout_tab_content_path', $tab_template_path );
925
+     if ( '' !== $tab_template_path ) {
926
+          include $tab_template_path;
927
+     }
928 928
 }
929 929
 
930 930
 /**
@@ -933,28 +933,28 @@  discard block
 block discarded – undo
933 933
  * @return void
934 934
  */
935 935
 function lsx_health_plan_workout_sets() {
936
-	if ( is_singular( 'workout' ) ) {
937
-		global $connected_workouts;
938
-		$connected_workouts = array( get_the_ID() );
939
-	}
940
-	if ( is_singular( 'plan' ) ) {
941
-
942
-		global $connected_workouts;
943
-
944
-		$section_key  = get_query_var( 'section' );
945
-		if ( '' !== $section && \lsx_health_plan\functions\plan\has_sections() ) {
946
-			$section_info = \lsx_health_plan\functions\plan\get_section_info( $section_key );
947
-			if ( isset( $section_info['connected_workouts'] ) && '' !== $section_info['connected_workouts'] ) {
948
-
949
-				$connected_workouts = \lsx_health_plan\functions\prep_array( $section_info['connected_workouts'] );
950
-			}
951
-		}
952
-	}
953
-	$template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-sets.php';
954
-	$template_path = apply_filters( 'lsx_health_plan_workout_set_template_path', $template_path );
955
-	if ( '' !== $template_path && ! empty( $template_path ) ) {
956
-		include $template_path;
957
-	}
936
+     if ( is_singular( 'workout' ) ) {
937
+          global $connected_workouts;
938
+          $connected_workouts = array( get_the_ID() );
939
+     }
940
+     if ( is_singular( 'plan' ) ) {
941
+
942
+          global $connected_workouts;
943
+
944
+          $section_key  = get_query_var( 'section' );
945
+          if ( '' !== $section && \lsx_health_plan\functions\plan\has_sections() ) {
946
+               $section_info = \lsx_health_plan\functions\plan\get_section_info( $section_key );
947
+               if ( isset( $section_info['connected_workouts'] ) && '' !== $section_info['connected_workouts'] ) {
948
+
949
+                    $connected_workouts = \lsx_health_plan\functions\prep_array( $section_info['connected_workouts'] );
950
+               }
951
+          }
952
+     }
953
+     $template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-sets.php';
954
+     $template_path = apply_filters( 'lsx_health_plan_workout_set_template_path', $template_path );
955
+     if ( '' !== $template_path && ! empty( $template_path ) ) {
956
+          include $template_path;
957
+     }
958 958
 }
959 959
 
960 960
 /**
@@ -965,11 +965,11 @@  discard block
 block discarded – undo
965 965
  */
966 966
 function lsx_health_plan_warmup_sets( $connected_workouts ) {
967 967
 	
968
-	$template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-sets.php';
969
-	$template_path = apply_filters( 'lsx_health_plan_workout_set_template_path', $template_path );
970
-	if ( '' !== $template_path && ! empty( $template_path ) ) {
971
-		include $template_path;
972
-	}
968
+     $template_path = LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-sets.php';
969
+     $template_path = apply_filters( 'lsx_health_plan_workout_set_template_path', $template_path );
970
+     if ( '' !== $template_path && ! empty( $template_path ) ) {
971
+          include $template_path;
972
+     }
973 973
 }
974 974
 
975 975
 /**
@@ -979,48 +979,48 @@  discard block
 block discarded – undo
979 979
  * @return void
980 980
  */
981 981
 function lsx_hp_meal_plan_recipes( $args = array() ) {
982
-	$defaults = array(
983
-		'meal_id'   => false,
984
-		'meal_time' => '',
985
-		'modal'     => true,
986
-	);
987
-	$args     = wp_parse_args( $args, $defaults );
988
-	// Looking for recipes.
989
-	$connected_recipes = get_post_meta( $args['meal_id'], $args['meal_time'] . '_recipes', true );
990
-	if ( ! empty( $connected_recipes ) ) {
991
-		$query_args    = array(
992
-			'orderby'   => 'date',
993
-			'order'     => 'DESC',
994
-			'post_type' => 'recipe',
995
-			'post__in'  => $connected_recipes,
996
-		);
997
-		$recipes = new WP_Query( $query_args );
998
-		?>
982
+     $defaults = array(
983
+          'meal_id'   => false,
984
+          'meal_time' => '',
985
+          'modal'     => true,
986
+     );
987
+     $args     = wp_parse_args( $args, $defaults );
988
+     // Looking for recipes.
989
+     $connected_recipes = get_post_meta( $args['meal_id'], $args['meal_time'] . '_recipes', true );
990
+     if ( ! empty( $connected_recipes ) ) {
991
+          $query_args    = array(
992
+               'orderby'   => 'date',
993
+               'order'     => 'DESC',
994
+               'post_type' => 'recipe',
995
+               'post__in'  => $connected_recipes,
996
+          );
997
+          $recipes = new WP_Query( $query_args );
998
+          ?>
999 999
 		<div class="recipes">
1000 1000
 			<div class="row eating-row">
1001 1001
 			<?php
1002
-			if ( $recipes->have_posts() ) {
1003
-				while ( $recipes->have_posts() ) {
1004
-					$recipes->the_post();
1005
-					if ( false !== $args['modal'] ) {
1006
-						\lsx_health_plan\functions\recipes\register_recipe_modal();
1007
-					}
1008
-					?>
1002
+               if ( $recipes->have_posts() ) {
1003
+                    while ( $recipes->have_posts() ) {
1004
+                         $recipes->the_post();
1005
+                         if ( false !== $args['modal'] ) {
1006
+                              \lsx_health_plan\functions\recipes\register_recipe_modal();
1007
+                         }
1008
+                         ?>
1009 1009
 					<div class="recipe-column">
1010 1010
 						<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">
1011 1011
 							<div class="recipe-feature-img">
1012 1012
 								<?php
1013
-								$featured_image = get_the_post_thumbnail();
1014
-								if ( ! empty( $featured_image ) && '' !== $featured_image ) {
1015
-									the_post_thumbnail( 'lsx-thumbnail-square', array(
1016
-										'class' => 'aligncenter',
1017
-									) );
1018
-								} else {
1019
-									?>
1013
+                                        $featured_image = get_the_post_thumbnail();
1014
+                                        if ( ! empty( $featured_image ) && '' !== $featured_image ) {
1015
+                                             the_post_thumbnail( 'lsx-thumbnail-square', array(
1016
+                                                  'class' => 'aligncenter',
1017
+                                             ) );
1018
+                                        } else {
1019
+                                             ?>
1020 1020
 									<img loading="lazy" class="placeholder" src="<?php echo esc_attr( plugin_dir_url( __DIR__ ) . 'assets/images/placeholder.jpg' ); ?>">
1021 1021
 									<?php
1022
-								}
1023
-								?>
1022
+                                        }
1023
+                                        ?>
1024 1024
 							</div>
1025 1025
 							<div class="recipe-content">
1026 1026
 								<h3 class="recipe-title"><?php the_title(); ?></h3>
@@ -1029,41 +1029,41 @@  discard block
 block discarded – undo
1029 1029
 						</a>
1030 1030
 					</div>
1031 1031
 				<?php
1032
-				}
1033
-			}
1034
-			wp_reset_postdata();
1035
-			?>
1032
+                    }
1033
+               }
1034
+               wp_reset_postdata();
1035
+               ?>
1036 1036
 			</div>
1037 1037
 		</div>
1038 1038
 		<?php
1039 1039
 
1040
-	}
1040
+     }
1041 1041
 }
1042 1042
 
1043 1043
 /**
1044 1044
  * Output the connected.
1045 1045
  */
1046 1046
 function lsx_hp_recipe_plan_meta( $args = array() ) {
1047
-	$defaults = array();
1048
-	$top_level_plans = array();
1049
-	// Get meals this exercise is connected to.
1050
-	$plans = get_post_meta( get_the_ID(), 'connected_plans', true );
1051
-	if ( ! empty( $plans ) ) {
1052
-		$plan       = end( $plans );
1053
-		$has_parent = wp_get_post_parent_id( $plan );
1054
-		if ( 0 === $has_parent ) {
1055
-			$top_level_plans[] = $plan;
1056
-		} elseif ( false !== $top_level_plans ) {
1057
-			$top_level_plans[] = $has_parent;
1058
-		}
1059
-	}
1060
-	if ( ! empty( $top_level_plans ) && ( '' !== $top_level_plans ) ) {
1061
-		$top_level_plans = array_unique( $top_level_plans );
1062
-		$top_level_plan  = end( $top_level_plans );
1063
-		?>
1047
+     $defaults = array();
1048
+     $top_level_plans = array();
1049
+     // Get meals this exercise is connected to.
1050
+     $plans = get_post_meta( get_the_ID(), 'connected_plans', true );
1051
+     if ( ! empty( $plans ) ) {
1052
+          $plan       = end( $plans );
1053
+          $has_parent = wp_get_post_parent_id( $plan );
1054
+          if ( 0 === $has_parent ) {
1055
+               $top_level_plans[] = $plan;
1056
+          } elseif ( false !== $top_level_plans ) {
1057
+               $top_level_plans[] = $has_parent;
1058
+          }
1059
+     }
1060
+     if ( ! empty( $top_level_plans ) && ( '' !== $top_level_plans ) ) {
1061
+          $top_level_plans = array_unique( $top_level_plans );
1062
+          $top_level_plan  = end( $top_level_plans );
1063
+          ?>
1064 1064
 			<span class="recipe-type recipe-parent"><?php echo esc_html( get_the_title( $top_level_plan ) ); ?></span>
1065 1065
 		<?php
1066
-	}
1066
+     }
1067 1067
 }
1068 1068
 
1069 1069
 /**
@@ -1071,42 +1071,42 @@  discard block
 block discarded – undo
1071 1071
  */
1072 1072
 function lsx_hp_exercise_plan_meta() {
1073 1073
 
1074
-	$top_level_plans = array();
1075
-
1076
-	// Get workouts this exercise is connected to.
1077
-	$workouts = get_post_meta( get_the_ID(), 'connected_workouts', true );
1078
-
1079
-	if ( '' !== $workouts && ! is_array( $workouts ) ) {
1080
-		$workouts = array( $workouts );
1081
-	}
1082
-	if ( ! empty( $workouts ) ) {
1083
-		foreach ( $workouts as $workout ) {
1084
-			// Get the plans this workout is connected to.
1085
-			$plans = get_post_meta( $workout, 'connected_plans', true );
1086
-
1087
-			if ( '' !== $plans && ! is_array( $plans ) ) {
1088
-				$plans = array( $plans );
1089
-			}
1090
-			if ( ! empty( $plans ) ) {
1091
-				foreach ( $plans as $plan ) {
1092
-					$has_parent = wp_get_post_parent_id( $plan );
1093
-					if ( 0 === $has_parent ) {
1094
-						$top_level_plans = $plan;
1095
-					} else {
1096
-						$top_level_plans = $has_parent;
1097
-					}
1098
-				}
1099
-			}
1100
-		}
1101
-	}
1102
-
1103
-	if ( ! empty( $top_level_plans ) && ( '' !== $top_level_plans ) ) {
1104
-		$top_level_plans = array_unique( $top_level_plans );
1105
-		$top_level_plan  = end( $top_level_plans );
1106
-		?>
1074
+     $top_level_plans = array();
1075
+
1076
+     // Get workouts this exercise is connected to.
1077
+     $workouts = get_post_meta( get_the_ID(), 'connected_workouts', true );
1078
+
1079
+     if ( '' !== $workouts && ! is_array( $workouts ) ) {
1080
+          $workouts = array( $workouts );
1081
+     }
1082
+     if ( ! empty( $workouts ) ) {
1083
+          foreach ( $workouts as $workout ) {
1084
+               // Get the plans this workout is connected to.
1085
+               $plans = get_post_meta( $workout, 'connected_plans', true );
1086
+
1087
+               if ( '' !== $plans && ! is_array( $plans ) ) {
1088
+                    $plans = array( $plans );
1089
+               }
1090
+               if ( ! empty( $plans ) ) {
1091
+                    foreach ( $plans as $plan ) {
1092
+                         $has_parent = wp_get_post_parent_id( $plan );
1093
+                         if ( 0 === $has_parent ) {
1094
+                              $top_level_plans = $plan;
1095
+                         } else {
1096
+                              $top_level_plans = $has_parent;
1097
+                         }
1098
+                    }
1099
+               }
1100
+          }
1101
+     }
1102
+
1103
+     if ( ! empty( $top_level_plans ) && ( '' !== $top_level_plans ) ) {
1104
+          $top_level_plans = array_unique( $top_level_plans );
1105
+          $top_level_plan  = end( $top_level_plans );
1106
+          ?>
1107 1107
 			<span class="recipe-type recipe-parent"><?php echo esc_html( get_the_title( $top_level_plan ) ); ?></span>
1108 1108
 		<?php
1109
-	}
1109
+     }
1110 1110
 }
1111 1111
 
1112 1112
 /**
@@ -1116,7 +1116,7 @@  discard block
 block discarded – undo
1116 1116
  * @return void
1117 1117
  */
1118 1118
 function lsx_hp_single_related( $related_content, $post_type_text ) {
1119
-	?>
1119
+     ?>
1120 1120
 	<section id="lsx-hp-related">
1121 1121
 		<div class="row lsx-related-posts lsx-related-posts-title">
1122 1122
 			<div class="col-xs-12">
@@ -1127,14 +1127,14 @@  discard block
 block discarded – undo
1127 1127
 			<div class="col-xs-12">
1128 1128
 				<div class="lsx-related-posts-wrapper">
1129 1129
 					<?php
1130
-					$i = 0;
1131
-					foreach ( $related_content as $article ) {
1132
-						$post_title      = get_the_title( $article );
1133
-						$post_categories = wp_get_post_categories( $article );
1134
-						$post_link       = get_permalink( $article );
1135
-
1136
-						$cats = array();
1137
-						?>
1130
+                         $i = 0;
1131
+                         foreach ( $related_content as $article ) {
1132
+                              $post_title      = get_the_title( $article );
1133
+                              $post_categories = wp_get_post_categories( $article );
1134
+                              $post_link       = get_permalink( $article );
1135
+
1136
+                              $cats = array();
1137
+                              ?>
1138 1138
 						<article id="post-<?php echo esc_html( $article ); ?>" class="lsx-slot post">
1139 1139
 							<div class="entry-layout lsx-hp-shadow">
1140 1140
 								<div class="entry-layout-content">
@@ -1142,25 +1142,25 @@  discard block
 block discarded – undo
1142 1142
 										<div class="entry-image">
1143 1143
 											<a href="<?php echo esc_url( $post_link ); ?>" class="thumbnail">
1144 1144
 											<?php
1145
-											$featured_image = get_the_post_thumbnail( $article, 'lsx-thumbnail-wide' );
1146
-											if ( ! empty( $featured_image ) && '' !== $featured_image ) {
1147
-												echo wp_kses_post( $featured_image );
1148
-											} else {
1149
-												?>
1145
+                                                       $featured_image = get_the_post_thumbnail( $article, 'lsx-thumbnail-wide' );
1146
+                                                       if ( ! empty( $featured_image ) && '' !== $featured_image ) {
1147
+                                                            echo wp_kses_post( $featured_image );
1148
+                                                       } else {
1149
+                                                            ?>
1150 1150
 												<img loading="lazy" class="placeholder" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>">
1151 1151
 												<?php
1152
-											}
1153
-											?>
1152
+                                                       }
1153
+                                                       ?>
1154 1154
 											</a>
1155 1155
 										</div>
1156 1156
 										<div class="entry-meta">
1157 1157
 										<?php
1158
-										foreach ( $post_categories as $c ) {
1159
-											$cat = get_category( $c );
1160
-											/* Translators: %s: category name */
1161
-											$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>';
1162
-										}
1163
-										if ( ! empty( $cats ) ) { ?>
1158
+                                                  foreach ( $post_categories as $c ) {
1159
+                                                       $cat = get_category( $c );
1160
+                                                       /* Translators: %s: category name */
1161
+                                                       $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>';
1162
+                                                  }
1163
+                                                  if ( ! empty( $cats ) ) { ?>
1164 1164
 											<div class="post-categories"><span></span><?php echo wp_kses_post( implode( ', ', $cats ) ); ?></div>
1165 1165
 										<?php } ?>
1166 1166
 										</div>
@@ -1175,8 +1175,8 @@  discard block
 block discarded – undo
1175 1175
 						</article>
1176 1176
 
1177 1177
 					<?php
1178
-					if (++$i === 3) break;
1179
-					} ?>
1178
+                         if (++$i === 3) break;
1179
+                         } ?>
1180 1180
 				</div>
1181 1181
 			</div>
1182 1182
 		</div>
@@ -1191,32 +1191,32 @@  discard block
 block discarded – undo
1191 1191
  * @return void
1192 1192
  */
1193 1193
 function lsx_hp_member_connected( $connected_members, $post_type ) {
1194
-	if ( ! empty( $connected_members ) ) {
1195
-		$content = '<div id="hp-connected-members" class="hp-connected-members connected-' . $post_type . '">';
1196
-		foreach ( $connected_members as $member ) {
1197
-			$post_link   = get_permalink( $member );
1198
-			$member_name = get_the_title( $member );
1199
-			$member_name = '<span class="lsx-team-name">' . $member_name . '</span>';
1200
-
1201
-			$member_link = '<a href="' . $post_link . '" >' . $member_name . '</a>';
1202
-
1203
-			$roles = '';
1204
-			$terms = get_the_terms( $member, 'team_role' );
1205
-
1206
-			if ( $terms && ! is_wp_error( $terms ) ) {
1207
-				$roles = array();
1208
-
1209
-				foreach ( $terms as $term ) {
1210
-					$roles[] = $term->name;
1211
-				}
1212
-
1213
-				$roles = join( ', ', $roles );
1214
-			}
1215
-			$member_roles = '' !== $roles ? "<small class='lsx-team-roles'>$roles</small>" : '';
1216
-
1217
-			$content .= '<p>' . $member_roles . ': ' . $member_link . '</p>';
1218
-		}
1219
-		$content .= '</div>';
1220
-		return $content;
1221
-	}
1194
+     if ( ! empty( $connected_members ) ) {
1195
+          $content = '<div id="hp-connected-members" class="hp-connected-members connected-' . $post_type . '">';
1196
+          foreach ( $connected_members as $member ) {
1197
+               $post_link   = get_permalink( $member );
1198
+               $member_name = get_the_title( $member );
1199
+               $member_name = '<span class="lsx-team-name">' . $member_name . '</span>';
1200
+
1201
+               $member_link = '<a href="' . $post_link . '" >' . $member_name . '</a>';
1202
+
1203
+               $roles = '';
1204
+               $terms = get_the_terms( $member, 'team_role' );
1205
+
1206
+               if ( $terms && ! is_wp_error( $terms ) ) {
1207
+                    $roles = array();
1208
+
1209
+                    foreach ( $terms as $term ) {
1210
+                         $roles[] = $term->name;
1211
+                    }
1212
+
1213
+                    $roles = join( ', ', $roles );
1214
+               }
1215
+               $member_roles = '' !== $roles ? "<small class='lsx-team-roles'>$roles</small>" : '';
1216
+
1217
+               $content .= '<p>' . $member_roles . ': ' . $member_link . '</p>';
1218
+          }
1219
+          $content .= '</div>';
1220
+          return $content;
1221
+     }
1222 1222
 }
Please login to merge, or discard this patch.