Passed
Push — add/multiplan ( ad7e4c...0519d0 )
by Warwick
04:28 queued 12s
created
templates/archive-meal.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 <?php lsx_content_wrap_before(); ?>
11 11
 
12 12
 <?php
13
-	$page_id  = get_the_ID();
14
-	$redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id;
13
+     $page_id  = get_the_ID();
14
+     $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id;
15 15
 ?>
16 16
 
17 17
 	<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>">
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 
21 21
 		<!-- Begining restricted content -->
22 22
 		<?php
23
-		if ( current_user_can( 'administrator', $page_id ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) {
24
-			?>
23
+          if ( current_user_can( 'administrator', $page_id ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) {
24
+               ?>
25 25
 			<main id="main" role="main">
26 26
 
27 27
 				<?php lsx_content_top(); ?>
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 					<div class="row">
31 31
 						<?php if ( have_posts() ) : ?>
32 32
 							<?php
33
-							while ( have_posts() ) :
34
-								the_post();
35
-								?>
33
+                                   while ( have_posts() ) :
34
+                                        the_post();
35
+                                        ?>
36 36
 
37 37
 								<?php include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-meal.php'; ?>
38 38
 
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
 			</main><!-- #main -->
52 52
 
53 53
 			<?php
54
-		} else {
55
-			wp_redirect( $redirect );
56
-			exit;
57
-		}
58
-		?>
54
+          } else {
55
+               wp_redirect( $redirect );
56
+               exit;
57
+          }
58
+          ?>
59 59
 
60 60
 <?php lsx_content_after(); ?>
61 61
 
Please login to merge, or discard this patch.
templates/archive-recipe.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 <?php lsx_content_wrap_before(); ?>
11 11
 
12 12
 <?php
13
-	$page_id  = get_the_ID();
14
-	$redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id;
13
+     $page_id  = get_the_ID();
14
+     $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id;
15 15
 ?>
16 16
 
17 17
 	<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>">
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 
21 21
 		<!-- Begining restricted content -->
22 22
 		<?php
23
-		if ( current_user_can( 'administrator', $page_id ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) {
24
-			?>
23
+          if ( current_user_can( 'administrator', $page_id ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) {
24
+               ?>
25 25
 			<main id="main" role="main">
26 26
 
27 27
 				<?php lsx_content_top(); ?>
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 					<div class="row">
31 31
 						<?php if ( have_posts() ) : ?>
32 32
 							<?php
33
-							while ( have_posts() ) :
34
-								the_post();
35
-								?>
33
+                                   while ( have_posts() ) :
34
+                                        the_post();
35
+                                        ?>
36 36
 
37 37
 								<?php include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-recipe.php'; ?>
38 38
 
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
 			</main><!-- #main -->
52 52
 
53 53
 			<?php
54
-		} else {
55
-			wp_redirect( $redirect );
56
-			exit;
57
-		}
58
-		?>
54
+          } else {
55
+               wp_redirect( $redirect );
56
+               exit;
57
+          }
58
+          ?>
59 59
 
60 60
 <?php lsx_content_after(); ?>
61 61
 
Please login to merge, or discard this patch.
templates/archive-workout.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 <?php lsx_content_wrap_before(); ?>
11 11
 
12 12
 <?php
13
-	$page_id  = get_the_ID();
14
-	$redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id;
13
+     $page_id  = get_the_ID();
14
+     $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id;
15 15
 ?>
16 16
 
17 17
 	<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>">
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 
21 21
 		<!-- Begining restricted content -->
22 22
 		<?php
23
-		if ( current_user_can( 'administrator', $page_id ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) {
24
-			?>
23
+          if ( current_user_can( 'administrator', $page_id ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) {
24
+               ?>
25 25
 			<main id="main" role="main">
26 26
 
27 27
 				<?php lsx_content_top(); ?>
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 					<div class="row">
31 31
 						<?php if ( have_posts() ) : ?>
32 32
 							<?php
33
-							while ( have_posts() ) :
34
-								the_post();
35
-								?>
33
+                                   while ( have_posts() ) :
34
+                                        the_post();
35
+                                        ?>
36 36
 
37 37
 								<?php include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-workout.php'; ?>
38 38
 
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
 			</main><!-- #main -->
52 52
 
53 53
 			<?php
54
-		} else {
55
-			wp_redirect( $redirect );
56
-			exit;
57
-		}
58
-		?>
54
+          } else {
55
+               wp_redirect( $redirect );
56
+               exit;
57
+          }
58
+          ?>
59 59
 
60 60
 <?php lsx_content_after(); ?>
61 61
 
Please login to merge, or discard this patch.
templates/archive-exercise.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 <?php lsx_content_wrap_before(); ?>
11 11
 
12 12
 <?php
13
-	$page_id  = get_the_ID();
14
-	$redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id;
13
+     $page_id  = get_the_ID();
14
+     $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id;
15 15
 ?>
16 16
 
17 17
 	<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>">
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 
21 21
 		<!-- Begining restricted content -->
22 22
 		<?php
23
-		if ( current_user_can( 'administrator', $page_id ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) {
24
-			?>
23
+          if ( current_user_can( 'administrator', $page_id ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) {
24
+               ?>
25 25
 			<main id="main" role="main">
26 26
 
27 27
 				<?php lsx_content_top(); ?>
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 					<div class="row">
31 31
 						<?php if ( have_posts() ) : ?>
32 32
 							<?php
33
-							while ( have_posts() ) :
34
-								the_post();
35
-								?>
33
+                                   while ( have_posts() ) :
34
+                                        the_post();
35
+                                        ?>
36 36
 
37 37
 								<?php include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-exercise.php'; ?>
38 38
 
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
 			</main><!-- #main -->
52 52
 
53 53
 			<?php
54
-		} else {
55
-			wp_redirect( $redirect );
56
-			exit;
57
-		}
58
-		?>
54
+          } else {
55
+               wp_redirect( $redirect );
56
+               exit;
57
+          }
58
+          ?>
59 59
 
60 60
 <?php lsx_content_after(); ?>
61 61
 
Please login to merge, or discard this patch.
templates/tab-content-plan.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@  discard block
 block discarded – undo
8 8
 $section_key  = get_query_var( 'section' );
9 9
 $endpoint_key = get_query_var( 'endpoint' );
10 10
 if ( '' !== $section_key && '' === $endpoint && \lsx_health_plan\functions\plan\has_sections() ) {
11
-	$section_info = \lsx_health_plan\functions\plan\get_section_info( $section_key );
12
-	if ( isset( $section_info['description'] ) && '' !== $section_info['description'] ) {
13
-		global $shortcode_args;
14
-		?>
11
+     $section_info = \lsx_health_plan\functions\plan\get_section_info( $section_key );
12
+     if ( isset( $section_info['description'] ) && '' !== $section_info['description'] ) {
13
+          global $shortcode_args;
14
+          ?>
15 15
 		<?php lsx_entry_before(); ?>
16 16
 
17 17
 		<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
@@ -25,15 +25,15 @@  discard block
 block discarded – undo
25 25
 			<div class="entry-content">
26 26
 				<div class="overview">
27 27
 				<?php
28
-					echo wp_kses_post( apply_filters( 'the_content', $section_info['description'] ) );
29
-
30
-					wp_link_pages( array(
31
-						'before'      => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">',
32
-						'after'       => '</div></div>',
33
-						'link_before' => '<span>',
34
-						'link_after'  => '</span>',
35
-					) );
36
-				?>
28
+                         echo wp_kses_post( apply_filters( 'the_content', $section_info['description'] ) );
29
+
30
+                         wp_link_pages( array(
31
+                              'before'      => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">',
32
+                              'after'       => '</div></div>',
33
+                              'link_before' => '<span>',
34
+                              'link_after'  => '</span>',
35
+                         ) );
36
+                    ?>
37 37
 				</div>
38 38
 			</div><!-- .entry-content -->
39 39
 			<?php if ( null === $shortcode_args ) { ?>
@@ -51,6 +51,6 @@  discard block
 block discarded – undo
51 51
 		</article><!-- #post-## -->
52 52
 
53 53
 		<?php
54
-	}
54
+     }
55 55
 }
56 56
 ?>
Please login to merge, or discard this patch.
templates/tab-content-meal.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -26,13 +26,13 @@  discard block
 block discarded – undo
26 26
 	<div class="entry-content">
27 27
 		<div class="single-plan-inner meal-content">
28 28
 			<?php
29
-			if ( is_singular( 'meal' ) ) { ?>
29
+               if ( is_singular( 'meal' ) ) { ?>
30 30
 				<div class="single-plan-section-title meal-plan title-lined">
31 31
 					<?php lsx_get_svg_icon( 'meal.svg' ); ?>
32 32
 					<h2><?php the_title(); ?></h2>
33 33
 					<?php if ( class_exists( 'LSX_Sharing' ) ) {
34
-						lsx_content_sharing();
35
-					} ?>
34
+                              lsx_content_sharing();
35
+                         } ?>
36 36
 				</div>
37 37
 			<?php } else { ?>
38 38
 				<div class="single-plan-section-title meal-plan title-lined">
@@ -55,18 +55,18 @@  discard block
 block discarded – undo
55 55
 	<?php } ?>
56 56
 
57 57
 	<?php
58
-	// Shoping list
59
-	$shopping_list = get_post_meta( get_the_ID(), 'meal_shopping_list', true );
60
-	if ( ! empty( $shopping_list ) ) {
61
-		?>
58
+     // Shoping list
59
+     $shopping_list = get_post_meta( get_the_ID(), 'meal_shopping_list', true );
60
+     if ( ! empty( $shopping_list ) ) {
61
+          ?>
62 62
 		<a class="btn border-btn btn-shopping" href="<?php echo esc_url( get_page_link( $shopping_list ) ); ?>" target="_blank"><?php esc_html_e( 'Download Shopping List', 'lsx-health-plan' ); ?><i class="fa fa-download" aria-hidden="true"></i></a>
63 63
 	<?php
64
-	}
64
+     }
65 65
 
66
-	?>
66
+     ?>
67 67
 </div>
68 68
 
69 69
 <?php
70 70
 if ( ! empty( $connected_articles ) ) {
71
-	lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) );
71
+     lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) );
72 72
 }
Please login to merge, or discard this patch.
templates/single-plan.php 1 patch
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 
12 12
 <?php
13 13
 $args = array(
14
-	'post_parent' => get_the_ID(),
15
-	'post_type'   => 'plan',
14
+     'post_parent' => get_the_ID(),
15
+     'post_type'   => 'plan',
16 16
 );
17 17
 
18 18
 $plan_id      = get_the_ID();
@@ -28,18 +28,18 @@  discard block
 block discarded – undo
28 28
 $small_description  = get_post_meta( get_the_ID(), ( $plan . '_short_description' ), true );
29 29
 
30 30
 if ( ! empty( $has_sections ) && empty( $is_section ) ) {
31
-	$plan_type_class = 'parent-plan';
31
+     $plan_type_class = 'parent-plan';
32 32
 }
33 33
 if ( ! empty( $has_sections ) && ! empty( $is_section ) ) {
34
-	$plan_type_class = 'child-plan';
34
+     $plan_type_class = 'child-plan';
35 35
 }
36 36
 
37 37
 // Get the plan restrictions.
38 38
 if ( function_exists( 'wc_memberships_is_post_content_restricted' ) && wc_memberships_is_post_content_restricted( get_the_ID() ) ) {
39
-	$restricted = ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
39
+     $restricted = ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
40 40
 }
41 41
 if ( false === $restricted ) {
42
-	$round_progress = round( \lsx_health_plan\functions\get_progress( get_the_ID() ), 0 );
42
+     $round_progress = round( \lsx_health_plan\functions\get_progress( get_the_ID() ), 0 );
43 43
 }
44 44
 ?>
45 45
 
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
 			<?php } ?>
60 60
 
61 61
 			<?php
62
-			if ( ! empty( $has_sections ) ) {
63
-				if ( false === $is_section ) {
64
-					?>
62
+               if ( ! empty( $has_sections ) ) {
63
+                    if ( false === $is_section ) {
64
+                         ?>
65 65
 					<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
66 66
 						<div class="entry-content">
67 67
 							<div class="single-plan-inner main-plan-content">
@@ -69,47 +69,47 @@  discard block
 block discarded – undo
69 69
 									<?php lsx_get_svg_icon( 'my-plan.svg' ); ?>
70 70
 									<h2><?php echo esc_html_e( 'Your Plan', 'lsx-health-plan' ); ?></h2>
71 71
 									<?php if ( class_exists( 'LSX_Sharing' ) ) {
72
-										lsx_content_sharing();
73
-									} ?>
72
+                                                  lsx_content_sharing();
73
+                                             } ?>
74 74
 								</div>
75 75
 								<div class="plan">
76 76
 									<div class="set-box set content-box entry-content">
77 77
 										<div class="plan-top-content">
78 78
 										<?php
79
-										if ( $connected_members ) {
80
-											echo wp_kses_post( lsx_hp_member_connected( $connected_members, $plan ) );
81
-										}
82
-										if ( false === $restricted ) {
83
-											echo wp_kses_post( '<span class="progress"><progress class="bar" value="' . $round_progress . '" max="100"> ' . $round_progress . '% </progress><span>' . $round_progress . '%</span></span>' );
84
-										}
85
-										if ( $small_description ) {
86
-											?>
79
+                                                  if ( $connected_members ) {
80
+                                                       echo wp_kses_post( lsx_hp_member_connected( $connected_members, $plan ) );
81
+                                                  }
82
+                                                  if ( false === $restricted ) {
83
+                                                       echo wp_kses_post( '<span class="progress"><progress class="bar" value="' . $round_progress . '" max="100"> ' . $round_progress . '% </progress><span>' . $round_progress . '%</span></span>' );
84
+                                                  }
85
+                                                  if ( $small_description ) {
86
+                                                       ?>
87 87
 											<div class="the-content">
88 88
 												<span><?php echo esc_html( $small_description ); ?></span>
89 89
 											</div>
90 90
 											<?php
91 91
 											
92
-										}
93
-										?>
92
+                                                  }
93
+                                                  ?>
94 94
 										</div>
95 95
 										<?php
96
-										if ( lsx_health_plan_has_tips() ) {
97
-											echo wp_kses_post( do_shortcode( '[lsx_health_plan_featured_tips_block]' ) );
98
-										} ?>
96
+                                                  if ( lsx_health_plan_has_tips() ) {
97
+                                                       echo wp_kses_post( do_shortcode( '[lsx_health_plan_featured_tips_block]' ) );
98
+                                                  } ?>
99 99
 									</div>
100 100
 									<div class="the-plan-content">
101 101
 										<?php
102
-										echo do_shortcode( '[lsx_health_plan_day_plan_block week_view="true" show_downloads="true" plan="' . get_the_ID() . '"]' );
102
+                                                  echo do_shortcode( '[lsx_health_plan_day_plan_block week_view="true" show_downloads="true" plan="' . get_the_ID() . '"]' );
103 103
 
104
-										?>
104
+                                                  ?>
105 105
 										<div class="row status-plan-buttons main-plan-btn">
106 106
 											<?php
107
-											if ( function_exists( 'wc_get_page_id' ) ) {
108
-												?>
107
+                                                       if ( function_exists( 'wc_get_page_id' ) ) {
108
+                                                            ?>
109 109
 												<a class="btn border-btn" href="<?php echo wp_kses_post( get_permalink( wc_get_page_id( 'myaccount' ) ) ); ?>"><?php esc_html_e( 'My Plans', 'lsx-health-plan' ); ?></a>
110 110
 												<?php
111
-											}
112
-											?>
111
+                                                       }
112
+                                                       ?>
113 113
 										</div>
114 114
 									</div>
115 115
 								</div>
@@ -118,32 +118,32 @@  discard block
 block discarded – undo
118 118
 						</div><!-- .entry-content -->
119 119
 					</article>
120 120
 					<?php
121
-				} else {
122
-					lsx_health_plan_single_nav();
123
-					lsx_health_plan_single_tabs();
124
-				}
125
-			}
126
-			?>
121
+                    } else {
122
+                         lsx_health_plan_single_nav();
123
+                         lsx_health_plan_single_tabs();
124
+                    }
125
+               }
126
+               ?>
127 127
 		</div>
128 128
 
129 129
 		<?php
130
-		// Show the buttons on the single plan tabs.
131
-		if ( ! empty( $has_sections ) && false !== $is_section ) {
132
-			?>
130
+          // Show the buttons on the single plan tabs.
131
+          if ( ! empty( $has_sections ) && false !== $is_section ) {
132
+               ?>
133 133
 			<div class="row status-plan-buttons">
134 134
 				<?php lsx_health_plan_day_button(); ?>
135 135
 			</div>
136 136
 			<?php
137
-		}
138
-		?>
137
+          }
138
+          ?>
139 139
 
140 140
 		<?php lsx_content_bottom(); ?>
141 141
 
142 142
 		<?php
143
-		if ( ! empty( $connected_articles ) ) {
144
-			lsx_hp_single_related( $connected_articles, __( 'Latest articles', 'lsx-health-plan' ) );
145
-		}
146
-		?>
143
+          if ( ! empty( $connected_articles ) ) {
144
+               lsx_hp_single_related( $connected_articles, __( 'Latest articles', 'lsx-health-plan' ) );
145
+          }
146
+          ?>
147 147
 
148 148
 
149 149
 	</main><!-- #main -->
Please login to merge, or discard this patch.
templates/content-archive-recipe.php 1 patch
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.
includes/template-tags/exercise.php 1 patch
Indentation   +169 added lines, -169 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@  discard block
 block discarded – undo
11 11
  * @return exercise_type
12 12
  */
13 13
 function lsx_health_plan_exercise_type() {
14
-	$term_obj_list = get_the_term_list( get_the_ID(), 'exercise-type', '', ', ' );
15
-	if ( ! empty( $term_obj_list ) ) {
16
-		return $term_obj_list;
17
-	}
14
+     $term_obj_list = get_the_term_list( get_the_ID(), 'exercise-type', '', ', ' );
15
+     if ( ! empty( $term_obj_list ) ) {
16
+          return $term_obj_list;
17
+     }
18 18
 }
19 19
 
20 20
 /**
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
  * @return muscle_group_equipment
24 24
  */
25 25
 function lsx_health_plan_muscle_group_equipment() {
26
-	$term_obj_list = get_the_term_list( get_the_ID(), 'muscle-group', '', ', ' );
27
-	if ( ! empty( $term_obj_list ) ) {
28
-		return $term_obj_list;
29
-	}
26
+     $term_obj_list = get_the_term_list( get_the_ID(), 'muscle-group', '', ', ' );
27
+     if ( ! empty( $term_obj_list ) ) {
28
+          return $term_obj_list;
29
+     }
30 30
 }
31 31
 
32 32
 /**
@@ -35,10 +35,10 @@  discard block
 block discarded – undo
35 35
  * @return exercise_equipment
36 36
  */
37 37
 function lsx_health_plan_exercise_equipment() {
38
-	$term_obj_list = get_the_term_list( get_the_ID(), 'equipment', '', ', ' );
39
-	if ( ! empty( $term_obj_list ) ) {
40
-		return $term_obj_list;
41
-	}
38
+     $term_obj_list = get_the_term_list( get_the_ID(), 'equipment', '', ', ' );
39
+     if ( ! empty( $term_obj_list ) ) {
40
+          return $term_obj_list;
41
+     }
42 42
 }
43 43
 
44 44
 /**
@@ -47,81 +47,81 @@  discard block
 block discarded – undo
47 47
  * @return void
48 48
  */
49 49
 function lsx_health_plan_exercise_data() {
50
-	include LSX_HEALTH_PLAN_PATH . '/templates/table-exercise-data.php';
50
+     include LSX_HEALTH_PLAN_PATH . '/templates/table-exercise-data.php';
51 51
 }
52 52
 
53 53
 function lsx_health_plan_workout_exercise_alt_button( $m, $group, $echo = true, $args = array(), $alt_title, $alt_description, $alt_image ) {
54
-	$defaults = array(
55
-		'modal_trigger' => 'button',
56
-		'modal_content' => 'excerpt',
57
-	);
58
-	$args     = wp_parse_args( $args, $defaults );
54
+     $defaults = array(
55
+          'modal_trigger' => 'button',
56
+          'modal_content' => 'excerpt',
57
+     );
58
+     $args     = wp_parse_args( $args, $defaults );
59 59
 
60
-	$exercise_id = '';
61
-	if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) {
62
-		$exercise_id     = esc_html( $group['connected_exercises'] );
63
-		$content         = get_post_field( 'post_content', $exercise_id );
64
-		$url             = get_permalink( $exercise_id );
65
-		$equipment_group = get_the_term_list( $exercise_id, 'equipment', '', ', ' );
66
-		$muscle_group    = get_the_term_list( $exercise_id, 'muscle-group', '', ', ' );
67
-		$lsx_hp          = lsx_health_plan();
60
+     $exercise_id = '';
61
+     if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) {
62
+          $exercise_id     = esc_html( $group['connected_exercises'] );
63
+          $content         = get_post_field( 'post_content', $exercise_id );
64
+          $url             = get_permalink( $exercise_id );
65
+          $equipment_group = get_the_term_list( $exercise_id, 'equipment', '', ', ' );
66
+          $muscle_group    = get_the_term_list( $exercise_id, 'muscle-group', '', ', ' );
67
+          $lsx_hp          = lsx_health_plan();
68 68
 
69
-		if ( 'excerpt' === $args['modal_content'] ) {
70
-			$content = wp_trim_words( $content, 40 );
71
-		}
69
+          if ( 'excerpt' === $args['modal_content'] ) {
70
+               $content = wp_trim_words( $content, 40 );
71
+          }
72 72
 
73
-		if ( 'link' ) {
74
-			$play_button = '<a data-toggle="modal" href="#workout-alt-exercise-modal-' . $m . '">' . get_the_title( $exercise_id ) . '</a>';
75
-		} else {
76
-			$play_button = '<button data-toggle="alt-modal" data-target="#workout-alt-exercise-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>';
77
-		}
73
+          if ( 'link' ) {
74
+               $play_button = '<a data-toggle="modal" href="#workout-alt-exercise-modal-' . $m . '">' . get_the_title( $exercise_id ) . '</a>';
75
+          } else {
76
+               $play_button = '<button data-toggle="alt-modal" data-target="#workout-alt-exercise-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>';
77
+          }
78 78
 
79
-		$modal_body  = '';
79
+          $modal_body  = '';
80 80
 
81
-		if ( '' !== $alt_image && ! empty( $alt_image ) ) {
82
-			$modal_body .= '<div class="modal-image"/><img alt="thumbnail" loading="lazy" class="aligncenter wp-post-image" src="' . $alt_image . '"></div>';
83
-		} else {
84
-			if ( $lsx_hp->frontend->gallery->has_gallery( $exercise_id ) ) {
85
-				$gallery_args = array(
86
-					'css_class' => 'modal-slider',
87
-				);
88
-				$modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args );
89
-			} else {
90
-				$modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail( $exercise_id, 'large' ) . '</div>';
91
-			}
92
-		}
81
+          if ( '' !== $alt_image && ! empty( $alt_image ) ) {
82
+               $modal_body .= '<div class="modal-image"/><img alt="thumbnail" loading="lazy" class="aligncenter wp-post-image" src="' . $alt_image . '"></div>';
83
+          } else {
84
+               if ( $lsx_hp->frontend->gallery->has_gallery( $exercise_id ) ) {
85
+                    $gallery_args = array(
86
+                         'css_class' => 'modal-slider',
87
+                    );
88
+                    $modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args );
89
+               } else {
90
+                    $modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail( $exercise_id, 'large' ) . '</div>';
91
+               }
92
+          }
93 93
 
94
-		if ( '' !== $alt_title ) {
95
-			$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . $alt_title . '</h5>';
96
-		} else {
97
-			$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title( $exercise_id ) . '</h5>';
98
-		}
94
+          if ( '' !== $alt_title ) {
95
+               $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . $alt_title . '</h5>';
96
+          } else {
97
+               $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title( $exercise_id ) . '</h5>';
98
+          }
99 99
 
100
-		if ( ! empty( $equipment_group ) ) {
101
-			$modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>';
102
-		}
103
-		if ( ! empty( $muscle_group ) ) {
104
-			$modal_body .= '<span class="muscle-terms">Muscle Group: ' . $muscle_group . '</span>';
105
-		}
106
-		$modal_body .= '</div>';
107
-		if ( '' !== $args['modal_content'] ) {
108
-			if ( '' !== $alt_description ) {
109
-				$modal_body .= '<div class="modal-excerpt"/>' . $alt_description . '</div>';
110
-			} else {
111
-				$modal_body .= '<div class="modal-excerpt"/>' . $content . '</div>';
112
-			}
113
-		}
114
-		if ( 'excerpt' === $args['modal_content'] ) {
115
-			$modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __( 'Read More', 'lsx-heal-plan' ) . '</a>';
116
-		}
117
-		\lsx_health_plan\functions\register_modal( 'workout-alt-exercise-modal-' . $m, '', $modal_body );
100
+          if ( ! empty( $equipment_group ) ) {
101
+               $modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>';
102
+          }
103
+          if ( ! empty( $muscle_group ) ) {
104
+               $modal_body .= '<span class="muscle-terms">Muscle Group: ' . $muscle_group . '</span>';
105
+          }
106
+          $modal_body .= '</div>';
107
+          if ( '' !== $args['modal_content'] ) {
108
+               if ( '' !== $alt_description ) {
109
+                    $modal_body .= '<div class="modal-excerpt"/>' . $alt_description . '</div>';
110
+               } else {
111
+                    $modal_body .= '<div class="modal-excerpt"/>' . $content . '</div>';
112
+               }
113
+          }
114
+          if ( 'excerpt' === $args['modal_content'] ) {
115
+               $modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __( 'Read More', 'lsx-heal-plan' ) . '</a>';
116
+          }
117
+          \lsx_health_plan\functions\register_modal( 'workout-alt-exercise-modal-' . $m, '', $modal_body );
118 118
 
119
-		if ( true === $echo ) {
120
-			echo wp_kses_post( $play_button );
121
-		} else {
122
-			return $play_button;
123
-		}
124
-	}
119
+          if ( true === $echo ) {
120
+               echo wp_kses_post( $play_button );
121
+          } else {
122
+               return $play_button;
123
+          }
124
+     }
125 125
 }
126 126
 
127 127
 /**
@@ -134,65 +134,65 @@  discard block
 block discarded – undo
134 134
  * @return void
135 135
  */
136 136
 function lsx_health_plan_workout_exercise_button( $m, $group, $echo = true, $args = array() ) {
137
-	$defaults = array(
138
-		'modal_trigger' => 'button',
139
-		'modal_content' => 'excerpt',
140
-	);
141
-	$args     = wp_parse_args( $args, $defaults );
137
+     $defaults = array(
138
+          'modal_trigger' => 'button',
139
+          'modal_content' => 'excerpt',
140
+     );
141
+     $args     = wp_parse_args( $args, $defaults );
142 142
 
143
-	$exercise_id = '';
144
-	if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) {
145
-		$exercise_id     = esc_html( $group['connected_exercises'] );
146
-		$content         = get_post_field( 'post_content', $exercise_id );
147
-		$url             = get_permalink( $exercise_id );
148
-		$equipment_group = get_the_term_list( $exercise_id, 'equipment', '', ', ' );
149
-		$muscle_group    = get_the_term_list( $exercise_id, 'muscle-group', '', ', ' );
150
-		$lsx_hp          = lsx_health_plan();
143
+     $exercise_id = '';
144
+     if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) {
145
+          $exercise_id     = esc_html( $group['connected_exercises'] );
146
+          $content         = get_post_field( 'post_content', $exercise_id );
147
+          $url             = get_permalink( $exercise_id );
148
+          $equipment_group = get_the_term_list( $exercise_id, 'equipment', '', ', ' );
149
+          $muscle_group    = get_the_term_list( $exercise_id, 'muscle-group', '', ', ' );
150
+          $lsx_hp          = lsx_health_plan();
151 151
 
152
-		if ( 'excerpt' === $args['modal_content'] ) {
153
-			$content = wp_trim_words( $content, 40 );
154
-		}
152
+          if ( 'excerpt' === $args['modal_content'] ) {
153
+               $content = wp_trim_words( $content, 40 );
154
+          }
155 155
 
156
-		if ( 'link' ) {
157
-			$play_button = '<a data-toggle="modal" href="#workout-exercise-modal-' . $m . '">' . get_the_title( $exercise_id ) . '</a>';
158
-		} else {
159
-			$play_button = '<button data-toggle="modal" data-target="#workout-exercise-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>';
160
-		}
156
+          if ( 'link' ) {
157
+               $play_button = '<a data-toggle="modal" href="#workout-exercise-modal-' . $m . '">' . get_the_title( $exercise_id ) . '</a>';
158
+          } else {
159
+               $play_button = '<button data-toggle="modal" data-target="#workout-exercise-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>';
160
+          }
161 161
 
162
-		$modal_body  = '';
162
+          $modal_body  = '';
163 163
 
164
-		if ( $lsx_hp->frontend->gallery->has_gallery( $exercise_id ) ) {
165
-			$gallery_args = array(
166
-				'css_class' => 'modal-slider',
167
-			);
168
-			$modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args );
169
-		} else {
170
-			$modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail( $exercise_id, 'large' ) . '</div>';
171
-		}
164
+          if ( $lsx_hp->frontend->gallery->has_gallery( $exercise_id ) ) {
165
+               $gallery_args = array(
166
+                    'css_class' => 'modal-slider',
167
+               );
168
+               $modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args );
169
+          } else {
170
+               $modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail( $exercise_id, 'large' ) . '</div>';
171
+          }
172 172
 
173
-		$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title( $exercise_id ) . '</h5>';
173
+          $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title( $exercise_id ) . '</h5>';
174 174
 
175
-		if ( ! empty( $equipment_group ) ) {
176
-			$modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>';
177
-		}
178
-		if ( ! empty( $muscle_group ) ) {
179
-			$modal_body .= '<span class="muscle-terms">Muscle Group: ' . $muscle_group . '</span>';
180
-		}
181
-		$modal_body .= '</div>';
182
-		if ( '' !== $args['modal_content'] ) {
183
-			$modal_body .= '<div class="modal-excerpt"/>' . $content . '</div>';
184
-		}
185
-		if ( 'excerpt' === $args['modal_content'] ) {
186
-			$modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __( 'Read More', 'lsx-heal-plan' ) . '</a>';
187
-		}
188
-		\lsx_health_plan\functions\register_modal( 'workout-exercise-modal-' . $m, '', $modal_body );
175
+          if ( ! empty( $equipment_group ) ) {
176
+               $modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>';
177
+          }
178
+          if ( ! empty( $muscle_group ) ) {
179
+               $modal_body .= '<span class="muscle-terms">Muscle Group: ' . $muscle_group . '</span>';
180
+          }
181
+          $modal_body .= '</div>';
182
+          if ( '' !== $args['modal_content'] ) {
183
+               $modal_body .= '<div class="modal-excerpt"/>' . $content . '</div>';
184
+          }
185
+          if ( 'excerpt' === $args['modal_content'] ) {
186
+               $modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __( 'Read More', 'lsx-heal-plan' ) . '</a>';
187
+          }
188
+          \lsx_health_plan\functions\register_modal( 'workout-exercise-modal-' . $m, '', $modal_body );
189 189
 
190
-		if ( true === $echo ) {
191
-			echo wp_kses_post( $play_button );
192
-		} else {
193
-			return $play_button;
194
-		}
195
-	}
190
+          if ( true === $echo ) {
191
+               echo wp_kses_post( $play_button );
192
+          } else {
193
+               return $play_button;
194
+          }
195
+     }
196 196
 }
197 197
 
198 198
 /**
@@ -203,38 +203,38 @@  discard block
 block discarded – undo
203 203
  * @return void
204 204
  */
205 205
 function lsx_health_plan_shortcode_exercise_button( $m, $content = true ) {
206
-	$equipment_group = get_the_term_list( $m, 'equipment', '', ', ' );
207
-	$muscle_group    = get_the_term_list( $m, 'muscle-group', '', ', ' );
208
-	$title           = get_the_title();
209
-	$lsx_hp          = lsx_health_plan();
210
-	$button     = '<a data-toggle="modal" href="#exercise-modal-' . $m . '" data-target="#exercise-modal-' . $m . '"></a>';
206
+     $equipment_group = get_the_term_list( $m, 'equipment', '', ', ' );
207
+     $muscle_group    = get_the_term_list( $m, 'muscle-group', '', ', ' );
208
+     $title           = get_the_title();
209
+     $lsx_hp          = lsx_health_plan();
210
+     $button     = '<a data-toggle="modal" href="#exercise-modal-' . $m . '" data-target="#exercise-modal-' . $m . '"></a>';
211 211
 
212
-	if ( true === $content ) {
213
-		$content = get_the_content();
214
-	}
212
+     if ( true === $content ) {
213
+          $content = get_the_content();
214
+     }
215 215
 
216
-	$modal_body = '';
217
-	if ( $lsx_hp->frontend->gallery->has_gallery( $m ) ) {
218
-		$gallery_args = array(
219
-			'css_class' => 'modal-slider',
220
-		);
221
-		$modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args );
222
-	} else {
223
-		$modal_body .= '<div class="modal-image">' . get_the_post_thumbnail( $m, 'large' ) . '</div>';
224
-	}
225
-	$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . $title . '</h5>';
216
+     $modal_body = '';
217
+     if ( $lsx_hp->frontend->gallery->has_gallery( $m ) ) {
218
+          $gallery_args = array(
219
+               'css_class' => 'modal-slider',
220
+          );
221
+          $modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args );
222
+     } else {
223
+          $modal_body .= '<div class="modal-image">' . get_the_post_thumbnail( $m, 'large' ) . '</div>';
224
+     }
225
+     $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . $title . '</h5>';
226 226
 
227
-	if ( ! empty( $equipment_group ) ) {
228
-		$modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>';
229
-	}
230
-	if ( ! empty( $muscle_group ) ) {
231
-		$modal_body .= '<span class="muscle-terms">Muscle Group: ' . $muscle_group . '</span>';
232
-	}
233
-	$modal_body .= '</div>';
234
-	$modal_body .= $content;
235
-	\lsx_health_plan\functions\register_modal( 'exercise-modal-' . $m, '', $modal_body );
227
+     if ( ! empty( $equipment_group ) ) {
228
+          $modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>';
229
+     }
230
+     if ( ! empty( $muscle_group ) ) {
231
+          $modal_body .= '<span class="muscle-terms">Muscle Group: ' . $muscle_group . '</span>';
232
+     }
233
+     $modal_body .= '</div>';
234
+     $modal_body .= $content;
235
+     \lsx_health_plan\functions\register_modal( 'exercise-modal-' . $m, '', $modal_body );
236 236
 
237
-	return ( $button );
237
+     return ( $button );
238 238
 }
239 239
 
240 240
 /**
@@ -246,18 +246,18 @@  discard block
 block discarded – undo
246 246
  * @return string
247 247
  */
248 248
 function lsx_health_plan_exercise_title( $before = '', $after = '', $echo = true, $exercise_id = false ) {
249
-	if ( false === $exercise_id ) {
250
-		$exercise_id = get_the_ID();
251
-	}
252
-	$title = get_the_title( $exercise_id );
253
-	$side  = get_post_meta( $exercise_id, 'exercise_side', true );
254
-	if ( '' !== $side ) {
255
-		$title .= ' - ' . ucwords( $side );
256
-	}
257
-	$title = apply_filters( 'lsx_health_plan_exercise_title', $before . $title . $after, $title, $before, $after, $exercise_id );
258
-	if ( true === $echo ) {
259
-		echo wp_kses_post( $title );
260
-	} else {
261
-		return $title;
262
-	}
249
+     if ( false === $exercise_id ) {
250
+          $exercise_id = get_the_ID();
251
+     }
252
+     $title = get_the_title( $exercise_id );
253
+     $side  = get_post_meta( $exercise_id, 'exercise_side', true );
254
+     if ( '' !== $side ) {
255
+          $title .= ' - ' . ucwords( $side );
256
+     }
257
+     $title = apply_filters( 'lsx_health_plan_exercise_title', $before . $title . $after, $title, $before, $after, $exercise_id );
258
+     if ( true === $echo ) {
259
+          echo wp_kses_post( $title );
260
+     } else {
261
+          return $title;
262
+     }
263 263
 }
Please login to merge, or discard this patch.