Passed
Push — dependabot/github_actions/styf... ( 4ca7c3 )
by
unknown
10:47
created
templates/partials/content-shortcode-exercise.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@  discard block
 block discarded – undo
9 9
 $column_class = '4';
10 10
 // Check for shortcode overrides.
11 11
 if ( null !== $shortcode_args ) {
12
-	if ( isset( $shortcode_args['columns'] ) ) {
13
-		$column_class = $shortcode_args['columns'];
14
-		$column_class = \lsx_health_plan\functions\column_class( $column_class );
15
-	}
12
+     if ( isset( $shortcode_args['columns'] ) ) {
13
+          $column_class = $shortcode_args['columns'];
14
+          $column_class = \lsx_health_plan\functions\column_class( $column_class );
15
+     }
16 16
 }
17 17
 
18 18
 lsx_entry_before();
@@ -23,27 +23,27 @@  discard block
 block discarded – undo
23 23
 <div class="col-xs-12 col-sm-6 col-md-<?php echo esc_attr( $column_class ); ?>">
24 24
 	<div style="background-image:url('<?php echo esc_url( $featured_image ); ?>')" class="lsx-exercises-item bg-<?php echo esc_html( $image_size ); ?>">
25 25
 		<?php
26
-		if ( isset( $link ) && ( 'modal' === $link ) ) {
27
-			echo wp_kses_post( lsx_health_plan_shortcode_exercise_button( $post_id, true ) );
28
-		}
26
+          if ( isset( $link ) && ( 'modal' === $link ) ) {
27
+               echo wp_kses_post( lsx_health_plan_shortcode_exercise_button( $post_id, true ) );
28
+          }
29 29
 
30
-		if ( 'item' === $link ) {
31
-			?>
30
+          if ( 'item' === $link ) {
31
+               ?>
32 32
 			<a href="<?php echo esc_url( get_permalink() ); ?>" class="exercise-link excerpt-<?php echo esc_html( $description ); ?>">
33 33
 			<?php
34
-		} else {
35
-			?>
34
+          } else {
35
+               ?>
36 36
 			<div class="exercise-link excerpt-<?php echo esc_html( $description ); ?>">
37 37
 			<?php
38
-		}
39
-		?>
38
+          }
39
+          ?>
40 40
 
41 41
 		<?php lsx_health_plan_exercise_title( '<h4 class="lsx-exercises-title">', '</h4>', false ); ?>
42 42
 		<?php if ( isset( $description ) && ( 'none' !== $description ) ) { ?>
43 43
 			<?php
44
-			if ( 'excerpt' === $description ) {
45
-				$excerpt = \lsx_health_plan\functions\hp_excerpt( $post_id );
46
-				?>
44
+               if ( 'excerpt' === $description ) {
45
+                    $excerpt = \lsx_health_plan\functions\hp_excerpt( $post_id );
46
+                    ?>
47 47
 				<p class="lsx-exercises-excerpt"><?php echo wp_kses_post( $excerpt ); ?></p>
48 48
 			<?php } ?>
49 49
 			<?php if ( 'full' === $description ) { ?>
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 			<?php } ?>
52 52
 		<?php } ?>
53 53
 		<?php
54
-		if ( isset( $link ) && ( 'item' === $link ) ) {
55
-		?>
54
+          if ( isset( $link ) && ( 'item' === $link ) ) {
55
+          ?>
56 56
 			</a>
57 57
 		<?php } else { ?>
58 58
 			</div>
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -8,50 +8,50 @@
 block discarded – undo
8 8
 
9 9
 $column_class = '4';
10 10
 // Check for shortcode overrides.
11
-if ( null !== $shortcode_args ) {
12
-	if ( isset( $shortcode_args['columns'] ) ) {
11
+if (null !== $shortcode_args) {
12
+	if (isset($shortcode_args['columns'])) {
13 13
 		$column_class = $shortcode_args['columns'];
14
-		$column_class = \lsx_health_plan\functions\column_class( $column_class );
14
+		$column_class = \lsx_health_plan\functions\column_class($column_class);
15 15
 	}
16 16
 }
17 17
 
18 18
 lsx_entry_before();
19 19
 
20 20
 $post_id        = get_the_id();
21
-$featured_image = get_the_post_thumbnail_url( $post_id, $image_size );
21
+$featured_image = get_the_post_thumbnail_url($post_id, $image_size);
22 22
 ?>
23
-<div class="col-xs-12 col-sm-6 col-md-<?php echo esc_attr( $column_class ); ?>">
24
-	<div style="background-image:url('<?php echo esc_url( $featured_image ); ?>')" class="lsx-exercises-item bg-<?php echo esc_html( $image_size ); ?>">
23
+<div class="col-xs-12 col-sm-6 col-md-<?php echo esc_attr($column_class); ?>">
24
+	<div style="background-image:url('<?php echo esc_url($featured_image); ?>')" class="lsx-exercises-item bg-<?php echo esc_html($image_size); ?>">
25 25
 		<?php
26
-		if ( isset( $link ) && ( 'modal' === $link ) ) {
27
-			echo wp_kses_post( lsx_health_plan_shortcode_exercise_button( $post_id, true ) );
26
+		if (isset($link) && ('modal' === $link)) {
27
+			echo wp_kses_post(lsx_health_plan_shortcode_exercise_button($post_id, true));
28 28
 		}
29 29
 
30
-		if ( 'item' === $link ) {
30
+		if ('item' === $link) {
31 31
 			?>
32
-			<a href="<?php echo esc_url( get_permalink() ); ?>" class="exercise-link excerpt-<?php echo esc_html( $description ); ?>">
32
+			<a href="<?php echo esc_url(get_permalink()); ?>" class="exercise-link excerpt-<?php echo esc_html($description); ?>">
33 33
 			<?php
34 34
 		} else {
35 35
 			?>
36
-			<div class="exercise-link excerpt-<?php echo esc_html( $description ); ?>">
36
+			<div class="exercise-link excerpt-<?php echo esc_html($description); ?>">
37 37
 			<?php
38 38
 		}
39 39
 		?>
40 40
 
41
-		<?php lsx_health_plan_exercise_title( '<h4 class="lsx-exercises-title">', '</h4>', false ); ?>
42
-		<?php if ( isset( $description ) && ( 'none' !== $description ) ) { ?>
41
+		<?php lsx_health_plan_exercise_title('<h4 class="lsx-exercises-title">', '</h4>', false); ?>
42
+		<?php if (isset($description) && ('none' !== $description)) { ?>
43 43
 			<?php
44
-			if ( 'excerpt' === $description ) {
45
-				$excerpt = \lsx_health_plan\functions\hp_excerpt( $post_id );
44
+			if ('excerpt' === $description) {
45
+				$excerpt = \lsx_health_plan\functions\hp_excerpt($post_id);
46 46
 				?>
47
-				<p class="lsx-exercises-excerpt"><?php echo wp_kses_post( $excerpt ); ?></p>
47
+				<p class="lsx-exercises-excerpt"><?php echo wp_kses_post($excerpt); ?></p>
48 48
 			<?php } ?>
49
-			<?php if ( 'full' === $description ) { ?>
50
-				<?php echo wp_kses_post( get_the_content() ); ?>
49
+			<?php if ('full' === $description) { ?>
50
+				<?php echo wp_kses_post(get_the_content()); ?>
51 51
 			<?php } ?>
52 52
 		<?php } ?>
53 53
 		<?php
54
-		if ( isset( $link ) && ( 'item' === $link ) ) {
54
+		if (isset($link) && ('item' === $link)) {
55 55
 		?>
56 56
 			</a>
57 57
 		<?php } else { ?>
Please login to merge, or discard this patch.
templates/partials/workout-table.php 2 patches
Indentation   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -8,104 +8,104 @@
 block discarded – undo
8 8
 global $group_name;
9 9
 $groups = get_post_meta( get_the_ID(), $group_name, true );
10 10
 if ( is_singular( 'workout' ) ) {
11
-	$groups = get_post_meta( get_queried_object_id(), $group_name, true );
11
+     $groups = get_post_meta( get_queried_object_id(), $group_name, true );
12 12
 }
13 13
 if ( ! empty( $groups ) ) {
14
-	?>
14
+     ?>
15 15
 	<div class="set-table">
16 16
 		<table class="workout-table">
17 17
 			<?php
18
-			$table_headers = array();
19
-			$table_body    = array();
18
+               $table_headers = array();
19
+               $table_body    = array();
20 20
 
21
-			foreach ( $groups as $group ) {
22
-				$this_row = array();
21
+               foreach ( $groups as $group ) {
22
+                    $this_row = array();
23 23
 
24
-				$this_row[] = '<tr>';
24
+                    $this_row[] = '<tr>';
25 25
 
26
-				// Getting the connected exercise.
27
-				if ( post_type_exists( 'exercise' ) ) {
28
-					if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_exercises'] ) ) ) ) {
29
-						$exercise    = $group['connected_exercises'];
30
-						$exercise_id = get_post( $exercise );
31
-					}
32
-				} else {
33
-					$exercise    = false;
34
-					$exercise_id = false;
35
-				}
26
+                    // Getting the connected exercise.
27
+                    if ( post_type_exists( 'exercise' ) ) {
28
+                         if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_exercises'] ) ) ) ) {
29
+                              $exercise    = $group['connected_exercises'];
30
+                              $exercise_id = get_post( $exercise );
31
+                         }
32
+                    } else {
33
+                         $exercise    = false;
34
+                         $exercise_id = false;
35
+                    }
36 36
 
37
-				if ( false !== $exercise && '' !== $exercise ) {
38
-					$exercise_name         = get_the_title( $exercise_id );
39
-					$this_row[]            = '<td class="workout-title-item">' . esc_html( $exercise_name ) . '</td>';
40
-					$table_headers['name'] = true;
41
-				} else {
42
-					if ( isset( $group['name'] ) && '' !== $group['name'] ) {
43
-						$this_row[]            = '<td class="workout-title-item">' . esc_html( $group['name'] ) . '</td>';
44
-						$table_headers['name'] = true;
45
-					}
46
-				}
47
-				// Only display this is exercise is disabled.
48
-				if ( false === $exercise && isset( $group['description'] ) && '' !== $group['description'] ) {
49
-					$this_row[]                   = '<td class="workout-desc-item"><p>' . esc_html( $group['description'] ) . '</td>';
50
-					$table_headers['description'] = true;
51
-				}
37
+                    if ( false !== $exercise && '' !== $exercise ) {
38
+                         $exercise_name         = get_the_title( $exercise_id );
39
+                         $this_row[]            = '<td class="workout-title-item">' . esc_html( $exercise_name ) . '</td>';
40
+                         $table_headers['name'] = true;
41
+                    } else {
42
+                         if ( isset( $group['name'] ) && '' !== $group['name'] ) {
43
+                              $this_row[]            = '<td class="workout-title-item">' . esc_html( $group['name'] ) . '</td>';
44
+                              $table_headers['name'] = true;
45
+                         }
46
+                    }
47
+                    // Only display this is exercise is disabled.
48
+                    if ( false === $exercise && isset( $group['description'] ) && '' !== $group['description'] ) {
49
+                         $this_row[]                   = '<td class="workout-desc-item"><p>' . esc_html( $group['description'] ) . '</td>';
50
+                         $table_headers['description'] = true;
51
+                    }
52 52
 
53
-				if ( isset( $group['reps'] ) && '' !== $group['reps'] ) {
54
-					$this_row[]            = '<td class="reps-field-item center-mobile">' . esc_html( $group['reps'] ) . '</td>';
55
-					$table_headers['reps'] = true;
56
-				}
53
+                    if ( isset( $group['reps'] ) && '' !== $group['reps'] ) {
54
+                         $this_row[]            = '<td class="reps-field-item center-mobile">' . esc_html( $group['reps'] ) . '</td>';
55
+                         $table_headers['reps'] = true;
56
+                    }
57 57
 
58
-				// Only display this is exercise is disabled.
59
-				if ( false === $exercise ) {
60
-					if ( isset( $group['equipment'] ) && '' !== $group['equipment'] ) {
61
-						$this_row[]                 = '<td class="equipment-field-item center-mobile">' . esc_html( $group['equipment'] ) . '</td>';
62
-						$table_headers['equipment'] = true;
63
-					}
64
-					if ( isset( $group['muscle'] ) && '' !== $group['muscle'] ) {
65
-						$this_row[]              = '<td class="muscle-field-item center-mobile">' . esc_html( $group['muscle'] ) . '</td>';
66
-						$table_headers['muscle'] = true;
67
-					}
68
-				}
69
-				if ( post_type_exists( 'video' ) && isset( $group['connected_videos'] ) && '' !== $group['connected_videos'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_videos'] ) ) ) ) {
70
-					$this_row[]             = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_video_play_button( $m, $group, false ) . '</td>';
71
-					$table_headers['video'] = true;
72
-				}
73
-				if ( post_type_exists( 'exercise' ) && isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_exercises'] ) ) ) ) {
74
-					$this_row[]             = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_exercise_button( $m, $group, false ) . '</td>';
75
-					$table_headers['exercise'] = true;
76
-				}
77
-				$this_row[] = '</tr>';
58
+                    // Only display this is exercise is disabled.
59
+                    if ( false === $exercise ) {
60
+                         if ( isset( $group['equipment'] ) && '' !== $group['equipment'] ) {
61
+                              $this_row[]                 = '<td class="equipment-field-item center-mobile">' . esc_html( $group['equipment'] ) . '</td>';
62
+                              $table_headers['equipment'] = true;
63
+                         }
64
+                         if ( isset( $group['muscle'] ) && '' !== $group['muscle'] ) {
65
+                              $this_row[]              = '<td class="muscle-field-item center-mobile">' . esc_html( $group['muscle'] ) . '</td>';
66
+                              $table_headers['muscle'] = true;
67
+                         }
68
+                    }
69
+                    if ( post_type_exists( 'video' ) && isset( $group['connected_videos'] ) && '' !== $group['connected_videos'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_videos'] ) ) ) ) {
70
+                         $this_row[]             = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_video_play_button( $m, $group, false ) . '</td>';
71
+                         $table_headers['video'] = true;
72
+                    }
73
+                    if ( post_type_exists( 'exercise' ) && isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_exercises'] ) ) ) ) {
74
+                         $this_row[]             = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_exercise_button( $m, $group, false ) . '</td>';
75
+                         $table_headers['exercise'] = true;
76
+                    }
77
+                    $this_row[] = '</tr>';
78 78
 
79
-				$table_body[] = implode( '', $this_row );
80
-				$m++;
81
-			}
79
+                    $table_body[] = implode( '', $this_row );
80
+                    $m++;
81
+               }
82 82
 
83
-			// Now we build the table header.
84
-			$table_header   = array();
85
-			$table_header[] = '<tr>';
86
-			if ( isset( $table_headers['name'] ) ) {
87
-				$table_header[] = '<th class="center-mobile">' . __( 'Workout', 'lsx-health-plan' ) . '</th>';
88
-			}
89
-			if ( isset( $table_headers['description'] ) ) {
90
-				$table_header[] = '<th class="center-mobile">' . __( 'Description', 'lsx-health-plan' ) . '</th>';
91
-			}
92
-			if ( isset( $table_headers['reps'] ) ) {
93
-				$table_header[] = '<th class="center-mobile">' . __( 'Reps / Time / Distance', 'lsx-health-plan' ) . '</th>';
94
-			}
95
-			if ( isset( $table_headers['equipment'] ) ) {
96
-				$table_header[] = '<th class="center-mobile">' . __( 'Equipment', 'lsx-health-plan' ) . '</th>';
97
-			}
98
-			if ( isset( $table_headers['muscle'] ) ) {
99
-				$table_header[] = '<th class="center-mobile">' . __( 'Muscle', 'lsx-health-plan' ) . '</th>';
100
-			}
101
-			if ( isset( $table_headers['video'] ) ) {
102
-				$table_header[] = '<th class="center-mobile">' . __( 'How To', 'lsx-health-plan' ) . '</th>';
103
-			}
104
-			if ( isset( $table_headers['exercise'] ) ) {
105
-				$table_header[] = '<th class="center-mobile">' . __( 'How To', 'lsx-health-plan' ) . '</th>';
106
-			}
107
-			$table_header[] = '</tr>';
108
-			?>
83
+               // Now we build the table header.
84
+               $table_header   = array();
85
+               $table_header[] = '<tr>';
86
+               if ( isset( $table_headers['name'] ) ) {
87
+                    $table_header[] = '<th class="center-mobile">' . __( 'Workout', 'lsx-health-plan' ) . '</th>';
88
+               }
89
+               if ( isset( $table_headers['description'] ) ) {
90
+                    $table_header[] = '<th class="center-mobile">' . __( 'Description', 'lsx-health-plan' ) . '</th>';
91
+               }
92
+               if ( isset( $table_headers['reps'] ) ) {
93
+                    $table_header[] = '<th class="center-mobile">' . __( 'Reps / Time / Distance', 'lsx-health-plan' ) . '</th>';
94
+               }
95
+               if ( isset( $table_headers['equipment'] ) ) {
96
+                    $table_header[] = '<th class="center-mobile">' . __( 'Equipment', 'lsx-health-plan' ) . '</th>';
97
+               }
98
+               if ( isset( $table_headers['muscle'] ) ) {
99
+                    $table_header[] = '<th class="center-mobile">' . __( 'Muscle', 'lsx-health-plan' ) . '</th>';
100
+               }
101
+               if ( isset( $table_headers['video'] ) ) {
102
+                    $table_header[] = '<th class="center-mobile">' . __( 'How To', 'lsx-health-plan' ) . '</th>';
103
+               }
104
+               if ( isset( $table_headers['exercise'] ) ) {
105
+                    $table_header[] = '<th class="center-mobile">' . __( 'How To', 'lsx-health-plan' ) . '</th>';
106
+               }
107
+               $table_header[] = '</tr>';
108
+               ?>
109 109
 			<thead>
110 110
 				<?php echo wp_kses_post( implode( '', $table_header ) ); ?>
111 111
 			</thead>
Please login to merge, or discard this patch.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
  */
7 7
 
8 8
 global $group_name;
9
-$groups = get_post_meta( get_the_ID(), $group_name, true );
10
-if ( is_singular( 'workout' ) ) {
11
-	$groups = get_post_meta( get_queried_object_id(), $group_name, true );
9
+$groups = get_post_meta(get_the_ID(), $group_name, true);
10
+if (is_singular('workout')) {
11
+	$groups = get_post_meta(get_queried_object_id(), $group_name, true);
12 12
 }
13
-if ( ! empty( $groups ) ) {
13
+if ( ! empty($groups)) {
14 14
 	?>
15 15
 	<div class="set-table">
16 16
 		<table class="workout-table">
@@ -18,99 +18,99 @@  discard block
 block discarded – undo
18 18
 			$table_headers = array();
19 19
 			$table_body    = array();
20 20
 
21
-			foreach ( $groups as $group ) {
21
+			foreach ($groups as $group) {
22 22
 				$this_row = array();
23 23
 
24 24
 				$this_row[] = '<tr>';
25 25
 
26 26
 				// Getting the connected exercise.
27
-				if ( post_type_exists( 'exercise' ) ) {
28
-					if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_exercises'] ) ) ) ) {
27
+				if (post_type_exists('exercise')) {
28
+					if (isset($group['connected_exercises']) && '' !== $group['connected_exercises'] && ! empty(\lsx_health_plan\functions\check_posts_exist(array($group['connected_exercises'])))) {
29 29
 						$exercise    = $group['connected_exercises'];
30
-						$exercise_id = get_post( $exercise );
30
+						$exercise_id = get_post($exercise);
31 31
 					}
32 32
 				} else {
33 33
 					$exercise    = false;
34 34
 					$exercise_id = false;
35 35
 				}
36 36
 
37
-				if ( false !== $exercise && '' !== $exercise ) {
38
-					$exercise_name         = get_the_title( $exercise_id );
39
-					$this_row[]            = '<td class="workout-title-item">' . esc_html( $exercise_name ) . '</td>';
37
+				if (false !== $exercise && '' !== $exercise) {
38
+					$exercise_name         = get_the_title($exercise_id);
39
+					$this_row[]            = '<td class="workout-title-item">' . esc_html($exercise_name) . '</td>';
40 40
 					$table_headers['name'] = true;
41 41
 				} else {
42
-					if ( isset( $group['name'] ) && '' !== $group['name'] ) {
43
-						$this_row[]            = '<td class="workout-title-item">' . esc_html( $group['name'] ) . '</td>';
42
+					if (isset($group['name']) && '' !== $group['name']) {
43
+						$this_row[]            = '<td class="workout-title-item">' . esc_html($group['name']) . '</td>';
44 44
 						$table_headers['name'] = true;
45 45
 					}
46 46
 				}
47 47
 				// Only display this is exercise is disabled.
48
-				if ( false === $exercise && isset( $group['description'] ) && '' !== $group['description'] ) {
49
-					$this_row[]                   = '<td class="workout-desc-item"><p>' . esc_html( $group['description'] ) . '</td>';
48
+				if (false === $exercise && isset($group['description']) && '' !== $group['description']) {
49
+					$this_row[]                   = '<td class="workout-desc-item"><p>' . esc_html($group['description']) . '</td>';
50 50
 					$table_headers['description'] = true;
51 51
 				}
52 52
 
53
-				if ( isset( $group['reps'] ) && '' !== $group['reps'] ) {
54
-					$this_row[]            = '<td class="reps-field-item center-mobile">' . esc_html( $group['reps'] ) . '</td>';
53
+				if (isset($group['reps']) && '' !== $group['reps']) {
54
+					$this_row[]            = '<td class="reps-field-item center-mobile">' . esc_html($group['reps']) . '</td>';
55 55
 					$table_headers['reps'] = true;
56 56
 				}
57 57
 
58 58
 				// Only display this is exercise is disabled.
59
-				if ( false === $exercise ) {
60
-					if ( isset( $group['equipment'] ) && '' !== $group['equipment'] ) {
61
-						$this_row[]                 = '<td class="equipment-field-item center-mobile">' . esc_html( $group['equipment'] ) . '</td>';
59
+				if (false === $exercise) {
60
+					if (isset($group['equipment']) && '' !== $group['equipment']) {
61
+						$this_row[]                 = '<td class="equipment-field-item center-mobile">' . esc_html($group['equipment']) . '</td>';
62 62
 						$table_headers['equipment'] = true;
63 63
 					}
64
-					if ( isset( $group['muscle'] ) && '' !== $group['muscle'] ) {
65
-						$this_row[]              = '<td class="muscle-field-item center-mobile">' . esc_html( $group['muscle'] ) . '</td>';
64
+					if (isset($group['muscle']) && '' !== $group['muscle']) {
65
+						$this_row[]              = '<td class="muscle-field-item center-mobile">' . esc_html($group['muscle']) . '</td>';
66 66
 						$table_headers['muscle'] = true;
67 67
 					}
68 68
 				}
69
-				if ( post_type_exists( 'video' ) && isset( $group['connected_videos'] ) && '' !== $group['connected_videos'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_videos'] ) ) ) ) {
70
-					$this_row[]             = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_video_play_button( $m, $group, false ) . '</td>';
69
+				if (post_type_exists('video') && isset($group['connected_videos']) && '' !== $group['connected_videos'] && ! empty(\lsx_health_plan\functions\check_posts_exist(array($group['connected_videos'])))) {
70
+					$this_row[]             = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_video_play_button($m, $group, false) . '</td>';
71 71
 					$table_headers['video'] = true;
72 72
 				}
73
-				if ( post_type_exists( 'exercise' ) && isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_exercises'] ) ) ) ) {
74
-					$this_row[]             = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_exercise_button( $m, $group, false ) . '</td>';
73
+				if (post_type_exists('exercise') && isset($group['connected_exercises']) && '' !== $group['connected_exercises'] && ! empty(\lsx_health_plan\functions\check_posts_exist(array($group['connected_exercises'])))) {
74
+					$this_row[]             = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_exercise_button($m, $group, false) . '</td>';
75 75
 					$table_headers['exercise'] = true;
76 76
 				}
77 77
 				$this_row[] = '</tr>';
78 78
 
79
-				$table_body[] = implode( '', $this_row );
79
+				$table_body[] = implode('', $this_row);
80 80
 				$m++;
81 81
 			}
82 82
 
83 83
 			// Now we build the table header.
84 84
 			$table_header   = array();
85 85
 			$table_header[] = '<tr>';
86
-			if ( isset( $table_headers['name'] ) ) {
87
-				$table_header[] = '<th class="center-mobile">' . __( 'Workout', 'lsx-health-plan' ) . '</th>';
86
+			if (isset($table_headers['name'])) {
87
+				$table_header[] = '<th class="center-mobile">' . __('Workout', 'lsx-health-plan') . '</th>';
88 88
 			}
89
-			if ( isset( $table_headers['description'] ) ) {
90
-				$table_header[] = '<th class="center-mobile">' . __( 'Description', 'lsx-health-plan' ) . '</th>';
89
+			if (isset($table_headers['description'])) {
90
+				$table_header[] = '<th class="center-mobile">' . __('Description', 'lsx-health-plan') . '</th>';
91 91
 			}
92
-			if ( isset( $table_headers['reps'] ) ) {
93
-				$table_header[] = '<th class="center-mobile">' . __( 'Reps / Time / Distance', 'lsx-health-plan' ) . '</th>';
92
+			if (isset($table_headers['reps'])) {
93
+				$table_header[] = '<th class="center-mobile">' . __('Reps / Time / Distance', 'lsx-health-plan') . '</th>';
94 94
 			}
95
-			if ( isset( $table_headers['equipment'] ) ) {
96
-				$table_header[] = '<th class="center-mobile">' . __( 'Equipment', 'lsx-health-plan' ) . '</th>';
95
+			if (isset($table_headers['equipment'])) {
96
+				$table_header[] = '<th class="center-mobile">' . __('Equipment', 'lsx-health-plan') . '</th>';
97 97
 			}
98
-			if ( isset( $table_headers['muscle'] ) ) {
99
-				$table_header[] = '<th class="center-mobile">' . __( 'Muscle', 'lsx-health-plan' ) . '</th>';
98
+			if (isset($table_headers['muscle'])) {
99
+				$table_header[] = '<th class="center-mobile">' . __('Muscle', 'lsx-health-plan') . '</th>';
100 100
 			}
101
-			if ( isset( $table_headers['video'] ) ) {
102
-				$table_header[] = '<th class="center-mobile">' . __( 'How To', 'lsx-health-plan' ) . '</th>';
101
+			if (isset($table_headers['video'])) {
102
+				$table_header[] = '<th class="center-mobile">' . __('How To', 'lsx-health-plan') . '</th>';
103 103
 			}
104
-			if ( isset( $table_headers['exercise'] ) ) {
105
-				$table_header[] = '<th class="center-mobile">' . __( 'How To', 'lsx-health-plan' ) . '</th>';
104
+			if (isset($table_headers['exercise'])) {
105
+				$table_header[] = '<th class="center-mobile">' . __('How To', 'lsx-health-plan') . '</th>';
106 106
 			}
107 107
 			$table_header[] = '</tr>';
108 108
 			?>
109 109
 			<thead>
110
-				<?php echo wp_kses_post( implode( '', $table_header ) ); ?>
110
+				<?php echo wp_kses_post(implode('', $table_header)); ?>
111 111
 			</thead>
112 112
 			<tbody>
113
-				<?php echo wp_kses_post( implode( '', $table_body ) ); ?>
113
+				<?php echo wp_kses_post(implode('', $table_body)); ?>
114 114
 			</tbody>
115 115
 		</table>
116 116
 	</div>
Please login to merge, or discard this patch.
templates/table-exercise-data.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -9,47 +9,47 @@
 block discarded – undo
9 9
 <table class="exercise-table">
10 10
 	<tbody>
11 11
 		<?php
12
-		if ( ! empty( $type ) ) {
13
-		?>
12
+          if ( ! empty( $type ) ) {
13
+          ?>
14 14
 			<tr class="types">
15 15
 				<td><?php esc_html_e( 'Type:', 'lsx-health-plan' ); ?>&nbsp;</td>
16 16
 				<td>
17 17
 				<?php
18
-					echo wp_kses_post( $type );
19
-				?>
18
+                         echo wp_kses_post( $type );
19
+                    ?>
20 20
 				</td>
21 21
 			</tr>
22 22
 		<?php
23
-		}
24
-		?>
23
+          }
24
+          ?>
25 25
 		<?php
26
-		if ( ! empty( $muscle_group ) ) {
27
-		?>
26
+          if ( ! empty( $muscle_group ) ) {
27
+          ?>
28 28
 			<tr class="muscle-group">
29 29
 				<td><?php esc_html_e( 'Muscle:', 'lsx-health-plan' ); ?>&nbsp;</td>
30 30
 				<td>
31 31
 				<?php
32
-					echo wp_kses_post( $muscle_group );
33
-				?>
32
+                         echo wp_kses_post( $muscle_group );
33
+                    ?>
34 34
 				</td>
35 35
 			</tr>
36 36
 		<?php
37
-		}
38
-		?>
37
+          }
38
+          ?>
39 39
 		<?php
40
-		if ( ! empty( $equipment ) ) {
41
-		?>
40
+          if ( ! empty( $equipment ) ) {
41
+          ?>
42 42
 			<tr class="equipment">
43 43
 				<td><?php esc_html_e( 'Equipment:', 'lsx-health-plan' ); ?>&nbsp;</td>
44 44
 				<td>
45 45
 				<?php
46
-					echo wp_kses_post( $equipment );
47
-				?>
46
+                         echo wp_kses_post( $equipment );
47
+                    ?>
48 48
 				</td>
49 49
 			</tr>
50 50
 		<?php
51
-		}
52
-		?>
51
+          }
52
+          ?>
53 53
 	</tbody>
54 54
 </table>
55 55
 <?php } ?>
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -5,17 +5,17 @@  discard block
 block discarded – undo
5 5
 $muscle_group = lsx_health_plan_muscle_group_equipment();
6 6
 
7 7
 ?>
8
-<?php if ( ( ! empty( $type ) ) || ( ! empty( $equipment ) ) || ( ! empty( $muscle_group ) ) ) { ?>
8
+<?php if (( ! empty($type)) || ( ! empty($equipment)) || ( ! empty($muscle_group))) { ?>
9 9
 <table class="exercise-table">
10 10
 	<tbody>
11 11
 		<?php
12
-		if ( ! empty( $type ) ) {
12
+		if ( ! empty($type)) {
13 13
 		?>
14 14
 			<tr class="types">
15
-				<td><?php esc_html_e( 'Type:', 'lsx-health-plan' ); ?>&nbsp;</td>
15
+				<td><?php esc_html_e('Type:', 'lsx-health-plan'); ?>&nbsp;</td>
16 16
 				<td>
17 17
 				<?php
18
-					echo wp_kses_post( $type );
18
+					echo wp_kses_post($type);
19 19
 				?>
20 20
 				</td>
21 21
 			</tr>
@@ -23,13 +23,13 @@  discard block
 block discarded – undo
23 23
 		}
24 24
 		?>
25 25
 		<?php
26
-		if ( ! empty( $muscle_group ) ) {
26
+		if ( ! empty($muscle_group)) {
27 27
 		?>
28 28
 			<tr class="muscle-group">
29
-				<td><?php esc_html_e( 'Muscle:', 'lsx-health-plan' ); ?>&nbsp;</td>
29
+				<td><?php esc_html_e('Muscle:', 'lsx-health-plan'); ?>&nbsp;</td>
30 30
 				<td>
31 31
 				<?php
32
-					echo wp_kses_post( $muscle_group );
32
+					echo wp_kses_post($muscle_group);
33 33
 				?>
34 34
 				</td>
35 35
 			</tr>
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
 		}
38 38
 		?>
39 39
 		<?php
40
-		if ( ! empty( $equipment ) ) {
40
+		if ( ! empty($equipment)) {
41 41
 		?>
42 42
 			<tr class="equipment">
43
-				<td><?php esc_html_e( 'Equipment:', 'lsx-health-plan' ); ?>&nbsp;</td>
43
+				<td><?php esc_html_e('Equipment:', 'lsx-health-plan'); ?>&nbsp;</td>
44 44
 				<td>
45 45
 				<?php
46
-					echo wp_kses_post( $equipment );
46
+					echo wp_kses_post($equipment);
47 47
 				?>
48 48
 				</td>
49 49
 			</tr>
Please login to merge, or discard this patch.
includes/template-tags/exercise.php 2 patches
Indentation   +176 added lines, -176 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: ' . $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: ' . $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', 'lsx-health-plan' ) . ': ' . $equipment_group . '</span>';
177
-		}
178
-		if ( ! empty( $muscle_group ) ) {
179
-			$modal_body .= '<span class="muscle-terms">' . __( 'Muscle', 'lsx-health-plan' ) . ': ' . $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-health-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', 'lsx-health-plan' ) . ': ' . $equipment_group . '</span>';
177
+          }
178
+          if ( ! empty( $muscle_group ) ) {
179
+               $modal_body .= '<span class="muscle-terms">' . __( 'Muscle', 'lsx-health-plan' ) . ': ' . $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-health-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: ' . $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: ' . $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,25 +246,25 @@  discard block
 block discarded – undo
246 246
  * @return string
247 247
  */
248 248
 function lsx_health_plan_exercise_title( $before = '', $after = '', $url = true, $echo = true, $exercise_id = false ) {
249
-	if ( false === $exercise_id ) {
250
-		$exercise_id = get_the_ID();
251
-	}
252
-	$link  = get_the_permalink( $exercise_id );
253
-	$title = get_the_title( $exercise_id );
254
-	$side  = get_post_meta( $exercise_id, 'exercise_side', true );
255
-	if ( '' !== $side ) {
256
-		$title .= ' - ' . ucwords( $side );
257
-	}
258
-	$link_before = '';
259
-	$link_after  = '';
260
-	if ( true === $url ) {
261
-		$link_before = '<a href="' . $link . '">';
262
-		$link_after  = '</a>';
263
-	}
264
-	$title = apply_filters( 'lsx_health_plan_exercise_title', $before . $link_before  . $title . $link_after . $after, $title, $before, $after, $exercise_id );
265
-	if ( true === $echo ) {
266
-		echo wp_kses_post( $title );
267
-	} else {
268
-		return $title;
269
-	}
249
+     if ( false === $exercise_id ) {
250
+          $exercise_id = get_the_ID();
251
+     }
252
+     $link  = get_the_permalink( $exercise_id );
253
+     $title = get_the_title( $exercise_id );
254
+     $side  = get_post_meta( $exercise_id, 'exercise_side', true );
255
+     if ( '' !== $side ) {
256
+          $title .= ' - ' . ucwords( $side );
257
+     }
258
+     $link_before = '';
259
+     $link_after  = '';
260
+     if ( true === $url ) {
261
+          $link_before = '<a href="' . $link . '">';
262
+          $link_after  = '</a>';
263
+     }
264
+     $title = apply_filters( 'lsx_health_plan_exercise_title', $before . $link_before  . $title . $link_after . $after, $title, $before, $after, $exercise_id );
265
+     if ( true === $echo ) {
266
+          echo wp_kses_post( $title );
267
+     } else {
268
+          return $title;
269
+     }
270 270
 }
Please login to merge, or discard this patch.
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
  * @return exercise_type
12 12
  */
13 13
 function lsx_health_plan_exercise_type() {
14
-	$term_obj_list = get_the_term_list( get_the_ID(), 'exercise-type', '', ', ' );
15
-	if ( ! empty( $term_obj_list ) ) {
14
+	$term_obj_list = get_the_term_list(get_the_ID(), 'exercise-type', '', ', ');
15
+	if ( ! empty($term_obj_list)) {
16 16
 		return $term_obj_list;
17 17
 	}
18 18
 }
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
  * @return muscle_group_equipment
24 24
  */
25 25
 function lsx_health_plan_muscle_group_equipment() {
26
-	$term_obj_list = get_the_term_list( get_the_ID(), 'muscle-group', '', ', ' );
27
-	if ( ! empty( $term_obj_list ) ) {
26
+	$term_obj_list = get_the_term_list(get_the_ID(), 'muscle-group', '', ', ');
27
+	if ( ! empty($term_obj_list)) {
28 28
 		return $term_obj_list;
29 29
 	}
30 30
 }
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
  * @return exercise_equipment
36 36
  */
37 37
 function lsx_health_plan_exercise_equipment() {
38
-	$term_obj_list = get_the_term_list( get_the_ID(), 'equipment', '', ', ' );
39
-	if ( ! empty( $term_obj_list ) ) {
38
+	$term_obj_list = get_the_term_list(get_the_ID(), 'equipment', '', ', ');
39
+	if ( ! empty($term_obj_list)) {
40 40
 		return $term_obj_list;
41 41
 	}
42 42
 }
@@ -50,74 +50,74 @@  discard block
 block discarded – undo
50 50
 	include LSX_HEALTH_PLAN_PATH . '/templates/table-exercise-data.php';
51 51
 }
52 52
 
53
-function lsx_health_plan_workout_exercise_alt_button( $m, $group, $echo = true, $args = array(), $alt_title, $alt_description, $alt_image ) {
53
+function lsx_health_plan_workout_exercise_alt_button($m, $group, $echo = true, $args = array(), $alt_title, $alt_description, $alt_image) {
54 54
 	$defaults = array(
55 55
 		'modal_trigger' => 'button',
56 56
 		'modal_content' => 'excerpt',
57 57
 	);
58
-	$args     = wp_parse_args( $args, $defaults );
58
+	$args = wp_parse_args($args, $defaults);
59 59
 
60 60
 	$exercise_id = '';
61
-	if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) {
62
-		$exercise_id     = esc_html( $group['connected_exercises'] );
63
-		$content         = get_post_field( 'post_content', $exercise_id );
64
-		$url             = get_permalink( $exercise_id );
65
-		$equipment_group = get_the_term_list( $exercise_id, 'equipment', '', ', ' );
66
-		$muscle_group    = get_the_term_list( $exercise_id, 'muscle-group', '', ', ' );
61
+	if (isset($group['connected_exercises']) && '' !== $group['connected_exercises']) {
62
+		$exercise_id     = esc_html($group['connected_exercises']);
63
+		$content         = get_post_field('post_content', $exercise_id);
64
+		$url             = get_permalink($exercise_id);
65
+		$equipment_group = get_the_term_list($exercise_id, 'equipment', '', ', ');
66
+		$muscle_group    = get_the_term_list($exercise_id, 'muscle-group', '', ', ');
67 67
 		$lsx_hp          = lsx_health_plan();
68 68
 
69
-		if ( 'excerpt' === $args['modal_content'] ) {
70
-			$content = wp_trim_words( $content, 40 );
69
+		if ('excerpt' === $args['modal_content']) {
70
+			$content = wp_trim_words($content, 40);
71 71
 		}
72 72
 
73
-		if ( 'link' ) {
74
-			$play_button = '<a data-toggle="modal" href="#workout-alt-exercise-modal-' . $m . '">' . get_the_title( $exercise_id ) . '</a>';
73
+		if ('link') {
74
+			$play_button = '<a data-toggle="modal" href="#workout-alt-exercise-modal-' . $m . '">' . get_the_title($exercise_id) . '</a>';
75 75
 		} else {
76 76
 			$play_button = '<button data-toggle="alt-modal" data-target="#workout-alt-exercise-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>';
77 77
 		}
78 78
 
79
-		$modal_body  = '';
79
+		$modal_body = '';
80 80
 
81
-		if ( '' !== $alt_image && ! empty( $alt_image ) ) {
81
+		if ('' !== $alt_image && ! empty($alt_image)) {
82 82
 			$modal_body .= '<div class="modal-image"/><img alt="thumbnail" loading="lazy" class="aligncenter wp-post-image" src="' . $alt_image . '"></div>';
83 83
 		} else {
84
-			if ( $lsx_hp->frontend->gallery->has_gallery( $exercise_id ) ) {
84
+			if ($lsx_hp->frontend->gallery->has_gallery($exercise_id)) {
85 85
 				$gallery_args = array(
86 86
 					'css_class' => 'modal-slider',
87 87
 				);
88
-				$modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args );
88
+				$modal_body .= $lsx_hp->frontend->gallery->get_gallery('', '', $gallery_args);
89 89
 			} else {
90
-				$modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail( $exercise_id, 'large' ) . '</div>';
90
+				$modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail($exercise_id, 'large') . '</div>';
91 91
 			}
92 92
 		}
93 93
 
94
-		if ( '' !== $alt_title ) {
94
+		if ('' !== $alt_title) {
95 95
 			$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . $alt_title . '</h5>';
96 96
 		} else {
97
-			$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title( $exercise_id ) . '</h5>';
97
+			$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title($exercise_id) . '</h5>';
98 98
 		}
99 99
 
100
-		if ( ! empty( $equipment_group ) ) {
100
+		if ( ! empty($equipment_group)) {
101 101
 			$modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>';
102 102
 		}
103
-		if ( ! empty( $muscle_group ) ) {
103
+		if ( ! empty($muscle_group)) {
104 104
 			$modal_body .= '<span class="muscle-terms">Muscle: ' . $muscle_group . '</span>';
105 105
 		}
106 106
 		$modal_body .= '</div>';
107
-		if ( '' !== $args['modal_content'] ) {
108
-			if ( '' !== $alt_description ) {
107
+		if ('' !== $args['modal_content']) {
108
+			if ('' !== $alt_description) {
109 109
 				$modal_body .= '<div class="modal-excerpt"/>' . $alt_description . '</div>';
110 110
 			} else {
111 111
 				$modal_body .= '<div class="modal-excerpt"/>' . $content . '</div>';
112 112
 			}
113 113
 		}
114
-		if ( 'excerpt' === $args['modal_content'] ) {
115
-			$modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __( 'Read More', 'lsx-heal-plan' ) . '</a>';
114
+		if ('excerpt' === $args['modal_content']) {
115
+			$modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __('Read More', 'lsx-heal-plan') . '</a>';
116 116
 		}
117
-		\lsx_health_plan\functions\register_modal( 'workout-alt-exercise-modal-' . $m, '', $modal_body );
117
+		\lsx_health_plan\functions\register_modal('workout-alt-exercise-modal-' . $m, '', $modal_body);
118 118
 
119
-		if ( true === $echo ) {
120
-			echo wp_kses_post( $play_button );
119
+		if (true === $echo) {
120
+			echo wp_kses_post($play_button);
121 121
 		} else {
122 122
 			return $play_button;
123 123
 		}
@@ -133,62 +133,62 @@  discard block
 block discarded – undo
133 133
  * @param array   $args
134 134
  * @return void
135 135
  */
136
-function lsx_health_plan_workout_exercise_button( $m, $group, $echo = true, $args = array() ) {
136
+function lsx_health_plan_workout_exercise_button($m, $group, $echo = true, $args = array()) {
137 137
 	$defaults = array(
138 138
 		'modal_trigger' => 'button',
139 139
 		'modal_content' => 'excerpt',
140 140
 	);
141
-	$args     = wp_parse_args( $args, $defaults );
141
+	$args = wp_parse_args($args, $defaults);
142 142
 
143 143
 	$exercise_id = '';
144
-	if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) {
145
-		$exercise_id     = esc_html( $group['connected_exercises'] );
146
-		$content         = get_post_field( 'post_content', $exercise_id );
147
-		$url             = get_permalink( $exercise_id );
148
-		$equipment_group = get_the_term_list( $exercise_id, 'equipment', '', ', ' );
149
-		$muscle_group    = get_the_term_list( $exercise_id, 'muscle-group', '', ', ' );
144
+	if (isset($group['connected_exercises']) && '' !== $group['connected_exercises']) {
145
+		$exercise_id     = esc_html($group['connected_exercises']);
146
+		$content         = get_post_field('post_content', $exercise_id);
147
+		$url             = get_permalink($exercise_id);
148
+		$equipment_group = get_the_term_list($exercise_id, 'equipment', '', ', ');
149
+		$muscle_group    = get_the_term_list($exercise_id, 'muscle-group', '', ', ');
150 150
 		$lsx_hp          = lsx_health_plan();
151 151
 
152
-		if ( 'excerpt' === $args['modal_content'] ) {
153
-			$content = wp_trim_words( $content, 40 );
152
+		if ('excerpt' === $args['modal_content']) {
153
+			$content = wp_trim_words($content, 40);
154 154
 		}
155 155
 
156
-		if ( 'link' ) {
157
-			$play_button = '<a data-toggle="modal" href="#workout-exercise-modal-' . $m . '">' . get_the_title( $exercise_id ) . '</a>';
156
+		if ('link') {
157
+			$play_button = '<a data-toggle="modal" href="#workout-exercise-modal-' . $m . '">' . get_the_title($exercise_id) . '</a>';
158 158
 		} else {
159 159
 			$play_button = '<button data-toggle="modal" data-target="#workout-exercise-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>';
160 160
 		}
161 161
 
162
-		$modal_body  = '';
162
+		$modal_body = '';
163 163
 
164
-		if ( $lsx_hp->frontend->gallery->has_gallery( $exercise_id ) ) {
164
+		if ($lsx_hp->frontend->gallery->has_gallery($exercise_id)) {
165 165
 			$gallery_args = array(
166 166
 				'css_class' => 'modal-slider',
167 167
 			);
168
-			$modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args );
168
+			$modal_body .= $lsx_hp->frontend->gallery->get_gallery('', '', $gallery_args);
169 169
 		} else {
170
-			$modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail( $exercise_id, 'large' ) . '</div>';
170
+			$modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail($exercise_id, 'large') . '</div>';
171 171
 		}
172 172
 
173
-		$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title( $exercise_id ) . '</h5>';
173
+		$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title($exercise_id) . '</h5>';
174 174
 
175
-		if ( ! empty( $equipment_group ) ) {
176
-			$modal_body .= '<span class="equipment-terms">' . __( 'Equipment', 'lsx-health-plan' ) . ': ' . $equipment_group . '</span>';
175
+		if ( ! empty($equipment_group)) {
176
+			$modal_body .= '<span class="equipment-terms">' . __('Equipment', 'lsx-health-plan') . ': ' . $equipment_group . '</span>';
177 177
 		}
178
-		if ( ! empty( $muscle_group ) ) {
179
-			$modal_body .= '<span class="muscle-terms">' . __( 'Muscle', 'lsx-health-plan' ) . ': ' . $muscle_group . '</span>';
178
+		if ( ! empty($muscle_group)) {
179
+			$modal_body .= '<span class="muscle-terms">' . __('Muscle', 'lsx-health-plan') . ': ' . $muscle_group . '</span>';
180 180
 		}
181 181
 		$modal_body .= '</div>';
182
-		if ( '' !== $args['modal_content'] ) {
182
+		if ('' !== $args['modal_content']) {
183 183
 			$modal_body .= '<div class="modal-excerpt"/>' . $content . '</div>';
184 184
 		}
185
-		if ( 'excerpt' === $args['modal_content'] ) {
186
-			$modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __( 'Read More', 'lsx-health-plan' ) . '</a>';
185
+		if ('excerpt' === $args['modal_content']) {
186
+			$modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __('Read More', 'lsx-health-plan') . '</a>';
187 187
 		}
188
-		\lsx_health_plan\functions\register_modal( 'workout-exercise-modal-' . $m, '', $modal_body );
188
+		\lsx_health_plan\functions\register_modal('workout-exercise-modal-' . $m, '', $modal_body);
189 189
 
190
-		if ( true === $echo ) {
191
-			echo wp_kses_post( $play_button );
190
+		if (true === $echo) {
191
+			echo wp_kses_post($play_button);
192 192
 		} else {
193 193
 			return $play_button;
194 194
 		}
@@ -202,39 +202,39 @@  discard block
 block discarded – undo
202 202
  * @param array $group
203 203
  * @return void
204 204
  */
205
-function lsx_health_plan_shortcode_exercise_button( $m, $content = true ) {
206
-	$equipment_group = get_the_term_list( $m, 'equipment', '', ', ' );
207
-	$muscle_group    = get_the_term_list( $m, 'muscle-group', '', ', ' );
205
+function lsx_health_plan_shortcode_exercise_button($m, $content = true) {
206
+	$equipment_group = get_the_term_list($m, 'equipment', '', ', ');
207
+	$muscle_group    = get_the_term_list($m, 'muscle-group', '', ', ');
208 208
 	$title           = get_the_title();
209 209
 	$lsx_hp          = lsx_health_plan();
210
-	$button     = '<a data-toggle="modal" href="#exercise-modal-' . $m . '" data-target="#exercise-modal-' . $m . '"></a>';
210
+	$button = '<a data-toggle="modal" href="#exercise-modal-' . $m . '" data-target="#exercise-modal-' . $m . '"></a>';
211 211
 
212
-	if ( true === $content ) {
212
+	if (true === $content) {
213 213
 		$content = get_the_content();
214 214
 	}
215 215
 
216 216
 	$modal_body = '';
217
-	if ( $lsx_hp->frontend->gallery->has_gallery( $m ) ) {
217
+	if ($lsx_hp->frontend->gallery->has_gallery($m)) {
218 218
 		$gallery_args = array(
219 219
 			'css_class' => 'modal-slider',
220 220
 		);
221
-		$modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args );
221
+		$modal_body .= $lsx_hp->frontend->gallery->get_gallery('', '', $gallery_args);
222 222
 	} else {
223
-		$modal_body .= '<div class="modal-image">' . get_the_post_thumbnail( $m, 'large' ) . '</div>';
223
+		$modal_body .= '<div class="modal-image">' . get_the_post_thumbnail($m, 'large') . '</div>';
224 224
 	}
225 225
 	$modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . $title . '</h5>';
226 226
 
227
-	if ( ! empty( $equipment_group ) ) {
227
+	if ( ! empty($equipment_group)) {
228 228
 		$modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>';
229 229
 	}
230
-	if ( ! empty( $muscle_group ) ) {
230
+	if ( ! empty($muscle_group)) {
231 231
 		$modal_body .= '<span class="muscle-terms">Muscle: ' . $muscle_group . '</span>';
232 232
 	}
233 233
 	$modal_body .= '</div>';
234 234
 	$modal_body .= $content;
235
-	\lsx_health_plan\functions\register_modal( 'exercise-modal-' . $m, '', $modal_body );
235
+	\lsx_health_plan\functions\register_modal('exercise-modal-' . $m, '', $modal_body);
236 236
 
237
-	return ( $button );
237
+	return ($button);
238 238
 }
239 239
 
240 240
 /**
@@ -245,25 +245,25 @@  discard block
 block discarded – undo
245 245
  * @param  boolean $echo
246 246
  * @return string
247 247
  */
248
-function lsx_health_plan_exercise_title( $before = '', $after = '', $url = true, $echo = true, $exercise_id = false ) {
249
-	if ( false === $exercise_id ) {
248
+function lsx_health_plan_exercise_title($before = '', $after = '', $url = true, $echo = true, $exercise_id = false) {
249
+	if (false === $exercise_id) {
250 250
 		$exercise_id = get_the_ID();
251 251
 	}
252
-	$link  = get_the_permalink( $exercise_id );
253
-	$title = get_the_title( $exercise_id );
254
-	$side  = get_post_meta( $exercise_id, 'exercise_side', true );
255
-	if ( '' !== $side ) {
256
-		$title .= ' - ' . ucwords( $side );
252
+	$link  = get_the_permalink($exercise_id);
253
+	$title = get_the_title($exercise_id);
254
+	$side  = get_post_meta($exercise_id, 'exercise_side', true);
255
+	if ('' !== $side) {
256
+		$title .= ' - ' . ucwords($side);
257 257
 	}
258 258
 	$link_before = '';
259 259
 	$link_after  = '';
260
-	if ( true === $url ) {
260
+	if (true === $url) {
261 261
 		$link_before = '<a href="' . $link . '">';
262 262
 		$link_after  = '</a>';
263 263
 	}
264
-	$title = apply_filters( 'lsx_health_plan_exercise_title', $before . $link_before  . $title . $link_after . $after, $title, $before, $after, $exercise_id );
265
-	if ( true === $echo ) {
266
-		echo wp_kses_post( $title );
264
+	$title = apply_filters('lsx_health_plan_exercise_title', $before . $link_before . $title . $link_after . $after, $title, $before, $after, $exercise_id);
265
+	if (true === $echo) {
266
+		echo wp_kses_post($title);
267 267
 	} else {
268 268
 		return $title;
269 269
 	}
Please login to merge, or discard this patch.
classes/frontend/class-gallery.php 2 patches
Indentation   +232 added lines, -232 removed lines patch added patch discarded remove patch
@@ -8,263 +8,263 @@
 block discarded – undo
8 8
  */
9 9
 class Gallery {
10 10
 
11
-	/**
12
-	 * Holds class instance
13
-	 *
14
-	 * @var object \lsx_health_plan\classes\lib\Gallery()
15
-	 */
16
-	protected static $instance = null;
11
+     /**
12
+      * Holds class instance
13
+      *
14
+      * @var object \lsx_health_plan\classes\lib\Gallery()
15
+      */
16
+     protected static $instance = null;
17 17
 
18
-	/**
19
-	 * The current item ID.
20
-	 *
21
-	 * @var boolean | int
22
-	 */
23
-	public $item_id = false;
18
+     /**
19
+      * The current item ID.
20
+      *
21
+      * @var boolean | int
22
+      */
23
+     public $item_id = false;
24 24
 
25
-	/**
26
-	 * The current item post_type used in the custom field retrival..
27
-	 *
28
-	 * @var boolean | int
29
-	 */
30
-	public $post_type = false;
25
+     /**
26
+      * The current item post_type used in the custom field retrival..
27
+      *
28
+      * @var boolean | int
29
+      */
30
+     public $post_type = false;
31 31
 
32
-	/**
33
-	 * Holds the the default parameters for the gallery output.
34
-	 *
35
-	 * @var array
36
-	 */
37
-	public $defaults = array();
32
+     /**
33
+      * Holds the the default parameters for the gallery output.
34
+      *
35
+      * @var array
36
+      */
37
+     public $defaults = array();
38 38
 
39
-	/**
40
-	 * If the current post has a gallery.
41
-	 *
42
-	 * @var boolean
43
-	 */
44
-	public $has_gallery = false;
39
+     /**
40
+      * If the current post has a gallery.
41
+      *
42
+      * @var boolean
43
+      */
44
+     public $has_gallery = false;
45 45
 
46
-	/**
47
-	 * Holds the array of gallery images.
48
-	 *
49
-	 * @var array
50
-	 */
51
-	public $gallery = array();
46
+     /**
47
+      * Holds the array of gallery images.
48
+      *
49
+      * @var array
50
+      */
51
+     public $gallery = array();
52 52
 
53
-	/**
54
-	 * Holds the html for the current gallery being output.
55
-	 *
56
-	 * @var array
57
-	 */
58
-	public $html = array();
53
+     /**
54
+      * Holds the html for the current gallery being output.
55
+      *
56
+      * @var array
57
+      */
58
+     public $html = array();
59 59
 
60
-	/**
61
-	 * Holds the parameters for the current gallery being output.
62
-	 *
63
-	 * @var array
64
-	 */
65
-	public $args = array();
60
+     /**
61
+      * Holds the parameters for the current gallery being output.
62
+      *
63
+      * @var array
64
+      */
65
+     public $args = array();
66 66
 
67
-	/**
68
-	 * Constructor
69
-	 */
70
-	public function __construct() {
71
-	}
67
+     /**
68
+      * Constructor
69
+      */
70
+     public function __construct() {
71
+     }
72 72
 
73
-	/**
74
-	 * Return an instance of this class.
75
-	 *
76
-	 * @since 1.0.0
77
-	 *
78
-	 * @return    object \lsx_health_plan\classes\lib\Gallery()    A single instance of this class.
79
-	 */
80
-	public static function get_instance() {
81
-		// If the single instance hasn't been set, set it now.
82
-		if ( null === self::$instance ) {
83
-			self::$instance = new self();
84
-		}
85
-		return self::$instance;
86
-	}
73
+     /**
74
+      * Return an instance of this class.
75
+      *
76
+      * @since 1.0.0
77
+      *
78
+      * @return    object \lsx_health_plan\classes\lib\Gallery()    A single instance of this class.
79
+      */
80
+     public static function get_instance() {
81
+          // If the single instance hasn't been set, set it now.
82
+          if ( null === self::$instance ) {
83
+               self::$instance = new self();
84
+          }
85
+          return self::$instance;
86
+     }
87 87
 
88
-	/**
89
-	 * Check if the item has a gallery of images returns true or false.
90
-	 *
91
-	 * @param  string $item_id
92
-	 * @param  string $post_type
93
-	 * @return boolean
94
-	 */
95
-	public function has_gallery( $item_id = '', $post_type = '' ) {
96
-		if ( '' === $item_id ) {
97
-			$this->item_id = get_the_ID();
98
-		} else {
99
-			$this->item_id = $item_id;
100
-		}
101
-		$this->has_gallery = false;
102
-		if ( '' === $post_type ) {
103
-			$this->post_type = get_post_type( $this->item_id );
104
-		}
105
-		$gallery = get_post_meta( $this->item_id, $this->post_type . '_gallery', true );
88
+     /**
89
+      * Check if the item has a gallery of images returns true or false.
90
+      *
91
+      * @param  string $item_id
92
+      * @param  string $post_type
93
+      * @return boolean
94
+      */
95
+     public function has_gallery( $item_id = '', $post_type = '' ) {
96
+          if ( '' === $item_id ) {
97
+               $this->item_id = get_the_ID();
98
+          } else {
99
+               $this->item_id = $item_id;
100
+          }
101
+          $this->has_gallery = false;
102
+          if ( '' === $post_type ) {
103
+               $this->post_type = get_post_type( $this->item_id );
104
+          }
105
+          $gallery = get_post_meta( $this->item_id, $this->post_type . '_gallery', true );
106 106
 
107
-		if ( ! empty( $gallery ) && ( '' !== $gallery ) ) {
108
-			$this->gallery     = $gallery;
109
-			$this->has_gallery = true;
110
-			wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/src/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
111
-			wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/src/lsx-health-plan-slider.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true );
112
-		}
113
-		return $this->has_gallery;
114
-	}
107
+          if ( ! empty( $gallery ) && ( '' !== $gallery ) ) {
108
+               $this->gallery     = $gallery;
109
+               $this->has_gallery = true;
110
+               wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/src/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
111
+               wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/src/lsx-health-plan-slider.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true );
112
+          }
113
+          return $this->has_gallery;
114
+     }
115 115
 
116
-	/**
117
-	 * Returns the defaults for the gallery, after grabbing the setting from the item.
118
-	 *
119
-	 * @param  string $item_id
120
-	 * @param  string $post_type
121
-	 * @return array
122
-	 */
123
-	public function get_defaults( $item_id = '', $post_type = '' ) {
124
-		if ( '' === $item_id ) {
125
-			$item_id = $this->item_id;
126
-		}
127
-		if ( '' === $post_type ) {
128
-			$post_type = $this->post_type;
129
-		}
130
-		$this->defaults = array(
131
-			'columns'   => '3',
132
-			'layout'    => 'slider',
133
-			'interval'  => false,
134
-			'css_class' => false,
135
-		);
136
-		foreach ( $this->defaults as $key => $default ) {
137
-			$override = get_post_meta( $item_id, $this->post_type . '_gallery_' . $key, true );
138
-			if ( '' !== $override && false !== $override && ! empty( $override ) ) {
139
-				$this->defaults[ $key ] = $override;
140
-			}
141
-		}
142
-		return $this->defaults;
143
-	}
116
+     /**
117
+      * Returns the defaults for the gallery, after grabbing the setting from the item.
118
+      *
119
+      * @param  string $item_id
120
+      * @param  string $post_type
121
+      * @return array
122
+      */
123
+     public function get_defaults( $item_id = '', $post_type = '' ) {
124
+          if ( '' === $item_id ) {
125
+               $item_id = $this->item_id;
126
+          }
127
+          if ( '' === $post_type ) {
128
+               $post_type = $this->post_type;
129
+          }
130
+          $this->defaults = array(
131
+               'columns'   => '3',
132
+               'layout'    => 'slider',
133
+               'interval'  => false,
134
+               'css_class' => false,
135
+          );
136
+          foreach ( $this->defaults as $key => $default ) {
137
+               $override = get_post_meta( $item_id, $this->post_type . '_gallery_' . $key, true );
138
+               if ( '' !== $override && false !== $override && ! empty( $override ) ) {
139
+                    $this->defaults[ $key ] = $override;
140
+               }
141
+          }
142
+          return $this->defaults;
143
+     }
144 144
 
145
-	/**
146
-	 * Gets and returns the gallery html.
147
-	 *
148
-	 * @param string $item_id
149
-	 * @param string $post_type
150
-	 * @return void
151
-	 */
152
-	public function get_gallery( $item_id = '', $post_type = '', $args = array() ) {
153
-		$return     = '';
154
-		$this->html = array();
155
-		$this->args = wp_parse_args( $args, $this->get_defaults( $item_id, $post_type ) );
156
-		if ( ! empty( $this->gallery ) ) {
157
-			$this->args['count'] = 1;
158
-			if ( '' !== $post_type ) {
159
-				$this->args['post_type'] = $post_type;
160
-			} else {
161
-				$this->args['post_type'] = $this->post_type;
162
-			}
145
+     /**
146
+      * Gets and returns the gallery html.
147
+      *
148
+      * @param string $item_id
149
+      * @param string $post_type
150
+      * @return void
151
+      */
152
+     public function get_gallery( $item_id = '', $post_type = '', $args = array() ) {
153
+          $return     = '';
154
+          $this->html = array();
155
+          $this->args = wp_parse_args( $args, $this->get_defaults( $item_id, $post_type ) );
156
+          if ( ! empty( $this->gallery ) ) {
157
+               $this->args['count'] = 1;
158
+               if ( '' !== $post_type ) {
159
+                    $this->args['post_type'] = $post_type;
160
+               } else {
161
+                    $this->args['post_type'] = $this->post_type;
162
+               }
163 163
 
164
-			// output the opening boostrap row divs.
165
-			$this->before_loop();
164
+               // output the opening boostrap row divs.
165
+               $this->before_loop();
166 166
 
167
-			foreach ( $this->gallery as $key => $gallery ) {
167
+               foreach ( $this->gallery as $key => $gallery ) {
168 168
 
169
-				$this->loop_start();
169
+                    $this->loop_start();
170 170
 
171
-				if ( isset( $gallery['exercise_gallery_image_id'] ) && ! empty( $gallery['exercise_gallery_image_id'] ) ) {
172
-					$size         = apply_filters( 'lsx_hp_exercise_gallery_size', 'full' );
173
-					$thumbnail    = wp_get_attachment_image( $gallery['exercise_gallery_image_id'], $size );
174
-					$this->html[] = $thumbnail;
175
-				} elseif ( isset( $gallery['exercise_gallery_external'] ) && ! empty( $gallery['exercise_gallery_external'] ) ) {
176
-					$this->html[] = $gallery['exercise_gallery_external']; // WPCS: XSS OK.
177
-				} elseif ( isset( $gallery['exercise_gallery_embed'] ) && ! empty( $gallery['exercise_gallery_embed'] ) ) {
178
-					$embed_args = array(
179
-						'width' => '530',
180
-					);
181
-					$embed        = wp_oembed_get( $gallery['exercise_gallery_embed'], $embed_args );
182
-					$this->html[] = str_replace( 'width="530"', 'width="100%"', $embed ); // WPCS: XSS OK.
183
-				}
171
+                    if ( isset( $gallery['exercise_gallery_image_id'] ) && ! empty( $gallery['exercise_gallery_image_id'] ) ) {
172
+                         $size         = apply_filters( 'lsx_hp_exercise_gallery_size', 'full' );
173
+                         $thumbnail    = wp_get_attachment_image( $gallery['exercise_gallery_image_id'], $size );
174
+                         $this->html[] = $thumbnail;
175
+                    } elseif ( isset( $gallery['exercise_gallery_external'] ) && ! empty( $gallery['exercise_gallery_external'] ) ) {
176
+                         $this->html[] = $gallery['exercise_gallery_external']; // WPCS: XSS OK.
177
+                    } elseif ( isset( $gallery['exercise_gallery_embed'] ) && ! empty( $gallery['exercise_gallery_embed'] ) ) {
178
+                         $embed_args = array(
179
+                              'width' => '530',
180
+                         );
181
+                         $embed        = wp_oembed_get( $gallery['exercise_gallery_embed'], $embed_args );
182
+                         $this->html[] = str_replace( 'width="530"', 'width="100%"', $embed ); // WPCS: XSS OK.
183
+                    }
184 184
 
185
-				$this->loop_end();
185
+                    $this->loop_end();
186 186
 
187
-				$this->args['count']++;
188
-			}
187
+                    $this->args['count']++;
188
+               }
189 189
 
190
-			// output the closing boostrap row divs.
191
-			$this->after_loop();
192
-		}
190
+               // output the closing boostrap row divs.
191
+               $this->after_loop();
192
+          }
193 193
 
194
-		// Join the html output if its not empty.
195
-		if ( ! empty( $this->html ) ) {
196
-			$return = implode( '', $this->html );
197
-		}
198
-		return $return;
199
-	}
194
+          // Join the html output if its not empty.
195
+          if ( ! empty( $this->html ) ) {
196
+               $return = implode( '', $this->html );
197
+          }
198
+          return $return;
199
+     }
200 200
 
201
-	/**
202
-	 * Outputs the CSS class for the panels
203
-	 *
204
-	 * @param string $columns
205
-	 * @return string
206
-	 */
207
-	public function column_class() {
208
-		$cols  = 'col-xs-12 col-sm-';
209
-		$cols .= '5' === $this->args['columns'] ? '15' : 12 / $this->args['columns'];
210
-		return $cols;
211
-	}
201
+     /**
202
+      * Outputs the CSS class for the panels
203
+      *
204
+      * @param string $columns
205
+      * @return string
206
+      */
207
+     public function column_class() {
208
+          $cols  = 'col-xs-12 col-sm-';
209
+          $cols .= '5' === $this->args['columns'] ? '15' : 12 / $this->args['columns'];
210
+          return $cols;
211
+     }
212 212
 
213
-	/**
214
-	 * Runs just after the if and before the while statement in $this->output()
215
-	 */
216
-	public function before_loop() {
217
-		if ( 'slider' === $this->args['layout'] ) {
218
-			$this->carousel_id = wp_rand( 20, 20000 );
219
-			$this->html[]      = "<div class='lsx-hp-widget-items slick-slider slick-dotted slick-has-arrows {$this->args['css_class']} ' data-interval='{$this->args['interval']}' data-slick='{ \"slidesToShow\": 1, \"slidesToScroll\": 1'>";
220
-		} else {
221
-			$this->html[] = "<div class='lsx-hp-widget-items widget-item-grid-layout'>";
222
-		}
223
-	}
213
+     /**
214
+      * Runs just after the if and before the while statement in $this->output()
215
+      */
216
+     public function before_loop() {
217
+          if ( 'slider' === $this->args['layout'] ) {
218
+               $this->carousel_id = wp_rand( 20, 20000 );
219
+               $this->html[]      = "<div class='lsx-hp-widget-items slick-slider slick-dotted slick-has-arrows {$this->args['css_class']} ' data-interval='{$this->args['interval']}' data-slick='{ \"slidesToShow\": 1, \"slidesToScroll\": 1'>";
220
+          } else {
221
+               $this->html[] = "<div class='lsx-hp-widget-items widget-item-grid-layout'>";
222
+          }
223
+     }
224 224
 
225
-	/**
226
-	 * Runs at the very end of the loop before it runs again.
227
-	 */
228
-	public function loop_start() {
229
-		// Get the call for the active slide.
230
-		if ( 'slider' === $this->args['layout'] ) {
231
-			$this->html[] = "<div class='lsx-hp-widget-item-wrap lsx-{$this->args['post_type']}'>";
232
-		} else {
233
-			if ( 1 === $this->args['count'] ) {
234
-				$this->html[] = "<div class='row'>";
235
-			}
236
-			$this->html[] = '<div class="' . $this->column_class() . '">';
237
-		}
238
-	}
225
+     /**
226
+      * Runs at the very end of the loop before it runs again.
227
+      */
228
+     public function loop_start() {
229
+          // Get the call for the active slide.
230
+          if ( 'slider' === $this->args['layout'] ) {
231
+               $this->html[] = "<div class='lsx-hp-widget-item-wrap lsx-{$this->args['post_type']}'>";
232
+          } else {
233
+               if ( 1 === $this->args['count'] ) {
234
+                    $this->html[] = "<div class='row'>";
235
+               }
236
+               $this->html[] = '<div class="' . $this->column_class() . '">';
237
+          }
238
+     }
239 239
 
240
-	/**
241
-	 * Runs at the very end of the loop before it runs again.
242
-	 */
243
-	public function loop_end() {
244
-		if ( 'slider' !== $this->args['layout'] ) {
245
-			$this->html[] = '</div>';
246
-		}
247
-		// Close the current slide panel.
248
-		if ( 'slider' === $this->args['layout'] ) {
249
-			$this->html[] = '</div>';
250
-		} elseif ( 0 === $this->args['count'] % $this->args['columns'] || count( $this->gallery ) === $this->args['count'] ) {
251
-			$this->html[] = '</div>';
240
+     /**
241
+      * Runs at the very end of the loop before it runs again.
242
+      */
243
+     public function loop_end() {
244
+          if ( 'slider' !== $this->args['layout'] ) {
245
+               $this->html[] = '</div>';
246
+          }
247
+          // Close the current slide panel.
248
+          if ( 'slider' === $this->args['layout'] ) {
249
+               $this->html[] = '</div>';
250
+          } elseif ( 0 === $this->args['count'] % $this->args['columns'] || count( $this->gallery ) === $this->args['count'] ) {
251
+               $this->html[] = '</div>';
252 252
 
253
-			if ( $this->args['count'] < count( $this->gallery ) ) {
254
-				$this->html[] = "<div class='row'>";
255
-			}
256
-		}
257
-	}
253
+               if ( $this->args['count'] < count( $this->gallery ) ) {
254
+                    $this->html[] = "<div class='row'>";
255
+               }
256
+          }
257
+     }
258 258
 
259
-	/**
260
-	 * Runs just after the if and before the while statement in $this->output()
261
-	 */
262
-	public function after_loop() {
263
-		// Slider output Closing.
264
-		if ( 'slider' === $this->args['layout'] ) {
265
-			$this->html[] = '</div>';
266
-		} else {
267
-			$this->html[] = '</div>';
268
-		}
269
-	}
259
+     /**
260
+      * Runs just after the if and before the while statement in $this->output()
261
+      */
262
+     public function after_loop() {
263
+          // Slider output Closing.
264
+          if ( 'slider' === $this->args['layout'] ) {
265
+               $this->html[] = '</div>';
266
+          } else {
267
+               $this->html[] = '</div>';
268
+          }
269
+     }
270 270
 }
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 */
80 80
 	public static function get_instance() {
81 81
 		// If the single instance hasn't been set, set it now.
82
-		if ( null === self::$instance ) {
82
+		if (null === self::$instance) {
83 83
 			self::$instance = new self();
84 84
 		}
85 85
 		return self::$instance;
@@ -92,23 +92,23 @@  discard block
 block discarded – undo
92 92
 	 * @param  string $post_type
93 93
 	 * @return boolean
94 94
 	 */
95
-	public function has_gallery( $item_id = '', $post_type = '' ) {
96
-		if ( '' === $item_id ) {
95
+	public function has_gallery($item_id = '', $post_type = '') {
96
+		if ('' === $item_id) {
97 97
 			$this->item_id = get_the_ID();
98 98
 		} else {
99 99
 			$this->item_id = $item_id;
100 100
 		}
101 101
 		$this->has_gallery = false;
102
-		if ( '' === $post_type ) {
103
-			$this->post_type = get_post_type( $this->item_id );
102
+		if ('' === $post_type) {
103
+			$this->post_type = get_post_type($this->item_id);
104 104
 		}
105
-		$gallery = get_post_meta( $this->item_id, $this->post_type . '_gallery', true );
105
+		$gallery = get_post_meta($this->item_id, $this->post_type . '_gallery', true);
106 106
 
107
-		if ( ! empty( $gallery ) && ( '' !== $gallery ) ) {
107
+		if ( ! empty($gallery) && ('' !== $gallery)) {
108 108
 			$this->gallery     = $gallery;
109 109
 			$this->has_gallery = true;
110
-			wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/src/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
111
-			wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/src/lsx-health-plan-slider.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true );
110
+			wp_enqueue_script('slick', LSX_HEALTH_PLAN_URL . 'assets/js/src/slick.min.js', array('jquery'), LSX_HEALTH_PLAN_VER, true);
111
+			wp_enqueue_script('lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/src/lsx-health-plan-slider.js', array('slick'), LSX_HEALTH_PLAN_VER, true);
112 112
 		}
113 113
 		return $this->has_gallery;
114 114
 	}
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
 	 * @param  string $post_type
121 121
 	 * @return array
122 122
 	 */
123
-	public function get_defaults( $item_id = '', $post_type = '' ) {
124
-		if ( '' === $item_id ) {
123
+	public function get_defaults($item_id = '', $post_type = '') {
124
+		if ('' === $item_id) {
125 125
 			$item_id = $this->item_id;
126 126
 		}
127
-		if ( '' === $post_type ) {
127
+		if ('' === $post_type) {
128 128
 			$post_type = $this->post_type;
129 129
 		}
130 130
 		$this->defaults = array(
@@ -133,10 +133,10 @@  discard block
 block discarded – undo
133 133
 			'interval'  => false,
134 134
 			'css_class' => false,
135 135
 		);
136
-		foreach ( $this->defaults as $key => $default ) {
137
-			$override = get_post_meta( $item_id, $this->post_type . '_gallery_' . $key, true );
138
-			if ( '' !== $override && false !== $override && ! empty( $override ) ) {
139
-				$this->defaults[ $key ] = $override;
136
+		foreach ($this->defaults as $key => $default) {
137
+			$override = get_post_meta($item_id, $this->post_type . '_gallery_' . $key, true);
138
+			if ('' !== $override && false !== $override && ! empty($override)) {
139
+				$this->defaults[$key] = $override;
140 140
 			}
141 141
 		}
142 142
 		return $this->defaults;
@@ -149,13 +149,13 @@  discard block
 block discarded – undo
149 149
 	 * @param string $post_type
150 150
 	 * @return void
151 151
 	 */
152
-	public function get_gallery( $item_id = '', $post_type = '', $args = array() ) {
152
+	public function get_gallery($item_id = '', $post_type = '', $args = array()) {
153 153
 		$return     = '';
154 154
 		$this->html = array();
155
-		$this->args = wp_parse_args( $args, $this->get_defaults( $item_id, $post_type ) );
156
-		if ( ! empty( $this->gallery ) ) {
155
+		$this->args = wp_parse_args($args, $this->get_defaults($item_id, $post_type));
156
+		if ( ! empty($this->gallery)) {
157 157
 			$this->args['count'] = 1;
158
-			if ( '' !== $post_type ) {
158
+			if ('' !== $post_type) {
159 159
 				$this->args['post_type'] = $post_type;
160 160
 			} else {
161 161
 				$this->args['post_type'] = $this->post_type;
@@ -164,22 +164,22 @@  discard block
 block discarded – undo
164 164
 			// output the opening boostrap row divs.
165 165
 			$this->before_loop();
166 166
 
167
-			foreach ( $this->gallery as $key => $gallery ) {
167
+			foreach ($this->gallery as $key => $gallery) {
168 168
 
169 169
 				$this->loop_start();
170 170
 
171
-				if ( isset( $gallery['exercise_gallery_image_id'] ) && ! empty( $gallery['exercise_gallery_image_id'] ) ) {
172
-					$size         = apply_filters( 'lsx_hp_exercise_gallery_size', 'full' );
173
-					$thumbnail    = wp_get_attachment_image( $gallery['exercise_gallery_image_id'], $size );
171
+				if (isset($gallery['exercise_gallery_image_id']) && ! empty($gallery['exercise_gallery_image_id'])) {
172
+					$size         = apply_filters('lsx_hp_exercise_gallery_size', 'full');
173
+					$thumbnail    = wp_get_attachment_image($gallery['exercise_gallery_image_id'], $size);
174 174
 					$this->html[] = $thumbnail;
175
-				} elseif ( isset( $gallery['exercise_gallery_external'] ) && ! empty( $gallery['exercise_gallery_external'] ) ) {
175
+				} elseif (isset($gallery['exercise_gallery_external']) && ! empty($gallery['exercise_gallery_external'])) {
176 176
 					$this->html[] = $gallery['exercise_gallery_external']; // WPCS: XSS OK.
177
-				} elseif ( isset( $gallery['exercise_gallery_embed'] ) && ! empty( $gallery['exercise_gallery_embed'] ) ) {
177
+				} elseif (isset($gallery['exercise_gallery_embed']) && ! empty($gallery['exercise_gallery_embed'])) {
178 178
 					$embed_args = array(
179 179
 						'width' => '530',
180 180
 					);
181
-					$embed        = wp_oembed_get( $gallery['exercise_gallery_embed'], $embed_args );
182
-					$this->html[] = str_replace( 'width="530"', 'width="100%"', $embed ); // WPCS: XSS OK.
181
+					$embed        = wp_oembed_get($gallery['exercise_gallery_embed'], $embed_args);
182
+					$this->html[] = str_replace('width="530"', 'width="100%"', $embed); // WPCS: XSS OK.
183 183
 				}
184 184
 
185 185
 				$this->loop_end();
@@ -192,8 +192,8 @@  discard block
 block discarded – undo
192 192
 		}
193 193
 
194 194
 		// Join the html output if its not empty.
195
-		if ( ! empty( $this->html ) ) {
196
-			$return = implode( '', $this->html );
195
+		if ( ! empty($this->html)) {
196
+			$return = implode('', $this->html);
197 197
 		}
198 198
 		return $return;
199 199
 	}
@@ -214,8 +214,8 @@  discard block
 block discarded – undo
214 214
 	 * Runs just after the if and before the while statement in $this->output()
215 215
 	 */
216 216
 	public function before_loop() {
217
-		if ( 'slider' === $this->args['layout'] ) {
218
-			$this->carousel_id = wp_rand( 20, 20000 );
217
+		if ('slider' === $this->args['layout']) {
218
+			$this->carousel_id = wp_rand(20, 20000);
219 219
 			$this->html[]      = "<div class='lsx-hp-widget-items slick-slider slick-dotted slick-has-arrows {$this->args['css_class']} ' data-interval='{$this->args['interval']}' data-slick='{ \"slidesToShow\": 1, \"slidesToScroll\": 1'>";
220 220
 		} else {
221 221
 			$this->html[] = "<div class='lsx-hp-widget-items widget-item-grid-layout'>";
@@ -227,10 +227,10 @@  discard block
 block discarded – undo
227 227
 	 */
228 228
 	public function loop_start() {
229 229
 		// Get the call for the active slide.
230
-		if ( 'slider' === $this->args['layout'] ) {
230
+		if ('slider' === $this->args['layout']) {
231 231
 			$this->html[] = "<div class='lsx-hp-widget-item-wrap lsx-{$this->args['post_type']}'>";
232 232
 		} else {
233
-			if ( 1 === $this->args['count'] ) {
233
+			if (1 === $this->args['count']) {
234 234
 				$this->html[] = "<div class='row'>";
235 235
 			}
236 236
 			$this->html[] = '<div class="' . $this->column_class() . '">';
@@ -241,16 +241,16 @@  discard block
 block discarded – undo
241 241
 	 * Runs at the very end of the loop before it runs again.
242 242
 	 */
243 243
 	public function loop_end() {
244
-		if ( 'slider' !== $this->args['layout'] ) {
244
+		if ('slider' !== $this->args['layout']) {
245 245
 			$this->html[] = '</div>';
246 246
 		}
247 247
 		// Close the current slide panel.
248
-		if ( 'slider' === $this->args['layout'] ) {
248
+		if ('slider' === $this->args['layout']) {
249 249
 			$this->html[] = '</div>';
250
-		} elseif ( 0 === $this->args['count'] % $this->args['columns'] || count( $this->gallery ) === $this->args['count'] ) {
250
+		} elseif (0 === $this->args['count'] % $this->args['columns'] || count($this->gallery) === $this->args['count']) {
251 251
 			$this->html[] = '</div>';
252 252
 
253
-			if ( $this->args['count'] < count( $this->gallery ) ) {
253
+			if ($this->args['count'] < count($this->gallery)) {
254 254
 				$this->html[] = "<div class='row'>";
255 255
 			}
256 256
 		}
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 	 */
262 262
 	public function after_loop() {
263 263
 		// Slider output Closing.
264
-		if ( 'slider' === $this->args['layout'] ) {
264
+		if ('slider' === $this->args['layout']) {
265 265
 			$this->html[] = '</div>';
266 266
 		} else {
267 267
 			$this->html[] = '</div>';
Please login to merge, or discard this patch.
templates/tab-content-workout.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,20 +24,20 @@  discard block
 block discarded – undo
24 24
 		<?php lsx_post_meta_single_bottom(); ?>
25 25
 	</div><!-- .entry-meta -->
26 26
 	<?php
27
-	if ( is_singular( 'workout' ) ) {
28
-		the_content();
29
-	}
30
-	?>
27
+     if ( is_singular( 'workout' ) ) {
28
+          the_content();
29
+     }
30
+     ?>
31 31
 	<div class="entry-content">
32 32
 		<div class="single-plan-inner workout-content">
33 33
 			<?php
34
-			if ( is_singular( 'workout' ) ) { ?>
34
+               if ( is_singular( 'workout' ) ) { ?>
35 35
 				<div class="single-plan-section-title workout title-lined">
36 36
 					<?php lsx_get_svg_icon( 'work.svg' ); ?>
37 37
 					<h2><?php the_title(); ?></h2>
38 38
 					<?php if ( class_exists( 'LSX_Sharing' ) ) {
39
-						lsx_content_sharing();
40
-					} ?>
39
+                              lsx_content_sharing();
40
+                         } ?>
41 41
 				</div>
42 42
 			<?php } else { ?>
43 43
 				<div class="single-plan-section-title workout title-lined">
@@ -60,5 +60,5 @@  discard block
 block discarded – undo
60 60
 <?php } ?>
61 61
 <?php
62 62
 if ( ! empty( $connected_articles ) ) {
63
-	lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) );
63
+     lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) );
64 64
 }
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@  discard block
 block discarded – undo
8 8
 global $shortcode_args;
9 9
 
10 10
 // Getting translated endpoint.
11
-$archive_workout = \lsx_health_plan\functions\get_option( 'endpoint_workout_archive', 'workout' );
12
-$workout         = \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' );
11
+$archive_workout = \lsx_health_plan\functions\get_option('endpoint_workout_archive', 'workout');
12
+$workout         = \lsx_health_plan\functions\get_option('endpoint_workout', 'workout');
13 13
 
14
-$connected_articles = get_post_meta( get_the_ID(), ( $workout . '_connected_articles' ), true );
14
+$connected_articles = get_post_meta(get_the_ID(), ($workout . '_connected_articles'), true);
15 15
 
16 16
 ?>
17 17
 
@@ -24,25 +24,25 @@  discard block
 block discarded – undo
24 24
 		<?php lsx_post_meta_single_bottom(); ?>
25 25
 	</div><!-- .entry-meta -->
26 26
 	<?php
27
-	if ( is_singular( 'workout' ) ) {
27
+	if (is_singular('workout')) {
28 28
 		the_content();
29 29
 	}
30 30
 	?>
31 31
 	<div class="entry-content">
32 32
 		<div class="single-plan-inner workout-content">
33 33
 			<?php
34
-			if ( is_singular( 'workout' ) ) { ?>
34
+			if (is_singular('workout')) { ?>
35 35
 				<div class="single-plan-section-title workout title-lined">
36
-					<?php lsx_get_svg_icon( 'work.svg' ); ?>
36
+					<?php lsx_get_svg_icon('work.svg'); ?>
37 37
 					<h2><?php the_title(); ?></h2>
38
-					<?php if ( class_exists( 'LSX_Sharing' ) ) {
38
+					<?php if (class_exists('LSX_Sharing')) {
39 39
 						lsx_content_sharing();
40 40
 					} ?>
41 41
 				</div>
42 42
 			<?php } else { ?>
43 43
 				<div class="single-plan-section-title workout title-lined">
44
-					<?php lsx_get_svg_icon( 'work.svg' ); ?>
45
-					<h2><?php esc_html_e( 'My Workout', 'lsx-health-plan' ); ?></h2>
44
+					<?php lsx_get_svg_icon('work.svg'); ?>
45
+					<h2><?php esc_html_e('My Workout', 'lsx-health-plan'); ?></h2>
46 46
 				</div>
47 47
 			<?php } ?>
48 48
 			<?php lsx_health_plan_workout_box(); ?>
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
 	<?php lsx_entry_bottom(); ?>
54 54
 
55 55
 </article><!-- #post-## -->
56
-<?php if ( is_singular( $workout ) ) { ?>
56
+<?php if (is_singular($workout)) { ?>
57 57
 	<div  class="back-plan-btn">
58
-		<a class="btn" href="/<?php echo $archive_workout; ?>"><?php esc_html_e( 'Back to workouts', 'lsx-health-plan' ); ?></a>
58
+		<a class="btn" href="/<?php echo $archive_workout; ?>"><?php esc_html_e('Back to workouts', 'lsx-health-plan'); ?></a>
59 59
 	</div>
60 60
 <?php } ?>
61 61
 <?php
62
-if ( ! empty( $connected_articles ) ) {
63
-	lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) );
62
+if ( ! empty($connected_articles)) {
63
+	lsx_hp_single_related($connected_articles, __('Related articles', 'lsx-health-plan'));
64 64
 }
Please login to merge, or discard this patch.
classes/admin/settings/class-workout.php 2 patches
Indentation   +228 added lines, -228 removed lines patch added patch discarded remove patch
@@ -12,239 +12,239 @@
 block discarded – undo
12 12
  */
13 13
 class Workout {
14 14
 
15
-	/**
16
-	 * Holds class instance
17
-	 *
18
-	 * @since 1.0.0
19
-	 *
20
-	 * @var      object \lsx_health_plan\classes\admin\Workout()
21
-	 */
22
-	protected static $instance = null;
15
+     /**
16
+      * Holds class instance
17
+      *
18
+      * @since 1.0.0
19
+      *
20
+      * @var      object \lsx_health_plan\classes\admin\Workout()
21
+      */
22
+     protected static $instance = null;
23 23
 
24
-	/**
25
-	 * Constructor
26
-	 */
27
-	public function __construct() {
28
-		add_action( 'lsx_hp_settings_page_workout_top', array( $this, 'settings' ), 1, 1 );
29
-	}
24
+     /**
25
+      * Constructor
26
+      */
27
+     public function __construct() {
28
+          add_action( 'lsx_hp_settings_page_workout_top', array( $this, 'settings' ), 1, 1 );
29
+     }
30 30
 
31
-	/**
32
-	 * Return an instance of this class.
33
-	 *
34
-	 * @since 1.0.0
35
-	 *
36
-	 * @return    object \lsx_health_plan\classes\admin\Workout()    A single instance of this class.
37
-	 */
38
-	public static function get_instance() {
39
-		// If the single instance hasn't been set, set it now.
40
-		if ( null === self::$instance ) {
41
-			self::$instance = new self();
42
-		}
43
-		return self::$instance;
44
-	}
31
+     /**
32
+      * Return an instance of this class.
33
+      *
34
+      * @since 1.0.0
35
+      *
36
+      * @return    object \lsx_health_plan\classes\admin\Workout()    A single instance of this class.
37
+      */
38
+     public static function get_instance() {
39
+          // If the single instance hasn't been set, set it now.
40
+          if ( null === self::$instance ) {
41
+               self::$instance = new self();
42
+          }
43
+          return self::$instance;
44
+     }
45 45
 
46
-	/**
47
-	 * Registers the general settings.
48
-	 *
49
-	 * @param object $cmb new_cmb2_box().
50
-	 * @return void
51
-	 */
52
-	public function settings( $cmb ) {
53
-		$cmb->add_field(
54
-			array(
55
-				'name'        => __( 'Disable Workouts', 'lsx-health-plan' ),
56
-				'id'          => 'workout_disabled',
57
-				'type'        => 'checkbox',
58
-				'value'       => 1,
59
-				'default'     => 0,
60
-				'description' => __( 'Disable workout post type if you are wanting a minimal site.', 'lsx-health-plan' ),
61
-			)
62
-		);
63
-		if ( post_type_exists( 'workout' ) ) {
64
-			$cmb->add_field(
65
-				array(
66
-					'name'    => __( 'Your Workout Intro', 'lsx-health-plan' ),
67
-					'id'      => 'workout_intro',
68
-					'type'    => 'wysiwyg',
69
-					'value'   => '',
70
-					'default' => __( "Let's do this! Smash your daily workout and reach your fitness goals.", 'lsx-health-plan' ),
71
-					'options'     => array(
72
-						'textarea_rows' => get_option('default_post_edit_rows', 6),
73
-					),
74
-				)
75
-			);
76
-		}
77
-		$cmb->add_field(
78
-			array(
79
-				'before_row'  => '<h4><b><u>Layout Options</u></b></h4>',
80
-				'id'          => 'workout_tab_layout',
81
-				'type'        => 'select',
82
-				'name'        => __( 'Workout Tab Layout', 'lsx-health-plan' ),
83
-				'description' => __( 'Choose the layout for the workouts.', 'lsx-health-plan' ),
84
-				'options'     => array(
85
-					'table' => __( 'Table', 'lsx-health-plan' ),
86
-					'list'  => __( 'List', 'lsx-health-plan' ),
87
-					'grid'  => __( 'Grid', 'lsx-health-plan' ),
88
-				),
89
-			)
90
-		);
91
-		$cmb->add_field(
92
-			array(
93
-				'id'          => 'workout_tab_link',
94
-				'type'        => 'select',
95
-				'name'        => __( 'Workout Tab Link', 'lsx-health-plan' ),
96
-				'description' => __( 'Choose to show the excerpt, full content or nothing.', 'lsx-health-plan' ),
97
-				'options'     => array(
98
-					'none'   => __( 'None', 'lsx-health-plan' ),
99
-					'single' => __( 'Single', 'lsx-health-plan' ),
100
-					'modal'  => __( 'Modal', 'lsx-health-plan' ),
101
-				),
102
-				'default' => '',
103
-			)
104
-		);
105
-		$cmb->add_field(
106
-			array(
107
-				'id'          => 'workout_tab_modal_content',
108
-				'type'        => 'select',
109
-				'name'        => __( 'Modal Content', 'lsx-health-plan' ),
110
-				'description' => __( 'Choose to show the excerpt, full content or nothing. For the modal content only', 'lsx-health-plan' ),
111
-				'options'     => array(
112
-					''        => __( 'None', 'lsx-health-plan' ),
113
-					'excerpt' => __( 'Excerpt', 'lsx-health-plan' ),
114
-					'full'    => __( 'Full Content', 'lsx-health-plan' ),
115
-				),
116
-				'default' => '',
117
-			)
118
-		);
119
-		$cmb->add_field(
120
-			array(
121
-				'id'          => 'workout_tab_columns',
122
-				'type'        => 'select',
123
-				'name'        => __( 'Grid Columns', 'lsx-health-plan' ),
124
-				'description' => __( 'If you are displaying a grid, set the amount of columns you want to use.', 'lsx-health-plan' ),
125
-				'options'     => array(
126
-					'12' => __( '1', 'lsx-health-plan' ),
127
-					'6'  => __( '2', 'lsx-health-plan' ),
128
-					'4'  => __( '3', 'lsx-health-plan' ),
129
-					'3'  => __( '4', 'lsx-health-plan' ),
130
-					'2'  => __( '6', 'lsx-health-plan' ),
131
-				),
132
-				'default' => '4',
133
-			)
134
-		);
135
-		$cmb->add_field(
136
-			array(
137
-				'id'          => 'workout_tab_content',
138
-				'type'        => 'select',
139
-				'name'        => __( 'Grid Content', 'lsx-health-plan' ),
140
-				'description' => __( 'Choose to show the excerpt, full content or nothing. For the grid layout only', 'lsx-health-plan' ),
141
-				'options'     => array(
142
-					''        => __( 'None', 'lsx-health-plan' ),
143
-					'excerpt' => __( 'Excerpt', 'lsx-health-plan' ),
144
-					'full'    => __( 'Full Content', 'lsx-health-plan' ),
145
-				),
146
-				'default'     => '',
147
-			)
148
-		);
46
+     /**
47
+      * Registers the general settings.
48
+      *
49
+      * @param object $cmb new_cmb2_box().
50
+      * @return void
51
+      */
52
+     public function settings( $cmb ) {
53
+          $cmb->add_field(
54
+               array(
55
+                    'name'        => __( 'Disable Workouts', 'lsx-health-plan' ),
56
+                    'id'          => 'workout_disabled',
57
+                    'type'        => 'checkbox',
58
+                    'value'       => 1,
59
+                    'default'     => 0,
60
+                    'description' => __( 'Disable workout post type if you are wanting a minimal site.', 'lsx-health-plan' ),
61
+               )
62
+          );
63
+          if ( post_type_exists( 'workout' ) ) {
64
+               $cmb->add_field(
65
+                    array(
66
+                         'name'    => __( 'Your Workout Intro', 'lsx-health-plan' ),
67
+                         'id'      => 'workout_intro',
68
+                         'type'    => 'wysiwyg',
69
+                         'value'   => '',
70
+                         'default' => __( "Let's do this! Smash your daily workout and reach your fitness goals.", 'lsx-health-plan' ),
71
+                         'options'     => array(
72
+                              'textarea_rows' => get_option('default_post_edit_rows', 6),
73
+                         ),
74
+                    )
75
+               );
76
+          }
77
+          $cmb->add_field(
78
+               array(
79
+                    'before_row'  => '<h4><b><u>Layout Options</u></b></h4>',
80
+                    'id'          => 'workout_tab_layout',
81
+                    'type'        => 'select',
82
+                    'name'        => __( 'Workout Tab Layout', 'lsx-health-plan' ),
83
+                    'description' => __( 'Choose the layout for the workouts.', 'lsx-health-plan' ),
84
+                    'options'     => array(
85
+                         'table' => __( 'Table', 'lsx-health-plan' ),
86
+                         'list'  => __( 'List', 'lsx-health-plan' ),
87
+                         'grid'  => __( 'Grid', 'lsx-health-plan' ),
88
+                    ),
89
+               )
90
+          );
91
+          $cmb->add_field(
92
+               array(
93
+                    'id'          => 'workout_tab_link',
94
+                    'type'        => 'select',
95
+                    'name'        => __( 'Workout Tab Link', 'lsx-health-plan' ),
96
+                    'description' => __( 'Choose to show the excerpt, full content or nothing.', 'lsx-health-plan' ),
97
+                    'options'     => array(
98
+                         'none'   => __( 'None', 'lsx-health-plan' ),
99
+                         'single' => __( 'Single', 'lsx-health-plan' ),
100
+                         'modal'  => __( 'Modal', 'lsx-health-plan' ),
101
+                    ),
102
+                    'default' => '',
103
+               )
104
+          );
105
+          $cmb->add_field(
106
+               array(
107
+                    'id'          => 'workout_tab_modal_content',
108
+                    'type'        => 'select',
109
+                    'name'        => __( 'Modal Content', 'lsx-health-plan' ),
110
+                    'description' => __( 'Choose to show the excerpt, full content or nothing. For the modal content only', 'lsx-health-plan' ),
111
+                    'options'     => array(
112
+                         ''        => __( 'None', 'lsx-health-plan' ),
113
+                         'excerpt' => __( 'Excerpt', 'lsx-health-plan' ),
114
+                         'full'    => __( 'Full Content', 'lsx-health-plan' ),
115
+                    ),
116
+                    'default' => '',
117
+               )
118
+          );
119
+          $cmb->add_field(
120
+               array(
121
+                    'id'          => 'workout_tab_columns',
122
+                    'type'        => 'select',
123
+                    'name'        => __( 'Grid Columns', 'lsx-health-plan' ),
124
+                    'description' => __( 'If you are displaying a grid, set the amount of columns you want to use.', 'lsx-health-plan' ),
125
+                    'options'     => array(
126
+                         '12' => __( '1', 'lsx-health-plan' ),
127
+                         '6'  => __( '2', 'lsx-health-plan' ),
128
+                         '4'  => __( '3', 'lsx-health-plan' ),
129
+                         '3'  => __( '4', 'lsx-health-plan' ),
130
+                         '2'  => __( '6', 'lsx-health-plan' ),
131
+                    ),
132
+                    'default' => '4',
133
+               )
134
+          );
135
+          $cmb->add_field(
136
+               array(
137
+                    'id'          => 'workout_tab_content',
138
+                    'type'        => 'select',
139
+                    'name'        => __( 'Grid Content', 'lsx-health-plan' ),
140
+                    'description' => __( 'Choose to show the excerpt, full content or nothing. For the grid layout only', 'lsx-health-plan' ),
141
+                    'options'     => array(
142
+                         ''        => __( 'None', 'lsx-health-plan' ),
143
+                         'excerpt' => __( 'Excerpt', 'lsx-health-plan' ),
144
+                         'full'    => __( 'Full Content', 'lsx-health-plan' ),
145
+                    ),
146
+                    'default'     => '',
147
+               )
148
+          );
149 149
 
150
-		$cmb->add_field(
151
-			array(
152
-				'before_row' => '<h4><b><u>URL Slug Options</u></b></h4><p style="font-style: italic;">If you need to translate the custom slug for this custom post type, do so below.</p>',
153
-				'name'       =>  __( 'Single Workout Slug', 'lsx-health-plan' ),
154
-				'id'         => 'endpoint_workout',
155
-				'type'       => 'input',
156
-				'value'      => '',
157
-				'default'    => 'workout',
158
-			)
159
-		);
160
-		$cmb->add_field(
161
-			array(
162
-				'name'    =>  __( 'Workouts Archive Slug', 'lsx-health-plan' ),
163
-				'id'      => 'endpoint_workout_archive',
164
-				'type'    => 'input',
165
-				'value'   => '',
166
-				'default' => 'workouts',
167
-			)
168
-		);
169
-		$cmb->add_field(
170
-			array(
171
-				'name'    =>  __( 'Warm Up Slug', 'lsx-health-plan' ),
172
-				'id'      => 'endpoint_warm_up',
173
-				'type'    => 'input',
174
-				'value'   => '',
175
-				'default' => 'warm-up',
176
-			)
177
-		);
150
+          $cmb->add_field(
151
+               array(
152
+                    'before_row' => '<h4><b><u>URL Slug Options</u></b></h4><p style="font-style: italic;">If you need to translate the custom slug for this custom post type, do so below.</p>',
153
+                    'name'       =>  __( 'Single Workout Slug', 'lsx-health-plan' ),
154
+                    'id'         => 'endpoint_workout',
155
+                    'type'       => 'input',
156
+                    'value'      => '',
157
+                    'default'    => 'workout',
158
+               )
159
+          );
160
+          $cmb->add_field(
161
+               array(
162
+                    'name'    =>  __( 'Workouts Archive Slug', 'lsx-health-plan' ),
163
+                    'id'      => 'endpoint_workout_archive',
164
+                    'type'    => 'input',
165
+                    'value'   => '',
166
+                    'default' => 'workouts',
167
+               )
168
+          );
169
+          $cmb->add_field(
170
+               array(
171
+                    'name'    =>  __( 'Warm Up Slug', 'lsx-health-plan' ),
172
+                    'id'      => 'endpoint_warm_up',
173
+                    'type'    => 'input',
174
+                    'value'   => '',
175
+                    'default' => 'warm-up',
176
+               )
177
+          );
178 178
 		
179 179
 		
180
-		$cmb->add_field(
181
-			array(
182
-				'before_row'  => '<h4><b><u>Default Options</u></b></h4>',
183
-				'name'        => __( 'Warm Up', 'lsx-health-plan' ),
184
-				'description' => __( 'Set a default warm up routine.', 'lsx-health-plan' ),
185
-				'limit'       => 1,
186
-				'id'          => 'plan_warmup',
187
-				'type'        => 'post_search_ajax',
188
-				'query_args'  => array(
189
-					'post_type'      => 'post',
190
-					'post_status'    => array( 'publish' ),
191
-					'posts_per_page' => -1,
192
-				),
193
-			)
194
-		);
195
-		$cmb->add_field(
196
-			array(
197
-				'name'        => __( 'Workout', 'lsx-health-plan' ),
198
-				'description' => __( 'Set a default workout routine.', 'lsx-health-plan' ),
199
-				'limit'       => 1,
200
-				'id'          => 'connected_workouts',
201
-				'type'        => 'post_search_ajax',
202
-				'query_args'  => array(
203
-					'post_type'      => 'workout',
204
-					'post_status'    => array( 'publish' ),
205
-					'posts_per_page' => -1,
206
-				),
207
-			)
208
-		);
209
-		if ( function_exists( 'download_monitor' ) ) {
210
-			$page_url    = 'https://wordpress.org/plugins/download-monitor/';
211
-			$plugin_name = 'Download Monitor';
212
-			$description = sprintf(
213
-				/* translators: %s: The subscription info */
214
-				__( 'If you are using <a target="_blank" href="%1$s">%2$s</a> you can set a default download file for your meal here.', 'lsx-search' ),
215
-				$page_url,
216
-				$plugin_name
217
-			);
218
-			$cmb->add_field(
219
-				array(
220
-					'name'        => __( 'Default Warm Up PDF', 'lsx-health-plan' ),
221
-					'description' => $description,
222
-					'id'          => 'download_page',
223
-					'type'        => 'post_search_ajax',
224
-					'limit'       => 1,
225
-					'query_args'  => array(
226
-						'post_type'      => array( 'dlm_download' ),
227
-						'post_status'    => array( 'publish' ),
228
-						'posts_per_page' => -1,
229
-					),
230
-				)
231
-			);
232
-			$cmb->add_field(
233
-				array(
234
-					'name'        => __( 'Default Workout PDF', 'lsx-health-plan' ),
235
-					'description' => $description,
236
-					'id'          => 'download_workout',
237
-					'type'        => 'post_search_ajax',
238
-					'limit'       => 1,
239
-					'query_args'  => array(
240
-						'post_type'      => array( 'dlm_download' ),
241
-						'post_status'    => array( 'publish' ),
242
-						'posts_per_page' => -1,
243
-					),
244
-					'after_row'   => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ),
245
-				)
246
-			);
247
-		}
248
-	}
180
+          $cmb->add_field(
181
+               array(
182
+                    'before_row'  => '<h4><b><u>Default Options</u></b></h4>',
183
+                    'name'        => __( 'Warm Up', 'lsx-health-plan' ),
184
+                    'description' => __( 'Set a default warm up routine.', 'lsx-health-plan' ),
185
+                    'limit'       => 1,
186
+                    'id'          => 'plan_warmup',
187
+                    'type'        => 'post_search_ajax',
188
+                    'query_args'  => array(
189
+                         'post_type'      => 'post',
190
+                         'post_status'    => array( 'publish' ),
191
+                         'posts_per_page' => -1,
192
+                    ),
193
+               )
194
+          );
195
+          $cmb->add_field(
196
+               array(
197
+                    'name'        => __( 'Workout', 'lsx-health-plan' ),
198
+                    'description' => __( 'Set a default workout routine.', 'lsx-health-plan' ),
199
+                    'limit'       => 1,
200
+                    'id'          => 'connected_workouts',
201
+                    'type'        => 'post_search_ajax',
202
+                    'query_args'  => array(
203
+                         'post_type'      => 'workout',
204
+                         'post_status'    => array( 'publish' ),
205
+                         'posts_per_page' => -1,
206
+                    ),
207
+               )
208
+          );
209
+          if ( function_exists( 'download_monitor' ) ) {
210
+               $page_url    = 'https://wordpress.org/plugins/download-monitor/';
211
+               $plugin_name = 'Download Monitor';
212
+               $description = sprintf(
213
+                    /* translators: %s: The subscription info */
214
+                    __( 'If you are using <a target="_blank" href="%1$s">%2$s</a> you can set a default download file for your meal here.', 'lsx-search' ),
215
+                    $page_url,
216
+                    $plugin_name
217
+               );
218
+               $cmb->add_field(
219
+                    array(
220
+                         'name'        => __( 'Default Warm Up PDF', 'lsx-health-plan' ),
221
+                         'description' => $description,
222
+                         'id'          => 'download_page',
223
+                         'type'        => 'post_search_ajax',
224
+                         'limit'       => 1,
225
+                         'query_args'  => array(
226
+                              'post_type'      => array( 'dlm_download' ),
227
+                              'post_status'    => array( 'publish' ),
228
+                              'posts_per_page' => -1,
229
+                         ),
230
+                    )
231
+               );
232
+               $cmb->add_field(
233
+                    array(
234
+                         'name'        => __( 'Default Workout PDF', 'lsx-health-plan' ),
235
+                         'description' => $description,
236
+                         'id'          => 'download_workout',
237
+                         'type'        => 'post_search_ajax',
238
+                         'limit'       => 1,
239
+                         'query_args'  => array(
240
+                              'post_type'      => array( 'dlm_download' ),
241
+                              'post_status'    => array( 'publish' ),
242
+                              'posts_per_page' => -1,
243
+                         ),
244
+                         'after_row'   => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ),
245
+                    )
246
+               );
247
+          }
248
+     }
249 249
 }
250 250
 Workout::get_instance();
Please login to merge, or discard this patch.
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	 * Constructor
26 26
 	 */
27 27
 	public function __construct() {
28
-		add_action( 'lsx_hp_settings_page_workout_top', array( $this, 'settings' ), 1, 1 );
28
+		add_action('lsx_hp_settings_page_workout_top', array($this, 'settings'), 1, 1);
29 29
 	}
30 30
 
31 31
 	/**
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 */
38 38
 	public static function get_instance() {
39 39
 		// If the single instance hasn't been set, set it now.
40
-		if ( null === self::$instance ) {
40
+		if (null === self::$instance) {
41 41
 			self::$instance = new self();
42 42
 		}
43 43
 		return self::$instance;
@@ -49,25 +49,25 @@  discard block
 block discarded – undo
49 49
 	 * @param object $cmb new_cmb2_box().
50 50
 	 * @return void
51 51
 	 */
52
-	public function settings( $cmb ) {
52
+	public function settings($cmb) {
53 53
 		$cmb->add_field(
54 54
 			array(
55
-				'name'        => __( 'Disable Workouts', 'lsx-health-plan' ),
55
+				'name'        => __('Disable Workouts', 'lsx-health-plan'),
56 56
 				'id'          => 'workout_disabled',
57 57
 				'type'        => 'checkbox',
58 58
 				'value'       => 1,
59 59
 				'default'     => 0,
60
-				'description' => __( 'Disable workout post type if you are wanting a minimal site.', 'lsx-health-plan' ),
60
+				'description' => __('Disable workout post type if you are wanting a minimal site.', 'lsx-health-plan'),
61 61
 			)
62 62
 		);
63
-		if ( post_type_exists( 'workout' ) ) {
63
+		if (post_type_exists('workout')) {
64 64
 			$cmb->add_field(
65 65
 				array(
66
-					'name'    => __( 'Your Workout Intro', 'lsx-health-plan' ),
66
+					'name'    => __('Your Workout Intro', 'lsx-health-plan'),
67 67
 					'id'      => 'workout_intro',
68 68
 					'type'    => 'wysiwyg',
69 69
 					'value'   => '',
70
-					'default' => __( "Let's do this! Smash your daily workout and reach your fitness goals.", 'lsx-health-plan' ),
70
+					'default' => __("Let's do this! Smash your daily workout and reach your fitness goals.", 'lsx-health-plan'),
71 71
 					'options'     => array(
72 72
 						'textarea_rows' => get_option('default_post_edit_rows', 6),
73 73
 					),
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
 				'before_row'  => '<h4><b><u>Layout Options</u></b></h4>',
80 80
 				'id'          => 'workout_tab_layout',
81 81
 				'type'        => 'select',
82
-				'name'        => __( 'Workout Tab Layout', 'lsx-health-plan' ),
83
-				'description' => __( 'Choose the layout for the workouts.', 'lsx-health-plan' ),
82
+				'name'        => __('Workout Tab Layout', 'lsx-health-plan'),
83
+				'description' => __('Choose the layout for the workouts.', 'lsx-health-plan'),
84 84
 				'options'     => array(
85
-					'table' => __( 'Table', 'lsx-health-plan' ),
86
-					'list'  => __( 'List', 'lsx-health-plan' ),
87
-					'grid'  => __( 'Grid', 'lsx-health-plan' ),
85
+					'table' => __('Table', 'lsx-health-plan'),
86
+					'list'  => __('List', 'lsx-health-plan'),
87
+					'grid'  => __('Grid', 'lsx-health-plan'),
88 88
 				),
89 89
 			)
90 90
 		);
@@ -92,12 +92,12 @@  discard block
 block discarded – undo
92 92
 			array(
93 93
 				'id'          => 'workout_tab_link',
94 94
 				'type'        => 'select',
95
-				'name'        => __( 'Workout Tab Link', 'lsx-health-plan' ),
96
-				'description' => __( 'Choose to show the excerpt, full content or nothing.', 'lsx-health-plan' ),
95
+				'name'        => __('Workout Tab Link', 'lsx-health-plan'),
96
+				'description' => __('Choose to show the excerpt, full content or nothing.', 'lsx-health-plan'),
97 97
 				'options'     => array(
98
-					'none'   => __( 'None', 'lsx-health-plan' ),
99
-					'single' => __( 'Single', 'lsx-health-plan' ),
100
-					'modal'  => __( 'Modal', 'lsx-health-plan' ),
98
+					'none'   => __('None', 'lsx-health-plan'),
99
+					'single' => __('Single', 'lsx-health-plan'),
100
+					'modal'  => __('Modal', 'lsx-health-plan'),
101 101
 				),
102 102
 				'default' => '',
103 103
 			)
@@ -106,12 +106,12 @@  discard block
 block discarded – undo
106 106
 			array(
107 107
 				'id'          => 'workout_tab_modal_content',
108 108
 				'type'        => 'select',
109
-				'name'        => __( 'Modal Content', 'lsx-health-plan' ),
110
-				'description' => __( 'Choose to show the excerpt, full content or nothing. For the modal content only', 'lsx-health-plan' ),
109
+				'name'        => __('Modal Content', 'lsx-health-plan'),
110
+				'description' => __('Choose to show the excerpt, full content or nothing. For the modal content only', 'lsx-health-plan'),
111 111
 				'options'     => array(
112
-					''        => __( 'None', 'lsx-health-plan' ),
113
-					'excerpt' => __( 'Excerpt', 'lsx-health-plan' ),
114
-					'full'    => __( 'Full Content', 'lsx-health-plan' ),
112
+					''        => __('None', 'lsx-health-plan'),
113
+					'excerpt' => __('Excerpt', 'lsx-health-plan'),
114
+					'full'    => __('Full Content', 'lsx-health-plan'),
115 115
 				),
116 116
 				'default' => '',
117 117
 			)
@@ -120,14 +120,14 @@  discard block
 block discarded – undo
120 120
 			array(
121 121
 				'id'          => 'workout_tab_columns',
122 122
 				'type'        => 'select',
123
-				'name'        => __( 'Grid Columns', 'lsx-health-plan' ),
124
-				'description' => __( 'If you are displaying a grid, set the amount of columns you want to use.', 'lsx-health-plan' ),
123
+				'name'        => __('Grid Columns', 'lsx-health-plan'),
124
+				'description' => __('If you are displaying a grid, set the amount of columns you want to use.', 'lsx-health-plan'),
125 125
 				'options'     => array(
126
-					'12' => __( '1', 'lsx-health-plan' ),
127
-					'6'  => __( '2', 'lsx-health-plan' ),
128
-					'4'  => __( '3', 'lsx-health-plan' ),
129
-					'3'  => __( '4', 'lsx-health-plan' ),
130
-					'2'  => __( '6', 'lsx-health-plan' ),
126
+					'12' => __('1', 'lsx-health-plan'),
127
+					'6'  => __('2', 'lsx-health-plan'),
128
+					'4'  => __('3', 'lsx-health-plan'),
129
+					'3'  => __('4', 'lsx-health-plan'),
130
+					'2'  => __('6', 'lsx-health-plan'),
131 131
 				),
132 132
 				'default' => '4',
133 133
 			)
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
 			array(
137 137
 				'id'          => 'workout_tab_content',
138 138
 				'type'        => 'select',
139
-				'name'        => __( 'Grid Content', 'lsx-health-plan' ),
140
-				'description' => __( 'Choose to show the excerpt, full content or nothing. For the grid layout only', 'lsx-health-plan' ),
139
+				'name'        => __('Grid Content', 'lsx-health-plan'),
140
+				'description' => __('Choose to show the excerpt, full content or nothing. For the grid layout only', 'lsx-health-plan'),
141 141
 				'options'     => array(
142
-					''        => __( 'None', 'lsx-health-plan' ),
143
-					'excerpt' => __( 'Excerpt', 'lsx-health-plan' ),
144
-					'full'    => __( 'Full Content', 'lsx-health-plan' ),
142
+					''        => __('None', 'lsx-health-plan'),
143
+					'excerpt' => __('Excerpt', 'lsx-health-plan'),
144
+					'full'    => __('Full Content', 'lsx-health-plan'),
145 145
 				),
146 146
 				'default'     => '',
147 147
 			)
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 		$cmb->add_field(
151 151
 			array(
152 152
 				'before_row' => '<h4><b><u>URL Slug Options</u></b></h4><p style="font-style: italic;">If you need to translate the custom slug for this custom post type, do so below.</p>',
153
-				'name'       =>  __( 'Single Workout Slug', 'lsx-health-plan' ),
153
+				'name'       =>  __('Single Workout Slug', 'lsx-health-plan'),
154 154
 				'id'         => 'endpoint_workout',
155 155
 				'type'       => 'input',
156 156
 				'value'      => '',
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 		);
160 160
 		$cmb->add_field(
161 161
 			array(
162
-				'name'    =>  __( 'Workouts Archive Slug', 'lsx-health-plan' ),
162
+				'name'    =>  __('Workouts Archive Slug', 'lsx-health-plan'),
163 163
 				'id'      => 'endpoint_workout_archive',
164 164
 				'type'    => 'input',
165 165
 				'value'   => '',
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 		);
169 169
 		$cmb->add_field(
170 170
 			array(
171
-				'name'    =>  __( 'Warm Up Slug', 'lsx-health-plan' ),
171
+				'name'    =>  __('Warm Up Slug', 'lsx-health-plan'),
172 172
 				'id'      => 'endpoint_warm_up',
173 173
 				'type'    => 'input',
174 174
 				'value'   => '',
@@ -180,68 +180,68 @@  discard block
 block discarded – undo
180 180
 		$cmb->add_field(
181 181
 			array(
182 182
 				'before_row'  => '<h4><b><u>Default Options</u></b></h4>',
183
-				'name'        => __( 'Warm Up', 'lsx-health-plan' ),
184
-				'description' => __( 'Set a default warm up routine.', 'lsx-health-plan' ),
183
+				'name'        => __('Warm Up', 'lsx-health-plan'),
184
+				'description' => __('Set a default warm up routine.', 'lsx-health-plan'),
185 185
 				'limit'       => 1,
186 186
 				'id'          => 'plan_warmup',
187 187
 				'type'        => 'post_search_ajax',
188 188
 				'query_args'  => array(
189 189
 					'post_type'      => 'post',
190
-					'post_status'    => array( 'publish' ),
190
+					'post_status'    => array('publish'),
191 191
 					'posts_per_page' => -1,
192 192
 				),
193 193
 			)
194 194
 		);
195 195
 		$cmb->add_field(
196 196
 			array(
197
-				'name'        => __( 'Workout', 'lsx-health-plan' ),
198
-				'description' => __( 'Set a default workout routine.', 'lsx-health-plan' ),
197
+				'name'        => __('Workout', 'lsx-health-plan'),
198
+				'description' => __('Set a default workout routine.', 'lsx-health-plan'),
199 199
 				'limit'       => 1,
200 200
 				'id'          => 'connected_workouts',
201 201
 				'type'        => 'post_search_ajax',
202 202
 				'query_args'  => array(
203 203
 					'post_type'      => 'workout',
204
-					'post_status'    => array( 'publish' ),
204
+					'post_status'    => array('publish'),
205 205
 					'posts_per_page' => -1,
206 206
 				),
207 207
 			)
208 208
 		);
209
-		if ( function_exists( 'download_monitor' ) ) {
209
+		if (function_exists('download_monitor')) {
210 210
 			$page_url    = 'https://wordpress.org/plugins/download-monitor/';
211 211
 			$plugin_name = 'Download Monitor';
212 212
 			$description = sprintf(
213 213
 				/* translators: %s: The subscription info */
214
-				__( 'If you are using <a target="_blank" href="%1$s">%2$s</a> you can set a default download file for your meal here.', 'lsx-search' ),
214
+				__('If you are using <a target="_blank" href="%1$s">%2$s</a> you can set a default download file for your meal here.', 'lsx-search'),
215 215
 				$page_url,
216 216
 				$plugin_name
217 217
 			);
218 218
 			$cmb->add_field(
219 219
 				array(
220
-					'name'        => __( 'Default Warm Up PDF', 'lsx-health-plan' ),
220
+					'name'        => __('Default Warm Up PDF', 'lsx-health-plan'),
221 221
 					'description' => $description,
222 222
 					'id'          => 'download_page',
223 223
 					'type'        => 'post_search_ajax',
224 224
 					'limit'       => 1,
225 225
 					'query_args'  => array(
226
-						'post_type'      => array( 'dlm_download' ),
227
-						'post_status'    => array( 'publish' ),
226
+						'post_type'      => array('dlm_download'),
227
+						'post_status'    => array('publish'),
228 228
 						'posts_per_page' => -1,
229 229
 					),
230 230
 				)
231 231
 			);
232 232
 			$cmb->add_field(
233 233
 				array(
234
-					'name'        => __( 'Default Workout PDF', 'lsx-health-plan' ),
234
+					'name'        => __('Default Workout PDF', 'lsx-health-plan'),
235 235
 					'description' => $description,
236 236
 					'id'          => 'download_workout',
237 237
 					'type'        => 'post_search_ajax',
238 238
 					'limit'       => 1,
239 239
 					'query_args'  => array(
240
-						'post_type'      => array( 'dlm_download' ),
241
-						'post_status'    => array( 'publish' ),
240
+						'post_type'      => array('dlm_download'),
241
+						'post_status'    => array('publish'),
242 242
 						'posts_per_page' => -1,
243 243
 					),
244
-					'after_row'   => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ),
244
+					'after_row'   => __('<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan'),
245 245
 				)
246 246
 			);
247 247
 		}
Please login to merge, or discard this patch.
classes/class-frontend.php 2 patches
Indentation   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -8,113 +8,113 @@
 block discarded – undo
8 8
  */
9 9
 class Frontend {
10 10
 
11
-	/**
12
-	 * Holds class instance
13
-	 *
14
-	 * @since 1.0.0
15
-	 *
16
-	 * @var      object \lsx_health_plan\classes\Frontend()
17
-	 */
18
-	protected static $instance = null;
19
-
20
-	/**
21
-	 * @var object \lsx_health_plan\classes\frontend\Endpoints();
22
-	 */
23
-	public $endpoints;
24
-
25
-	/**
26
-	 * @var object \lsx_health_plan\classes\frontend\Modals();
27
-	 */
28
-	public $modals;
29
-
30
-	/**
31
-	 * @var object \lsx_health_plan\classes\frontend\Gallery();
32
-	 */
33
-	public $gallery;
34
-
35
-	/**
36
-	 * @var object \lsx_health_plan\classes\frontend\Plan_Status();
37
-	 */
38
-	public $plan_status;
39
-
40
-	/**
41
-	 * @var object \lsx_health_plan\classes\frontend\Plan_Query();
42
-	 */
43
-	public $plan_query;
44
-
45
-	/**
46
-	 * @var object \lsx_health_plan\classes\frontend\General();
47
-	 */
48
-	public $general;
49
-
50
-	/**
51
-	 * @var object \lsx_health_plan\classes\frontend\Template_Redirects();
52
-	 */
53
-	public $template_redirects;
54
-
55
-	/**
56
-	 * Constructor
57
-	 */
58
-	public function __construct() {
59
-		if ( ! is_admin() ) {
60
-			$this->load_classes();
61
-		}	
62
-	}
63
-
64
-	/**
65
-	 * Return an instance of this class.
66
-	 *
67
-	 * @since 1.0.0
68
-	 *
69
-	 * @return    object \lsx_health_plan\classes\Frontend()    A single instance of this class.
70
-	 */
71
-	public static function get_instance() {
72
-		// If the single instance hasn't been set, set it now.
73
-		if ( null === self::$instance ) {
74
-			self::$instance = new self();
75
-		}
76
-		return self::$instance;
77
-	}
78
-
79
-	/**
80
-	 * Loads the variable classes and the static classes.
81
-	 */
82
-	private function load_classes() {
83
-		require_once LSX_HEALTH_PLAN_PATH . 'classes/frontend/class-endpoints.php';
84
-		$this->endpoints = frontend\Endpoints::get_instance();
85
-
86
-		require_once LSX_HEALTH_PLAN_PATH . 'classes/frontend/class-modals.php';
87
-		$this->modals = Modals::get_instance();
88
-
89
-		require_once LSX_HEALTH_PLAN_PATH . 'classes/frontend/class-gallery.php';
90
-		$this->gallery = frontend\Gallery::get_instance();
91
-
92
-		require_once LSX_HEALTH_PLAN_PATH . 'classes/frontend/class-plan-status.php';
93
-		$this->plan_status = frontend\Plan_Status::get_instance();
94
-
95
-		require_once LSX_HEALTH_PLAN_PATH . 'classes/frontend/class-plan-query.php';
96
-		$this->plan_query = frontend\Plan_Query::get_instance();
97
-
98
-		require_once LSX_HEALTH_PLAN_PATH . 'classes/frontend/class-general.php';
99
-		$this->general = frontend\General::get_instance();
100
-
101
-		require_once LSX_HEALTH_PLAN_PATH . 'classes/frontend/class-template-redirects.php';
102
-		$this->template_redirects = frontend\Template_Redirects::get_instance();
103
-	}
104
-
105
-	/**
106
-	 * Remove the "Archives:" from the post type recipes.
107
-	 *
108
-	 * @param string $title the term title.
109
-	 * @return string
110
-	 */
111
-	public function get_the_archive_title( $title ) {
112
-		if ( is_tax() ) {
113
-			$queried_object = get_queried_object();
114
-			if ( isset( $queried_object->name ) ) {
115
-				$title = $queried_object->name;
116
-			}
117
-		}
118
-		return $title;
119
-	}
11
+     /**
12
+      * Holds class instance
13
+      *
14
+      * @since 1.0.0
15
+      *
16
+      * @var      object \lsx_health_plan\classes\Frontend()
17
+      */
18
+     protected static $instance = null;
19
+
20
+     /**
21
+      * @var object \lsx_health_plan\classes\frontend\Endpoints();
22
+      */
23
+     public $endpoints;
24
+
25
+     /**
26
+      * @var object \lsx_health_plan\classes\frontend\Modals();
27
+      */
28
+     public $modals;
29
+
30
+     /**
31
+      * @var object \lsx_health_plan\classes\frontend\Gallery();
32
+      */
33
+     public $gallery;
34
+
35
+     /**
36
+      * @var object \lsx_health_plan\classes\frontend\Plan_Status();
37
+      */
38
+     public $plan_status;
39
+
40
+     /**
41
+      * @var object \lsx_health_plan\classes\frontend\Plan_Query();
42
+      */
43
+     public $plan_query;
44
+
45
+     /**
46
+      * @var object \lsx_health_plan\classes\frontend\General();
47
+      */
48
+     public $general;
49
+
50
+     /**
51
+      * @var object \lsx_health_plan\classes\frontend\Template_Redirects();
52
+      */
53
+     public $template_redirects;
54
+
55
+     /**
56
+      * Constructor
57
+      */
58
+     public function __construct() {
59
+          if ( ! is_admin() ) {
60
+               $this->load_classes();
61
+          }	
62
+     }
63
+
64
+     /**
65
+      * Return an instance of this class.
66
+      *
67
+      * @since 1.0.0
68
+      *
69
+      * @return    object \lsx_health_plan\classes\Frontend()    A single instance of this class.
70
+      */
71
+     public static function get_instance() {
72
+          // If the single instance hasn't been set, set it now.
73
+          if ( null === self::$instance ) {
74
+               self::$instance = new self();
75
+          }
76
+          return self::$instance;
77
+     }
78
+
79
+     /**
80
+      * Loads the variable classes and the static classes.
81
+      */
82
+     private function load_classes() {
83
+          require_once LSX_HEALTH_PLAN_PATH . 'classes/frontend/class-endpoints.php';
84
+          $this->endpoints = frontend\Endpoints::get_instance();
85
+
86
+          require_once LSX_HEALTH_PLAN_PATH . 'classes/frontend/class-modals.php';
87
+          $this->modals = Modals::get_instance();
88
+
89
+          require_once LSX_HEALTH_PLAN_PATH . 'classes/frontend/class-gallery.php';
90
+          $this->gallery = frontend\Gallery::get_instance();
91
+
92
+          require_once LSX_HEALTH_PLAN_PATH . 'classes/frontend/class-plan-status.php';
93
+          $this->plan_status = frontend\Plan_Status::get_instance();
94
+
95
+          require_once LSX_HEALTH_PLAN_PATH . 'classes/frontend/class-plan-query.php';
96
+          $this->plan_query = frontend\Plan_Query::get_instance();
97
+
98
+          require_once LSX_HEALTH_PLAN_PATH . 'classes/frontend/class-general.php';
99
+          $this->general = frontend\General::get_instance();
100
+
101
+          require_once LSX_HEALTH_PLAN_PATH . 'classes/frontend/class-template-redirects.php';
102
+          $this->template_redirects = frontend\Template_Redirects::get_instance();
103
+     }
104
+
105
+     /**
106
+      * Remove the "Archives:" from the post type recipes.
107
+      *
108
+      * @param string $title the term title.
109
+      * @return string
110
+      */
111
+     public function get_the_archive_title( $title ) {
112
+          if ( is_tax() ) {
113
+               $queried_object = get_queried_object();
114
+               if ( isset( $queried_object->name ) ) {
115
+                    $title = $queried_object->name;
116
+               }
117
+          }
118
+          return $title;
119
+     }
120 120
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	 * Constructor
57 57
 	 */
58 58
 	public function __construct() {
59
-		if ( ! is_admin() ) {
59
+		if ( ! is_admin()) {
60 60
 			$this->load_classes();
61 61
 		}	
62 62
 	}
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	public static function get_instance() {
72 72
 		// If the single instance hasn't been set, set it now.
73
-		if ( null === self::$instance ) {
73
+		if (null === self::$instance) {
74 74
 			self::$instance = new self();
75 75
 		}
76 76
 		return self::$instance;
@@ -108,10 +108,10 @@  discard block
 block discarded – undo
108 108
 	 * @param string $title the term title.
109 109
 	 * @return string
110 110
 	 */
111
-	public function get_the_archive_title( $title ) {
112
-		if ( is_tax() ) {
111
+	public function get_the_archive_title($title) {
112
+		if (is_tax()) {
113 113
 			$queried_object = get_queried_object();
114
-			if ( isset( $queried_object->name ) ) {
114
+			if (isset($queried_object->name)) {
115 115
 				$title = $queried_object->name;
116 116
 			}
117 117
 		}
Please login to merge, or discard this patch.
classes/post-types/class-meal.php 2 patches
Indentation   +444 added lines, -444 removed lines patch added patch discarded remove patch
@@ -8,477 +8,477 @@
 block discarded – undo
8 8
  */
9 9
 class Meal {
10 10
 
11
-	/**
12
-	 * Holds class instance
13
-	 *
14
-	 * @since 1.0.0
15
-	 *
16
-	 * @var      object \lsx_health_plan\classes\Meal()
17
-	 */
18
-	protected static $instance = null;
11
+     /**
12
+      * Holds class instance
13
+      *
14
+      * @since 1.0.0
15
+      *
16
+      * @var      object \lsx_health_plan\classes\Meal()
17
+      */
18
+     protected static $instance = null;
19 19
 
20
-	/**
21
-	 * Holds post_type slug used as an index
22
-	 *
23
-	 * @since 1.0.0
24
-	 *
25
-	 * @var      string
26
-	 */
27
-	public $slug = 'meal';
20
+     /**
21
+      * Holds post_type slug used as an index
22
+      *
23
+      * @since 1.0.0
24
+      *
25
+      * @var      string
26
+      */
27
+     public $slug = 'meal';
28 28
 
29
-	/**
30
-	 * Constructor
31
-	 */
32
-	public function __construct() {
33
-		add_action( 'init', array( $this, 'register_post_type' ) );
34
-		add_action( 'init', array( $this, 'taxonomy_setup' ) );
29
+     /**
30
+      * Constructor
31
+      */
32
+     public function __construct() {
33
+          add_action( 'init', array( $this, 'register_post_type' ) );
34
+          add_action( 'init', array( $this, 'taxonomy_setup' ) );
35 35
 		
36
-		add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 );
37
-		add_action( 'cmb2_admin_init', array( $this, 'featured_metabox' ), 5 );
38
-		add_action( 'cmb2_admin_init', array( $this, 'details_metaboxes' ) );
36
+          add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 );
37
+          add_action( 'cmb2_admin_init', array( $this, 'featured_metabox' ), 5 );
38
+          add_action( 'cmb2_admin_init', array( $this, 'details_metaboxes' ) );
39 39
 
40
-		// Template Redirects.
41
-		add_filter( 'lsx_health_plan_single_template', array( $this, 'enable_post_type' ), 10, 1 );
42
-		add_filter( 'lsx_health_plan_archive_template', array( $this, 'enable_post_type' ), 10, 1 );
40
+          // Template Redirects.
41
+          add_filter( 'lsx_health_plan_single_template', array( $this, 'enable_post_type' ), 10, 1 );
42
+          add_filter( 'lsx_health_plan_archive_template', array( $this, 'enable_post_type' ), 10, 1 );
43 43
 
44
-		add_action( 'pre_get_posts', array( $this, 'set_parent_only' ), 10, 1 );
45
-		add_filter( 'get_the_archive_title', array( $this, 'get_the_archive_title' ), 100 );
44
+          add_action( 'pre_get_posts', array( $this, 'set_parent_only' ), 10, 1 );
45
+          add_filter( 'get_the_archive_title', array( $this, 'get_the_archive_title' ), 100 );
46 46
 
47
-		//Breadcrumbs
48
-		add_filter( 'wpseo_breadcrumb_links', array( $this, 'meal_breadcrumb_filter' ), 30, 1 );
49
-		add_filter( 'woocommerce_get_breadcrumb', array( $this, 'meal_breadcrumb_filter' ), 30, 1 );
50
-	}
47
+          //Breadcrumbs
48
+          add_filter( 'wpseo_breadcrumb_links', array( $this, 'meal_breadcrumb_filter' ), 30, 1 );
49
+          add_filter( 'woocommerce_get_breadcrumb', array( $this, 'meal_breadcrumb_filter' ), 30, 1 );
50
+     }
51 51
 
52
-	/**
53
-	 * Return an instance of this class.
54
-	 *
55
-	 * @since 1.0.0
56
-	 *
57
-	 * @return    object \lsx_health_plan\classes\Day()    A single instance of this class.
58
-	 */
59
-	public static function get_instance() {
60
-		// If the single instance hasn't been set, set it now.
61
-		if ( null === self::$instance ) {
62
-			self::$instance = new self();
63
-		}
64
-		return self::$instance;
65
-	}
66
-	/**
67
-	 * Register the post type.
68
-	 */
69
-	public function register_post_type() {
70
-		$labels = array(
71
-			'name'               => esc_html__( 'Meals', 'lsx-health-plan' ),
72
-			'singular_name'      => esc_html__( 'Meal', 'lsx-health-plan' ),
73
-			'add_new'            => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ),
74
-			'add_new_item'       => esc_html__( 'Add New', 'lsx-health-plan' ),
75
-			'edit_item'          => esc_html__( 'Edit', 'lsx-health-plan' ),
76
-			'new_item'           => esc_html__( 'New', 'lsx-health-plan' ),
77
-			'all_items'          => esc_html__( 'All Meals', 'lsx-health-plan' ),
78
-			'view_item'          => esc_html__( 'View', 'lsx-health-plan' ),
79
-			'search_items'       => esc_html__( 'Search', 'lsx-health-plan' ),
80
-			'not_found'          => esc_html__( 'None found', 'lsx-health-plan' ),
81
-			'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ),
82
-			'parent_item_colon'  => esc_html__( 'Parent:', 'lsx-health-plan' ),
83
-			'menu_name'          => esc_html__( 'Meals', 'lsx-health-plan' ),
84
-		);
85
-		$args   = array(
86
-			'labels'             => $labels,
87
-			'public'             => true,
88
-			'publicly_queryable' => true,
89
-			'show_ui'            => true,
90
-			'show_in_menu'       => true,
91
-			'show_in_rest'       => true,
92
-			'menu_icon'          => 'dashicons-carrot',
93
-			'query_var'          => true,
94
-			'rewrite'            => array(
95
-				'slug' => \lsx_health_plan\functions\get_option( 'meal_single_slug', 'meal' ),
96
-			),
97
-			'capability_type'    => 'page',
98
-			'has_archive'        => \lsx_health_plan\functions\get_option( 'endpoint_meal_archive', 'meals' ),
99
-			'hierarchical'       => true,
100
-			'menu_position'      => null,
101
-			'supports'           => array(
102
-				'title',
103
-				'editor',
104
-				'thumbnail',
105
-				'page-attributes',
106
-				'custom-fields',
107
-			),
108
-		);
109
-		register_post_type( 'meal', $args );
110
-	}
52
+     /**
53
+      * Return an instance of this class.
54
+      *
55
+      * @since 1.0.0
56
+      *
57
+      * @return    object \lsx_health_plan\classes\Day()    A single instance of this class.
58
+      */
59
+     public static function get_instance() {
60
+          // If the single instance hasn't been set, set it now.
61
+          if ( null === self::$instance ) {
62
+               self::$instance = new self();
63
+          }
64
+          return self::$instance;
65
+     }
66
+     /**
67
+      * Register the post type.
68
+      */
69
+     public function register_post_type() {
70
+          $labels = array(
71
+               'name'               => esc_html__( 'Meals', 'lsx-health-plan' ),
72
+               'singular_name'      => esc_html__( 'Meal', 'lsx-health-plan' ),
73
+               'add_new'            => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ),
74
+               'add_new_item'       => esc_html__( 'Add New', 'lsx-health-plan' ),
75
+               'edit_item'          => esc_html__( 'Edit', 'lsx-health-plan' ),
76
+               'new_item'           => esc_html__( 'New', 'lsx-health-plan' ),
77
+               'all_items'          => esc_html__( 'All Meals', 'lsx-health-plan' ),
78
+               'view_item'          => esc_html__( 'View', 'lsx-health-plan' ),
79
+               'search_items'       => esc_html__( 'Search', 'lsx-health-plan' ),
80
+               'not_found'          => esc_html__( 'None found', 'lsx-health-plan' ),
81
+               'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ),
82
+               'parent_item_colon'  => esc_html__( 'Parent:', 'lsx-health-plan' ),
83
+               'menu_name'          => esc_html__( 'Meals', 'lsx-health-plan' ),
84
+          );
85
+          $args   = array(
86
+               'labels'             => $labels,
87
+               'public'             => true,
88
+               'publicly_queryable' => true,
89
+               'show_ui'            => true,
90
+               'show_in_menu'       => true,
91
+               'show_in_rest'       => true,
92
+               'menu_icon'          => 'dashicons-carrot',
93
+               'query_var'          => true,
94
+               'rewrite'            => array(
95
+                    'slug' => \lsx_health_plan\functions\get_option( 'meal_single_slug', 'meal' ),
96
+               ),
97
+               'capability_type'    => 'page',
98
+               'has_archive'        => \lsx_health_plan\functions\get_option( 'endpoint_meal_archive', 'meals' ),
99
+               'hierarchical'       => true,
100
+               'menu_position'      => null,
101
+               'supports'           => array(
102
+                    'title',
103
+                    'editor',
104
+                    'thumbnail',
105
+                    'page-attributes',
106
+                    'custom-fields',
107
+               ),
108
+          );
109
+          register_post_type( 'meal', $args );
110
+     }
111 111
 
112
-	/**
113
-	 * Register the Meal Type taxonomy.
114
-	 */
115
-	public function taxonomy_setup() {
116
-		$labels = array(
117
-			'name'              => esc_html_x( 'Meal Type', 'taxonomy general name', 'lsx-health-plan' ),
118
-			'singular_name'     => esc_html_x( 'Meal Types', 'taxonomy singular name', 'lsx-health-plan' ),
119
-			'search_items'      => esc_html__( 'Search', 'lsx-health-plan' ),
120
-			'all_items'         => esc_html__( 'All', 'lsx-health-plan' ),
121
-			'parent_item'       => esc_html__( 'Parent', 'lsx-health-plan' ),
122
-			'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ),
123
-			'edit_item'         => esc_html__( 'Edit', 'lsx-health-plan' ),
124
-			'update_item'       => esc_html__( 'Update', 'lsx-health-plan' ),
125
-			'add_new_item'      => esc_html__( 'Add New', 'lsx-health-plan' ),
126
-			'new_item_name'     => esc_html__( 'New Name', 'lsx-health-plan' ),
127
-			'menu_name'         => esc_html__( 'Meal Types', 'lsx-health-plan' ),
128
-		);
129
-		$args   = array(
130
-			'hierarchical'      => true,
131
-			'labels'            => $labels,
132
-			'show_ui'           => true,
133
-			'show_in_menu'      => 'edit.php?post_type=meal',
134
-			'show_admin_column' => true,
135
-			'query_var'         => true,
136
-			'rewrite'           => array(
137
-				'slug' => 'meal-type',
138
-			),
139
-		);
140
-		register_taxonomy( 'meal-type', array( $this->slug ), $args );
141
-	}
112
+     /**
113
+      * Register the Meal Type taxonomy.
114
+      */
115
+     public function taxonomy_setup() {
116
+          $labels = array(
117
+               'name'              => esc_html_x( 'Meal Type', 'taxonomy general name', 'lsx-health-plan' ),
118
+               'singular_name'     => esc_html_x( 'Meal Types', 'taxonomy singular name', 'lsx-health-plan' ),
119
+               'search_items'      => esc_html__( 'Search', 'lsx-health-plan' ),
120
+               'all_items'         => esc_html__( 'All', 'lsx-health-plan' ),
121
+               'parent_item'       => esc_html__( 'Parent', 'lsx-health-plan' ),
122
+               'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ),
123
+               'edit_item'         => esc_html__( 'Edit', 'lsx-health-plan' ),
124
+               'update_item'       => esc_html__( 'Update', 'lsx-health-plan' ),
125
+               'add_new_item'      => esc_html__( 'Add New', 'lsx-health-plan' ),
126
+               'new_item_name'     => esc_html__( 'New Name', 'lsx-health-plan' ),
127
+               'menu_name'         => esc_html__( 'Meal Types', 'lsx-health-plan' ),
128
+          );
129
+          $args   = array(
130
+               'hierarchical'      => true,
131
+               'labels'            => $labels,
132
+               'show_ui'           => true,
133
+               'show_in_menu'      => 'edit.php?post_type=meal',
134
+               'show_admin_column' => true,
135
+               'query_var'         => true,
136
+               'rewrite'           => array(
137
+                    'slug' => 'meal-type',
138
+               ),
139
+          );
140
+          register_taxonomy( 'meal-type', array( $this->slug ), $args );
141
+     }
142 142
 
143
-	/**
144
-	 * Adds the post type to the different arrays.
145
-	 *
146
-	 * @param array $post_types
147
-	 * @return array
148
-	 */
149
-	public function enable_post_type( $post_types = array() ) {
150
-		$post_types[] = $this->slug;
151
-		return $post_types;
152
-	}
143
+     /**
144
+      * Adds the post type to the different arrays.
145
+      *
146
+      * @param array $post_types
147
+      * @return array
148
+      */
149
+     public function enable_post_type( $post_types = array() ) {
150
+          $post_types[] = $this->slug;
151
+          return $post_types;
152
+     }
153 153
 
154
-	/**
155
-	 * Enables the Bi Directional relationships
156
-	 *
157
-	 * @param array $connections
158
-	 * @return void
159
-	 */
160
-	public function enable_connections( $connections = array() ) {
161
-		$connections['meal']['connected_plans'] = 'connected_meals';
162
-		$connections['plan']['connected_meals'] = 'connected_plans';
163
-		return $connections;
164
-	}
154
+     /**
155
+      * Enables the Bi Directional relationships
156
+      *
157
+      * @param array $connections
158
+      * @return void
159
+      */
160
+     public function enable_connections( $connections = array() ) {
161
+          $connections['meal']['connected_plans'] = 'connected_meals';
162
+          $connections['plan']['connected_meals'] = 'connected_plans';
163
+          return $connections;
164
+     }
165 165
 
166
-	/**
167
-	 * Remove the "Archives:" from the post type meal.
168
-	 *
169
-	 * @param string $title the term title.
170
-	 * @return string
171
-	 */
172
-	public function get_the_archive_title( $title ) {
173
-		if ( is_post_type_archive( 'meal' ) ) {
174
-			$title = __( 'Meals', 'lsx-health-plan' );
175
-		}
176
-		return $title;
177
-	}
166
+     /**
167
+      * Remove the "Archives:" from the post type meal.
168
+      *
169
+      * @param string $title the term title.
170
+      * @return string
171
+      */
172
+     public function get_the_archive_title( $title ) {
173
+          if ( is_post_type_archive( 'meal' ) ) {
174
+               $title = __( 'Meals', 'lsx-health-plan' );
175
+          }
176
+          return $title;
177
+     }
178 178
 
179
-	/**
180
-	 * Define the metabox and field configurations.
181
-	 */
182
-	public function featured_metabox() {
183
-		$cmb = new_cmb2_box(
184
-			array(
185
-				'id'           => $this->slug . '_featured_metabox_meal',
186
-				'title'        => __( 'Featured Meal', 'lsx-health-plan' ),
187
-				'object_types' => array( $this->slug ), // Post type
188
-				'context'      => 'side',
189
-				'priority'     => 'high',
190
-				'show_names'   => true,
191
-			)
192
-		);
193
-		$cmb->add_field(
194
-			array(
195
-				'name'       => __( 'Featured Meal', 'lsx-health-plan' ),
196
-				'desc'       => __( 'Enable a featured meal' ),
197
-				'id'         => $this->slug . '_featured_meal',
198
-				'type'       => 'checkbox',
199
-				'show_on_cb' => 'cmb2_hide_if_no_cats',
200
-			)
201
-		);
202
-	}
179
+     /**
180
+      * Define the metabox and field configurations.
181
+      */
182
+     public function featured_metabox() {
183
+          $cmb = new_cmb2_box(
184
+               array(
185
+                    'id'           => $this->slug . '_featured_metabox_meal',
186
+                    'title'        => __( 'Featured Meal', 'lsx-health-plan' ),
187
+                    'object_types' => array( $this->slug ), // Post type
188
+                    'context'      => 'side',
189
+                    'priority'     => 'high',
190
+                    'show_names'   => true,
191
+               )
192
+          );
193
+          $cmb->add_field(
194
+               array(
195
+                    'name'       => __( 'Featured Meal', 'lsx-health-plan' ),
196
+                    'desc'       => __( 'Enable a featured meal' ),
197
+                    'id'         => $this->slug . '_featured_meal',
198
+                    'type'       => 'checkbox',
199
+                    'show_on_cb' => 'cmb2_hide_if_no_cats',
200
+               )
201
+          );
202
+     }
203 203
 
204
-	/**
205
-	 * Define the metabox and field configurations.
206
-	 */
207
-	public function details_metaboxes() {
208
-		$cmb = new_cmb2_box( array(
209
-			'id'           => $this->slug . '_shopping_list_metabox',
210
-			'title'        => __( 'Shopping List', 'lsx-health-plan' ),
211
-			'object_types' => array( $this->slug ), // Post type
212
-			'context'      => 'normal',
213
-			'priority'     => 'high',
214
-			'show_names'   => true,
215
-		) );
216
-		$cmb->add_field( array(
217
-			'name'       => __( 'Shopping List', 'lsx-health-plan' ),
218
-			'desc'       => __( 'Connect the shopping list page that applies to this meal by entering the name of the page in the field provided.' ),
219
-			'id'         => $this->slug . '_shopping_list',
220
-			'type'       => 'post_search_ajax',
221
-			// Optional :
222
-			'limit'      => 1,  // Limit selection to X items only (default 1)
223
-			'sortable'   => true, // Allow selected items to be sortable (default false)
224
-			'query_args' => array(
225
-				'post_type'      => array( 'page' ),
226
-				'post_status'    => array( 'publish' ),
227
-				'posts_per_page' => -1,
228
-			),
229
-		) );
230
-		$cmb = new_cmb2_box( array(
231
-			'id'           => $this->slug . '_details_metabox',
232
-			'title'        => __( 'Meal Details', 'lsx-health-plan' ),
233
-			'object_types' => array( $this->slug ), // Post type
234
-			'context'      => 'normal',
235
-			'priority'     => 'high',
236
-			'show_names'   => true,
237
-		) );
204
+     /**
205
+      * Define the metabox and field configurations.
206
+      */
207
+     public function details_metaboxes() {
208
+          $cmb = new_cmb2_box( array(
209
+               'id'           => $this->slug . '_shopping_list_metabox',
210
+               'title'        => __( 'Shopping List', 'lsx-health-plan' ),
211
+               'object_types' => array( $this->slug ), // Post type
212
+               'context'      => 'normal',
213
+               'priority'     => 'high',
214
+               'show_names'   => true,
215
+          ) );
216
+          $cmb->add_field( array(
217
+               'name'       => __( 'Shopping List', 'lsx-health-plan' ),
218
+               'desc'       => __( 'Connect the shopping list page that applies to this meal by entering the name of the page in the field provided.' ),
219
+               'id'         => $this->slug . '_shopping_list',
220
+               'type'       => 'post_search_ajax',
221
+               // Optional :
222
+               'limit'      => 1,  // Limit selection to X items only (default 1)
223
+               'sortable'   => true, // Allow selected items to be sortable (default false)
224
+               'query_args' => array(
225
+                    'post_type'      => array( 'page' ),
226
+                    'post_status'    => array( 'publish' ),
227
+                    'posts_per_page' => -1,
228
+               ),
229
+          ) );
230
+          $cmb = new_cmb2_box( array(
231
+               'id'           => $this->slug . '_details_metabox',
232
+               'title'        => __( 'Meal Details', 'lsx-health-plan' ),
233
+               'object_types' => array( $this->slug ), // Post type
234
+               'context'      => 'normal',
235
+               'priority'     => 'high',
236
+               'show_names'   => true,
237
+          ) );
238 238
 
239
-		$cmb->add_field( array(
240
-			'name' => __( 'Meal Short Description', 'lsx-health-plan' ),
241
-			'id'   => $this->slug . '_short_description',
242
-			'type' => 'textarea_small',
243
-			'desc' => __( 'Add a small description for this meal (optional)', 'lsx-health-plan' ),
244
-		) );
239
+          $cmb->add_field( array(
240
+               'name' => __( 'Meal Short Description', 'lsx-health-plan' ),
241
+               'id'   => $this->slug . '_short_description',
242
+               'type' => 'textarea_small',
243
+               'desc' => __( 'Add a small description for this meal (optional)', 'lsx-health-plan' ),
244
+          ) );
245 245
 
246
-		$cmb->add_field( array(
247
-			'name'       => __( 'Pre Breakfast Snack', 'lsx-health-plan' ),
248
-			'id'         => $this->slug . '_pre_breakfast_snack',
249
-			'type'       => 'wysiwyg',
250
-			'show_on_cb' => 'cmb2_hide_if_no_cats',
251
-			'options'    => array(
252
-				'textarea_rows' => 5,
253
-			),
254
-		) );
255
-		$cmb->add_field( array(
256
-			'name'       => __( 'Breakfast', 'lsx-health-plan' ),
257
-			'id'         => $this->slug . '_breakfast',
258
-			'type'       => 'wysiwyg',
259
-			'show_on_cb' => 'cmb2_hide_if_no_cats',
260
-			'options'    => array(
261
-				'textarea_rows' => 5,
262
-			),
263
-		) );
246
+          $cmb->add_field( array(
247
+               'name'       => __( 'Pre Breakfast Snack', 'lsx-health-plan' ),
248
+               'id'         => $this->slug . '_pre_breakfast_snack',
249
+               'type'       => 'wysiwyg',
250
+               'show_on_cb' => 'cmb2_hide_if_no_cats',
251
+               'options'    => array(
252
+                    'textarea_rows' => 5,
253
+               ),
254
+          ) );
255
+          $cmb->add_field( array(
256
+               'name'       => __( 'Breakfast', 'lsx-health-plan' ),
257
+               'id'         => $this->slug . '_breakfast',
258
+               'type'       => 'wysiwyg',
259
+               'show_on_cb' => 'cmb2_hide_if_no_cats',
260
+               'options'    => array(
261
+                    'textarea_rows' => 5,
262
+               ),
263
+          ) );
264 264
 
265
-		$cmb->add_field(
266
-			array(
267
-				'name'       => __( 'Post Breakfast Snack', 'lsx-health-plan' ),
268
-				'id'         => $this->slug . '_breakfast_snack',
269
-				'type'       => 'wysiwyg',
270
-				'show_on_cb' => 'cmb2_hide_if_no_cats',
271
-				'options'    => array(
272
-					'textarea_rows' => 5,
273
-				),
274
-			)
275
-		);
265
+          $cmb->add_field(
266
+               array(
267
+                    'name'       => __( 'Post Breakfast Snack', 'lsx-health-plan' ),
268
+                    'id'         => $this->slug . '_breakfast_snack',
269
+                    'type'       => 'wysiwyg',
270
+                    'show_on_cb' => 'cmb2_hide_if_no_cats',
271
+                    'options'    => array(
272
+                         'textarea_rows' => 5,
273
+                    ),
274
+               )
275
+          );
276 276
 
277
-		if ( post_type_exists( 'recipe' ) ) {
278
-			$cmb->add_field(
279
-				array(
280
-					'name'       => __( 'Breakfast Recipes', 'lsx-health-plan' ),
281
-					'desc'       => __( 'Connect additional recipes options for breakfast.', 'lsx-health-plan' ),
282
-					'id'         => 'breakfast_recipes',
283
-					'type'       => 'post_search_ajax',
284
-					// Optional :
285
-					'limit'      => 15,  // Limit selection to X items only (default 1)
286
-					'sortable'   => true, // Allow selected items to be sortable (default false)
287
-					'query_args' => array(
288
-						'post_type'      => array( 'recipe' ),
289
-						'post_status'    => array( 'publish' ),
290
-						'posts_per_page' => -1,
291
-					),
292
-				)
293
-			);
294
-		}
277
+          if ( post_type_exists( 'recipe' ) ) {
278
+               $cmb->add_field(
279
+                    array(
280
+                         'name'       => __( 'Breakfast Recipes', 'lsx-health-plan' ),
281
+                         'desc'       => __( 'Connect additional recipes options for breakfast.', 'lsx-health-plan' ),
282
+                         'id'         => 'breakfast_recipes',
283
+                         'type'       => 'post_search_ajax',
284
+                         // Optional :
285
+                         'limit'      => 15,  // Limit selection to X items only (default 1)
286
+                         'sortable'   => true, // Allow selected items to be sortable (default false)
287
+                         'query_args' => array(
288
+                              'post_type'      => array( 'recipe' ),
289
+                              'post_status'    => array( 'publish' ),
290
+                              'posts_per_page' => -1,
291
+                         ),
292
+                    )
293
+               );
294
+          }
295 295
 
296
-		$cmb->add_field(
297
-			array(
298
-				'name'       => __( 'Pre Lunch Snack', 'lsx-health-plan' ),
299
-				'id'         => $this->slug . '_pre_lunch_snack',
300
-				'type'       => 'wysiwyg',
301
-				'show_on_cb' => 'cmb2_hide_if_no_cats',
302
-				'options'    => array(
303
-					'textarea_rows' => 5,
304
-				),
305
-			)
306
-		);
307
-		$cmb->add_field(
308
-			array(
309
-				'name'       => __( 'Lunch', 'lsx-health-plan' ),
310
-				'id'         => $this->slug . '_lunch',
311
-				'type'       => 'wysiwyg',
312
-				'show_on_cb' => 'cmb2_hide_if_no_cats',
313
-				'options'    => array(
314
-					'textarea_rows' => 5,
315
-				),
316
-			)
317
-		);
318
-		$cmb->add_field(
319
-			array(
320
-				'name'       => __( 'Post Lunch Snack', 'lsx-health-plan' ),
321
-				'id'         => $this->slug . '_lunch_snack',
322
-				'type'       => 'wysiwyg',
323
-				'show_on_cb' => 'cmb2_hide_if_no_cats',
324
-				'options'    => array(
325
-					'textarea_rows' => 5,
326
-				),
327
-			)
328
-		);
296
+          $cmb->add_field(
297
+               array(
298
+                    'name'       => __( 'Pre Lunch Snack', 'lsx-health-plan' ),
299
+                    'id'         => $this->slug . '_pre_lunch_snack',
300
+                    'type'       => 'wysiwyg',
301
+                    'show_on_cb' => 'cmb2_hide_if_no_cats',
302
+                    'options'    => array(
303
+                         'textarea_rows' => 5,
304
+                    ),
305
+               )
306
+          );
307
+          $cmb->add_field(
308
+               array(
309
+                    'name'       => __( 'Lunch', 'lsx-health-plan' ),
310
+                    'id'         => $this->slug . '_lunch',
311
+                    'type'       => 'wysiwyg',
312
+                    'show_on_cb' => 'cmb2_hide_if_no_cats',
313
+                    'options'    => array(
314
+                         'textarea_rows' => 5,
315
+                    ),
316
+               )
317
+          );
318
+          $cmb->add_field(
319
+               array(
320
+                    'name'       => __( 'Post Lunch Snack', 'lsx-health-plan' ),
321
+                    'id'         => $this->slug . '_lunch_snack',
322
+                    'type'       => 'wysiwyg',
323
+                    'show_on_cb' => 'cmb2_hide_if_no_cats',
324
+                    'options'    => array(
325
+                         'textarea_rows' => 5,
326
+                    ),
327
+               )
328
+          );
329 329
 
330
-		if ( post_type_exists( 'recipe' ) ) {
331
-			$cmb->add_field(
332
-				array(
333
-					'name'       => __( 'Lunch Recipes', 'lsx-health-plan' ),
334
-					'desc'       => __( 'Connect additional recipes options for lunch.', 'lsx-health-plan' ),
335
-					'id'         => 'lunch_recipes',
336
-					'type'       => 'post_search_ajax',
337
-					// Optional :
338
-					'limit'      => 15,  // Limit selection to X items only (default 1)
339
-					'sortable'   => true, // Allow selected items to be sortable (default false)
340
-					'query_args' => array(
341
-						'post_type'      => array( 'recipe' ),
342
-						'post_status'    => array( 'publish' ),
343
-						'posts_per_page' => -1,
344
-					),
345
-				)
346
-			);
347
-		}
330
+          if ( post_type_exists( 'recipe' ) ) {
331
+               $cmb->add_field(
332
+                    array(
333
+                         'name'       => __( 'Lunch Recipes', 'lsx-health-plan' ),
334
+                         'desc'       => __( 'Connect additional recipes options for lunch.', 'lsx-health-plan' ),
335
+                         'id'         => 'lunch_recipes',
336
+                         'type'       => 'post_search_ajax',
337
+                         // Optional :
338
+                         'limit'      => 15,  // Limit selection to X items only (default 1)
339
+                         'sortable'   => true, // Allow selected items to be sortable (default false)
340
+                         'query_args' => array(
341
+                              'post_type'      => array( 'recipe' ),
342
+                              'post_status'    => array( 'publish' ),
343
+                              'posts_per_page' => -1,
344
+                         ),
345
+                    )
346
+               );
347
+          }
348 348
 
349
-		$cmb->add_field(
350
-			array(
351
-				'name'       => __( 'Pre Dinner Snack', 'lsx-health-plan' ),
352
-				'id'         => $this->slug . '_pre_dinner_snack',
353
-				'type'       => 'wysiwyg',
354
-				'show_on_cb' => 'cmb2_hide_if_no_cats',
355
-				'options'    => array(
356
-					'textarea_rows' => 5,
357
-				),
358
-			)
359
-		);
360
-		$cmb->add_field(
361
-			array(
362
-				'name'       => __( 'Dinner', 'lsx-health-plan' ),
363
-				'id'         => $this->slug . '_dinner',
364
-				'type'       => 'wysiwyg',
365
-				'show_on_cb' => 'cmb2_hide_if_no_cats',
366
-				'options'    => array(
367
-					'textarea_rows' => 5,
368
-				),
369
-			)
370
-		);
371
-		$cmb->add_field(
372
-			array(
373
-				'name'       => __( 'Post Dinner Snack', 'lsx-health-plan' ),
374
-				'id'         => $this->slug . '_dinner_snack',
375
-				'type'       => 'wysiwyg',
376
-				'show_on_cb' => 'cmb2_hide_if_no_cats',
377
-				'options'    => array(
378
-					'textarea_rows' => 5,
379
-				),
380
-			)
381
-		);
349
+          $cmb->add_field(
350
+               array(
351
+                    'name'       => __( 'Pre Dinner Snack', 'lsx-health-plan' ),
352
+                    'id'         => $this->slug . '_pre_dinner_snack',
353
+                    'type'       => 'wysiwyg',
354
+                    'show_on_cb' => 'cmb2_hide_if_no_cats',
355
+                    'options'    => array(
356
+                         'textarea_rows' => 5,
357
+                    ),
358
+               )
359
+          );
360
+          $cmb->add_field(
361
+               array(
362
+                    'name'       => __( 'Dinner', 'lsx-health-plan' ),
363
+                    'id'         => $this->slug . '_dinner',
364
+                    'type'       => 'wysiwyg',
365
+                    'show_on_cb' => 'cmb2_hide_if_no_cats',
366
+                    'options'    => array(
367
+                         'textarea_rows' => 5,
368
+                    ),
369
+               )
370
+          );
371
+          $cmb->add_field(
372
+               array(
373
+                    'name'       => __( 'Post Dinner Snack', 'lsx-health-plan' ),
374
+                    'id'         => $this->slug . '_dinner_snack',
375
+                    'type'       => 'wysiwyg',
376
+                    'show_on_cb' => 'cmb2_hide_if_no_cats',
377
+                    'options'    => array(
378
+                         'textarea_rows' => 5,
379
+                    ),
380
+               )
381
+          );
382 382
 
383
-		if ( post_type_exists( 'recipe' ) ) {
384
-			$cmb->add_field(
385
-				array(
386
-					'name'       => __( 'Dinner Recipes', 'lsx-health-plan' ),
387
-					'desc'       => __( 'Connect additional recipes options for dinner.', 'lsx-health-plan' ),
388
-					'id'         => 'dinner_recipes',
389
-					'type'       => 'post_search_ajax',
390
-					// Optional :
391
-					'limit'      => 15,  // Limit selection to X items only (default 1)
392
-					'sortable'   => true, // Allow selected items to be sortable (default false)
393
-					'query_args' => array(
394
-						'post_type'      => array( 'recipe' ),
395
-						'post_status'    => array( 'publish' ),
396
-						'posts_per_page' => -1,
397
-					),
398
-				)
399
-			);
400
-		}
401
-	}
402
-	/**
403
-	 * Set the post type archive to show the parent plans only.
404
-	 *
405
-	 * @param object $wp_query
406
-	 * @return array
407
-	 */
408
-	public function set_parent_only( $wp_query ) {
409
-		if ( ! is_admin() && $wp_query->is_main_query() && ( $wp_query->is_post_type_archive( 'meal' ) || $wp_query->is_tax( array( 'meal-type' ) ) ) ) {
410
-			$wp_query->set( 'post_parent', '0' );
411
-		}
412
-	}
383
+          if ( post_type_exists( 'recipe' ) ) {
384
+               $cmb->add_field(
385
+                    array(
386
+                         'name'       => __( 'Dinner Recipes', 'lsx-health-plan' ),
387
+                         'desc'       => __( 'Connect additional recipes options for dinner.', 'lsx-health-plan' ),
388
+                         'id'         => 'dinner_recipes',
389
+                         'type'       => 'post_search_ajax',
390
+                         // Optional :
391
+                         'limit'      => 15,  // Limit selection to X items only (default 1)
392
+                         'sortable'   => true, // Allow selected items to be sortable (default false)
393
+                         'query_args' => array(
394
+                              'post_type'      => array( 'recipe' ),
395
+                              'post_status'    => array( 'publish' ),
396
+                              'posts_per_page' => -1,
397
+                         ),
398
+                    )
399
+               );
400
+          }
401
+     }
402
+     /**
403
+      * Set the post type archive to show the parent plans only.
404
+      *
405
+      * @param object $wp_query
406
+      * @return array
407
+      */
408
+     public function set_parent_only( $wp_query ) {
409
+          if ( ! is_admin() && $wp_query->is_main_query() && ( $wp_query->is_post_type_archive( 'meal' ) || $wp_query->is_tax( array( 'meal-type' ) ) ) ) {
410
+               $wp_query->set( 'post_parent', '0' );
411
+          }
412
+     }
413 413
 
414 414
 
415
-	/**
416
-	 * Holds the array for the single meal breadcrumbs.
417
-	 *
418
-	 * @var array $crumbs
419
-	 * @return array
420
-	 */
421
-	public function meal_breadcrumb_filter( $crumbs ) {
422
-		$meal  = \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' );
423
-		$meals = \lsx_health_plan\functions\get_option( 'endpoint_meal_archive', 'meal' );
415
+     /**
416
+      * Holds the array for the single meal breadcrumbs.
417
+      *
418
+      * @var array $crumbs
419
+      * @return array
420
+      */
421
+     public function meal_breadcrumb_filter( $crumbs ) {
422
+          $meal  = \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' );
423
+          $meals = \lsx_health_plan\functions\get_option( 'endpoint_meal_archive', 'meal' );
424 424
 
425
-		if ( is_singular( 'meal' ) ) {	
426
-			$meal_name     = get_the_title();
427
-			$url           = get_post_type_archive_link( $meal );
428
-			$term_obj_list = get_the_terms( get_the_ID(), 'meal-type' );
429
-			$meal_type     = $term_obj_list[0]->name;
430
-			if ( empty( $meal_type ) ) {
431
-				$meal_type = __( 'Meal', 'lsx-health-plan' );
432
-			}
433
-			$meal_type_url = get_term_link( $term_obj_list[0]->term_id );
425
+          if ( is_singular( 'meal' ) ) {	
426
+               $meal_name     = get_the_title();
427
+               $url           = get_post_type_archive_link( $meal );
428
+               $term_obj_list = get_the_terms( get_the_ID(), 'meal-type' );
429
+               $meal_type     = $term_obj_list[0]->name;
430
+               if ( empty( $meal_type ) ) {
431
+                    $meal_type = __( 'Meal', 'lsx-health-plan' );
432
+               }
433
+               $meal_type_url = get_term_link( $term_obj_list[0]->term_id );
434 434
 
435
-			$new_crumbs    = array();
436
-			$new_crumbs[0] = $crumbs[0];
435
+               $new_crumbs    = array();
436
+               $new_crumbs[0] = $crumbs[0];
437 437
 
438
-			if ( function_exists( 'woocommerce_breadcrumb' ) ) {
439
-				$new_crumbs[1] = array(
440
-					0 => $meals,
441
-					1 => $url,
442
-				);
443
-				$new_crumbs[2] = array(
444
-					0 => $meal_type,
445
-					1 => $meal_type_url,
446
-				);
447
-				$new_crumbs[3] = array(
448
-					0 => $meal_name,
449
-				);
450
-			} else {
451
-				$new_crumbs[1] = array(
452
-					'text' => $meals,
453
-					'url'  => $url,
454
-				);
455
-				$new_crumbs[2] = array(
456
-					'text' => $meal_type,
457
-					'url'  => $meal_type_url,
458
-				);
459
-				$new_crumbs[3] = array(
460
-					'text' => $meal_name,
461
-				);
462
-			}
463
-			$crumbs = $new_crumbs;
438
+               if ( function_exists( 'woocommerce_breadcrumb' ) ) {
439
+                    $new_crumbs[1] = array(
440
+                         0 => $meals,
441
+                         1 => $url,
442
+                    );
443
+                    $new_crumbs[2] = array(
444
+                         0 => $meal_type,
445
+                         1 => $meal_type_url,
446
+                    );
447
+                    $new_crumbs[3] = array(
448
+                         0 => $meal_name,
449
+                    );
450
+               } else {
451
+                    $new_crumbs[1] = array(
452
+                         'text' => $meals,
453
+                         'url'  => $url,
454
+                    );
455
+                    $new_crumbs[2] = array(
456
+                         'text' => $meal_type,
457
+                         'url'  => $meal_type_url,
458
+                    );
459
+                    $new_crumbs[3] = array(
460
+                         'text' => $meal_name,
461
+                    );
462
+               }
463
+               $crumbs = $new_crumbs;
464 464
 
465
-		}
466
-		if ( is_post_type_archive( 'meal' ) ) {
465
+          }
466
+          if ( is_post_type_archive( 'meal' ) ) {
467 467
 
468
-			$new_crumbs    = array();
469
-			$new_crumbs[0] = $crumbs[0];
468
+               $new_crumbs    = array();
469
+               $new_crumbs[0] = $crumbs[0];
470 470
 
471
-			if ( function_exists( 'woocommerce_breadcrumb' ) ) {
472
-				$new_crumbs[1] = array(
473
-					0 => $meals,
474
-				);
475
-			} else {
476
-				$new_crumbs[1] = array(
477
-					'text' => $meals,
478
-				);
479
-			}
480
-			$crumbs = $new_crumbs;
481
-		}
482
-		return $crumbs;
483
-	}
471
+               if ( function_exists( 'woocommerce_breadcrumb' ) ) {
472
+                    $new_crumbs[1] = array(
473
+                         0 => $meals,
474
+                    );
475
+               } else {
476
+                    $new_crumbs[1] = array(
477
+                         'text' => $meals,
478
+                    );
479
+               }
480
+               $crumbs = $new_crumbs;
481
+          }
482
+          return $crumbs;
483
+     }
484 484
 }
Please login to merge, or discard this patch.
Spacing   +116 added lines, -116 removed lines patch added patch discarded remove patch
@@ -30,23 +30,23 @@  discard block
 block discarded – undo
30 30
 	 * Constructor
31 31
 	 */
32 32
 	public function __construct() {
33
-		add_action( 'init', array( $this, 'register_post_type' ) );
34
-		add_action( 'init', array( $this, 'taxonomy_setup' ) );
33
+		add_action('init', array($this, 'register_post_type'));
34
+		add_action('init', array($this, 'taxonomy_setup'));
35 35
 		
36
-		add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 );
37
-		add_action( 'cmb2_admin_init', array( $this, 'featured_metabox' ), 5 );
38
-		add_action( 'cmb2_admin_init', array( $this, 'details_metaboxes' ) );
36
+		add_filter('lsx_health_plan_connections', array($this, 'enable_connections'), 10, 1);
37
+		add_action('cmb2_admin_init', array($this, 'featured_metabox'), 5);
38
+		add_action('cmb2_admin_init', array($this, 'details_metaboxes'));
39 39
 
40 40
 		// Template Redirects.
41
-		add_filter( 'lsx_health_plan_single_template', array( $this, 'enable_post_type' ), 10, 1 );
42
-		add_filter( 'lsx_health_plan_archive_template', array( $this, 'enable_post_type' ), 10, 1 );
41
+		add_filter('lsx_health_plan_single_template', array($this, 'enable_post_type'), 10, 1);
42
+		add_filter('lsx_health_plan_archive_template', array($this, 'enable_post_type'), 10, 1);
43 43
 
44
-		add_action( 'pre_get_posts', array( $this, 'set_parent_only' ), 10, 1 );
45
-		add_filter( 'get_the_archive_title', array( $this, 'get_the_archive_title' ), 100 );
44
+		add_action('pre_get_posts', array($this, 'set_parent_only'), 10, 1);
45
+		add_filter('get_the_archive_title', array($this, 'get_the_archive_title'), 100);
46 46
 
47 47
 		//Breadcrumbs
48
-		add_filter( 'wpseo_breadcrumb_links', array( $this, 'meal_breadcrumb_filter' ), 30, 1 );
49
-		add_filter( 'woocommerce_get_breadcrumb', array( $this, 'meal_breadcrumb_filter' ), 30, 1 );
48
+		add_filter('wpseo_breadcrumb_links', array($this, 'meal_breadcrumb_filter'), 30, 1);
49
+		add_filter('woocommerce_get_breadcrumb', array($this, 'meal_breadcrumb_filter'), 30, 1);
50 50
 	}
51 51
 
52 52
 	/**
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	 */
59 59
 	public static function get_instance() {
60 60
 		// If the single instance hasn't been set, set it now.
61
-		if ( null === self::$instance ) {
61
+		if (null === self::$instance) {
62 62
 			self::$instance = new self();
63 63
 		}
64 64
 		return self::$instance;
@@ -68,21 +68,21 @@  discard block
 block discarded – undo
68 68
 	 */
69 69
 	public function register_post_type() {
70 70
 		$labels = array(
71
-			'name'               => esc_html__( 'Meals', 'lsx-health-plan' ),
72
-			'singular_name'      => esc_html__( 'Meal', 'lsx-health-plan' ),
73
-			'add_new'            => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ),
74
-			'add_new_item'       => esc_html__( 'Add New', 'lsx-health-plan' ),
75
-			'edit_item'          => esc_html__( 'Edit', 'lsx-health-plan' ),
76
-			'new_item'           => esc_html__( 'New', 'lsx-health-plan' ),
77
-			'all_items'          => esc_html__( 'All Meals', 'lsx-health-plan' ),
78
-			'view_item'          => esc_html__( 'View', 'lsx-health-plan' ),
79
-			'search_items'       => esc_html__( 'Search', 'lsx-health-plan' ),
80
-			'not_found'          => esc_html__( 'None found', 'lsx-health-plan' ),
81
-			'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ),
82
-			'parent_item_colon'  => esc_html__( 'Parent:', 'lsx-health-plan' ),
83
-			'menu_name'          => esc_html__( 'Meals', 'lsx-health-plan' ),
71
+			'name'               => esc_html__('Meals', 'lsx-health-plan'),
72
+			'singular_name'      => esc_html__('Meal', 'lsx-health-plan'),
73
+			'add_new'            => esc_html_x('Add New', 'post type general name', 'lsx-health-plan'),
74
+			'add_new_item'       => esc_html__('Add New', 'lsx-health-plan'),
75
+			'edit_item'          => esc_html__('Edit', 'lsx-health-plan'),
76
+			'new_item'           => esc_html__('New', 'lsx-health-plan'),
77
+			'all_items'          => esc_html__('All Meals', 'lsx-health-plan'),
78
+			'view_item'          => esc_html__('View', 'lsx-health-plan'),
79
+			'search_items'       => esc_html__('Search', 'lsx-health-plan'),
80
+			'not_found'          => esc_html__('None found', 'lsx-health-plan'),
81
+			'not_found_in_trash' => esc_html__('None found in Trash', 'lsx-health-plan'),
82
+			'parent_item_colon'  => esc_html__('Parent:', 'lsx-health-plan'),
83
+			'menu_name'          => esc_html__('Meals', 'lsx-health-plan'),
84 84
 		);
85
-		$args   = array(
85
+		$args = array(
86 86
 			'labels'             => $labels,
87 87
 			'public'             => true,
88 88
 			'publicly_queryable' => true,
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
 			'menu_icon'          => 'dashicons-carrot',
93 93
 			'query_var'          => true,
94 94
 			'rewrite'            => array(
95
-				'slug' => \lsx_health_plan\functions\get_option( 'meal_single_slug', 'meal' ),
95
+				'slug' => \lsx_health_plan\functions\get_option('meal_single_slug', 'meal'),
96 96
 			),
97 97
 			'capability_type'    => 'page',
98
-			'has_archive'        => \lsx_health_plan\functions\get_option( 'endpoint_meal_archive', 'meals' ),
98
+			'has_archive'        => \lsx_health_plan\functions\get_option('endpoint_meal_archive', 'meals'),
99 99
 			'hierarchical'       => true,
100 100
 			'menu_position'      => null,
101 101
 			'supports'           => array(
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 				'custom-fields',
107 107
 			),
108 108
 		);
109
-		register_post_type( 'meal', $args );
109
+		register_post_type('meal', $args);
110 110
 	}
111 111
 
112 112
 	/**
@@ -114,19 +114,19 @@  discard block
 block discarded – undo
114 114
 	 */
115 115
 	public function taxonomy_setup() {
116 116
 		$labels = array(
117
-			'name'              => esc_html_x( 'Meal Type', 'taxonomy general name', 'lsx-health-plan' ),
118
-			'singular_name'     => esc_html_x( 'Meal Types', 'taxonomy singular name', 'lsx-health-plan' ),
119
-			'search_items'      => esc_html__( 'Search', 'lsx-health-plan' ),
120
-			'all_items'         => esc_html__( 'All', 'lsx-health-plan' ),
121
-			'parent_item'       => esc_html__( 'Parent', 'lsx-health-plan' ),
122
-			'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ),
123
-			'edit_item'         => esc_html__( 'Edit', 'lsx-health-plan' ),
124
-			'update_item'       => esc_html__( 'Update', 'lsx-health-plan' ),
125
-			'add_new_item'      => esc_html__( 'Add New', 'lsx-health-plan' ),
126
-			'new_item_name'     => esc_html__( 'New Name', 'lsx-health-plan' ),
127
-			'menu_name'         => esc_html__( 'Meal Types', 'lsx-health-plan' ),
117
+			'name'              => esc_html_x('Meal Type', 'taxonomy general name', 'lsx-health-plan'),
118
+			'singular_name'     => esc_html_x('Meal Types', 'taxonomy singular name', 'lsx-health-plan'),
119
+			'search_items'      => esc_html__('Search', 'lsx-health-plan'),
120
+			'all_items'         => esc_html__('All', 'lsx-health-plan'),
121
+			'parent_item'       => esc_html__('Parent', 'lsx-health-plan'),
122
+			'parent_item_colon' => esc_html__('Parent:', 'lsx-health-plan'),
123
+			'edit_item'         => esc_html__('Edit', 'lsx-health-plan'),
124
+			'update_item'       => esc_html__('Update', 'lsx-health-plan'),
125
+			'add_new_item'      => esc_html__('Add New', 'lsx-health-plan'),
126
+			'new_item_name'     => esc_html__('New Name', 'lsx-health-plan'),
127
+			'menu_name'         => esc_html__('Meal Types', 'lsx-health-plan'),
128 128
 		);
129
-		$args   = array(
129
+		$args = array(
130 130
 			'hierarchical'      => true,
131 131
 			'labels'            => $labels,
132 132
 			'show_ui'           => true,
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 				'slug' => 'meal-type',
138 138
 			),
139 139
 		);
140
-		register_taxonomy( 'meal-type', array( $this->slug ), $args );
140
+		register_taxonomy('meal-type', array($this->slug), $args);
141 141
 	}
142 142
 
143 143
 	/**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 * @param array $post_types
147 147
 	 * @return array
148 148
 	 */
149
-	public function enable_post_type( $post_types = array() ) {
149
+	public function enable_post_type($post_types = array()) {
150 150
 		$post_types[] = $this->slug;
151 151
 		return $post_types;
152 152
 	}
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @param array $connections
158 158
 	 * @return void
159 159
 	 */
160
-	public function enable_connections( $connections = array() ) {
160
+	public function enable_connections($connections = array()) {
161 161
 		$connections['meal']['connected_plans'] = 'connected_meals';
162 162
 		$connections['plan']['connected_meals'] = 'connected_plans';
163 163
 		return $connections;
@@ -169,9 +169,9 @@  discard block
 block discarded – undo
169 169
 	 * @param string $title the term title.
170 170
 	 * @return string
171 171
 	 */
172
-	public function get_the_archive_title( $title ) {
173
-		if ( is_post_type_archive( 'meal' ) ) {
174
-			$title = __( 'Meals', 'lsx-health-plan' );
172
+	public function get_the_archive_title($title) {
173
+		if (is_post_type_archive('meal')) {
174
+			$title = __('Meals', 'lsx-health-plan');
175 175
 		}
176 176
 		return $title;
177 177
 	}
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
 		$cmb = new_cmb2_box(
184 184
 			array(
185 185
 				'id'           => $this->slug . '_featured_metabox_meal',
186
-				'title'        => __( 'Featured Meal', 'lsx-health-plan' ),
187
-				'object_types' => array( $this->slug ), // Post type
186
+				'title'        => __('Featured Meal', 'lsx-health-plan'),
187
+				'object_types' => array($this->slug), // Post type
188 188
 				'context'      => 'side',
189 189
 				'priority'     => 'high',
190 190
 				'show_names'   => true,
@@ -192,8 +192,8 @@  discard block
 block discarded – undo
192 192
 		);
193 193
 		$cmb->add_field(
194 194
 			array(
195
-				'name'       => __( 'Featured Meal', 'lsx-health-plan' ),
196
-				'desc'       => __( 'Enable a featured meal' ),
195
+				'name'       => __('Featured Meal', 'lsx-health-plan'),
196
+				'desc'       => __('Enable a featured meal'),
197 197
 				'id'         => $this->slug . '_featured_meal',
198 198
 				'type'       => 'checkbox',
199 199
 				'show_on_cb' => 'cmb2_hide_if_no_cats',
@@ -205,66 +205,66 @@  discard block
 block discarded – undo
205 205
 	 * Define the metabox and field configurations.
206 206
 	 */
207 207
 	public function details_metaboxes() {
208
-		$cmb = new_cmb2_box( array(
208
+		$cmb = new_cmb2_box(array(
209 209
 			'id'           => $this->slug . '_shopping_list_metabox',
210
-			'title'        => __( 'Shopping List', 'lsx-health-plan' ),
211
-			'object_types' => array( $this->slug ), // Post type
210
+			'title'        => __('Shopping List', 'lsx-health-plan'),
211
+			'object_types' => array($this->slug), // Post type
212 212
 			'context'      => 'normal',
213 213
 			'priority'     => 'high',
214 214
 			'show_names'   => true,
215
-		) );
216
-		$cmb->add_field( array(
217
-			'name'       => __( 'Shopping List', 'lsx-health-plan' ),
218
-			'desc'       => __( 'Connect the shopping list page that applies to this meal by entering the name of the page in the field provided.' ),
215
+		));
216
+		$cmb->add_field(array(
217
+			'name'       => __('Shopping List', 'lsx-health-plan'),
218
+			'desc'       => __('Connect the shopping list page that applies to this meal by entering the name of the page in the field provided.'),
219 219
 			'id'         => $this->slug . '_shopping_list',
220 220
 			'type'       => 'post_search_ajax',
221 221
 			// Optional :
222
-			'limit'      => 1,  // Limit selection to X items only (default 1)
222
+			'limit'      => 1, // Limit selection to X items only (default 1)
223 223
 			'sortable'   => true, // Allow selected items to be sortable (default false)
224 224
 			'query_args' => array(
225
-				'post_type'      => array( 'page' ),
226
-				'post_status'    => array( 'publish' ),
225
+				'post_type'      => array('page'),
226
+				'post_status'    => array('publish'),
227 227
 				'posts_per_page' => -1,
228 228
 			),
229
-		) );
230
-		$cmb = new_cmb2_box( array(
229
+		));
230
+		$cmb = new_cmb2_box(array(
231 231
 			'id'           => $this->slug . '_details_metabox',
232
-			'title'        => __( 'Meal Details', 'lsx-health-plan' ),
233
-			'object_types' => array( $this->slug ), // Post type
232
+			'title'        => __('Meal Details', 'lsx-health-plan'),
233
+			'object_types' => array($this->slug), // Post type
234 234
 			'context'      => 'normal',
235 235
 			'priority'     => 'high',
236 236
 			'show_names'   => true,
237
-		) );
237
+		));
238 238
 
239
-		$cmb->add_field( array(
240
-			'name' => __( 'Meal Short Description', 'lsx-health-plan' ),
239
+		$cmb->add_field(array(
240
+			'name' => __('Meal Short Description', 'lsx-health-plan'),
241 241
 			'id'   => $this->slug . '_short_description',
242 242
 			'type' => 'textarea_small',
243
-			'desc' => __( 'Add a small description for this meal (optional)', 'lsx-health-plan' ),
244
-		) );
243
+			'desc' => __('Add a small description for this meal (optional)', 'lsx-health-plan'),
244
+		));
245 245
 
246
-		$cmb->add_field( array(
247
-			'name'       => __( 'Pre Breakfast Snack', 'lsx-health-plan' ),
246
+		$cmb->add_field(array(
247
+			'name'       => __('Pre Breakfast Snack', 'lsx-health-plan'),
248 248
 			'id'         => $this->slug . '_pre_breakfast_snack',
249 249
 			'type'       => 'wysiwyg',
250 250
 			'show_on_cb' => 'cmb2_hide_if_no_cats',
251 251
 			'options'    => array(
252 252
 				'textarea_rows' => 5,
253 253
 			),
254
-		) );
255
-		$cmb->add_field( array(
256
-			'name'       => __( 'Breakfast', 'lsx-health-plan' ),
254
+		));
255
+		$cmb->add_field(array(
256
+			'name'       => __('Breakfast', 'lsx-health-plan'),
257 257
 			'id'         => $this->slug . '_breakfast',
258 258
 			'type'       => 'wysiwyg',
259 259
 			'show_on_cb' => 'cmb2_hide_if_no_cats',
260 260
 			'options'    => array(
261 261
 				'textarea_rows' => 5,
262 262
 			),
263
-		) );
263
+		));
264 264
 
265 265
 		$cmb->add_field(
266 266
 			array(
267
-				'name'       => __( 'Post Breakfast Snack', 'lsx-health-plan' ),
267
+				'name'       => __('Post Breakfast Snack', 'lsx-health-plan'),
268 268
 				'id'         => $this->slug . '_breakfast_snack',
269 269
 				'type'       => 'wysiwyg',
270 270
 				'show_on_cb' => 'cmb2_hide_if_no_cats',
@@ -274,19 +274,19 @@  discard block
 block discarded – undo
274 274
 			)
275 275
 		);
276 276
 
277
-		if ( post_type_exists( 'recipe' ) ) {
277
+		if (post_type_exists('recipe')) {
278 278
 			$cmb->add_field(
279 279
 				array(
280
-					'name'       => __( 'Breakfast Recipes', 'lsx-health-plan' ),
281
-					'desc'       => __( 'Connect additional recipes options for breakfast.', 'lsx-health-plan' ),
280
+					'name'       => __('Breakfast Recipes', 'lsx-health-plan'),
281
+					'desc'       => __('Connect additional recipes options for breakfast.', 'lsx-health-plan'),
282 282
 					'id'         => 'breakfast_recipes',
283 283
 					'type'       => 'post_search_ajax',
284 284
 					// Optional :
285
-					'limit'      => 15,  // Limit selection to X items only (default 1)
285
+					'limit'      => 15, // Limit selection to X items only (default 1)
286 286
 					'sortable'   => true, // Allow selected items to be sortable (default false)
287 287
 					'query_args' => array(
288
-						'post_type'      => array( 'recipe' ),
289
-						'post_status'    => array( 'publish' ),
288
+						'post_type'      => array('recipe'),
289
+						'post_status'    => array('publish'),
290 290
 						'posts_per_page' => -1,
291 291
 					),
292 292
 				)
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 
296 296
 		$cmb->add_field(
297 297
 			array(
298
-				'name'       => __( 'Pre Lunch Snack', 'lsx-health-plan' ),
298
+				'name'       => __('Pre Lunch Snack', 'lsx-health-plan'),
299 299
 				'id'         => $this->slug . '_pre_lunch_snack',
300 300
 				'type'       => 'wysiwyg',
301 301
 				'show_on_cb' => 'cmb2_hide_if_no_cats',
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 		);
307 307
 		$cmb->add_field(
308 308
 			array(
309
-				'name'       => __( 'Lunch', 'lsx-health-plan' ),
309
+				'name'       => __('Lunch', 'lsx-health-plan'),
310 310
 				'id'         => $this->slug . '_lunch',
311 311
 				'type'       => 'wysiwyg',
312 312
 				'show_on_cb' => 'cmb2_hide_if_no_cats',
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 		);
318 318
 		$cmb->add_field(
319 319
 			array(
320
-				'name'       => __( 'Post Lunch Snack', 'lsx-health-plan' ),
320
+				'name'       => __('Post Lunch Snack', 'lsx-health-plan'),
321 321
 				'id'         => $this->slug . '_lunch_snack',
322 322
 				'type'       => 'wysiwyg',
323 323
 				'show_on_cb' => 'cmb2_hide_if_no_cats',
@@ -327,19 +327,19 @@  discard block
 block discarded – undo
327 327
 			)
328 328
 		);
329 329
 
330
-		if ( post_type_exists( 'recipe' ) ) {
330
+		if (post_type_exists('recipe')) {
331 331
 			$cmb->add_field(
332 332
 				array(
333
-					'name'       => __( 'Lunch Recipes', 'lsx-health-plan' ),
334
-					'desc'       => __( 'Connect additional recipes options for lunch.', 'lsx-health-plan' ),
333
+					'name'       => __('Lunch Recipes', 'lsx-health-plan'),
334
+					'desc'       => __('Connect additional recipes options for lunch.', 'lsx-health-plan'),
335 335
 					'id'         => 'lunch_recipes',
336 336
 					'type'       => 'post_search_ajax',
337 337
 					// Optional :
338
-					'limit'      => 15,  // Limit selection to X items only (default 1)
338
+					'limit'      => 15, // Limit selection to X items only (default 1)
339 339
 					'sortable'   => true, // Allow selected items to be sortable (default false)
340 340
 					'query_args' => array(
341
-						'post_type'      => array( 'recipe' ),
342
-						'post_status'    => array( 'publish' ),
341
+						'post_type'      => array('recipe'),
342
+						'post_status'    => array('publish'),
343 343
 						'posts_per_page' => -1,
344 344
 					),
345 345
 				)
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 
349 349
 		$cmb->add_field(
350 350
 			array(
351
-				'name'       => __( 'Pre Dinner Snack', 'lsx-health-plan' ),
351
+				'name'       => __('Pre Dinner Snack', 'lsx-health-plan'),
352 352
 				'id'         => $this->slug . '_pre_dinner_snack',
353 353
 				'type'       => 'wysiwyg',
354 354
 				'show_on_cb' => 'cmb2_hide_if_no_cats',
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 		);
360 360
 		$cmb->add_field(
361 361
 			array(
362
-				'name'       => __( 'Dinner', 'lsx-health-plan' ),
362
+				'name'       => __('Dinner', 'lsx-health-plan'),
363 363
 				'id'         => $this->slug . '_dinner',
364 364
 				'type'       => 'wysiwyg',
365 365
 				'show_on_cb' => 'cmb2_hide_if_no_cats',
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 		);
371 371
 		$cmb->add_field(
372 372
 			array(
373
-				'name'       => __( 'Post Dinner Snack', 'lsx-health-plan' ),
373
+				'name'       => __('Post Dinner Snack', 'lsx-health-plan'),
374 374
 				'id'         => $this->slug . '_dinner_snack',
375 375
 				'type'       => 'wysiwyg',
376 376
 				'show_on_cb' => 'cmb2_hide_if_no_cats',
@@ -380,19 +380,19 @@  discard block
 block discarded – undo
380 380
 			)
381 381
 		);
382 382
 
383
-		if ( post_type_exists( 'recipe' ) ) {
383
+		if (post_type_exists('recipe')) {
384 384
 			$cmb->add_field(
385 385
 				array(
386
-					'name'       => __( 'Dinner Recipes', 'lsx-health-plan' ),
387
-					'desc'       => __( 'Connect additional recipes options for dinner.', 'lsx-health-plan' ),
386
+					'name'       => __('Dinner Recipes', 'lsx-health-plan'),
387
+					'desc'       => __('Connect additional recipes options for dinner.', 'lsx-health-plan'),
388 388
 					'id'         => 'dinner_recipes',
389 389
 					'type'       => 'post_search_ajax',
390 390
 					// Optional :
391
-					'limit'      => 15,  // Limit selection to X items only (default 1)
391
+					'limit'      => 15, // Limit selection to X items only (default 1)
392 392
 					'sortable'   => true, // Allow selected items to be sortable (default false)
393 393
 					'query_args' => array(
394
-						'post_type'      => array( 'recipe' ),
395
-						'post_status'    => array( 'publish' ),
394
+						'post_type'      => array('recipe'),
395
+						'post_status'    => array('publish'),
396 396
 						'posts_per_page' => -1,
397 397
 					),
398 398
 				)
@@ -405,9 +405,9 @@  discard block
 block discarded – undo
405 405
 	 * @param object $wp_query
406 406
 	 * @return array
407 407
 	 */
408
-	public function set_parent_only( $wp_query ) {
409
-		if ( ! is_admin() && $wp_query->is_main_query() && ( $wp_query->is_post_type_archive( 'meal' ) || $wp_query->is_tax( array( 'meal-type' ) ) ) ) {
410
-			$wp_query->set( 'post_parent', '0' );
408
+	public function set_parent_only($wp_query) {
409
+		if ( ! is_admin() && $wp_query->is_main_query() && ($wp_query->is_post_type_archive('meal') || $wp_query->is_tax(array('meal-type')))) {
410
+			$wp_query->set('post_parent', '0');
411 411
 		}
412 412
 	}
413 413
 
@@ -418,24 +418,24 @@  discard block
 block discarded – undo
418 418
 	 * @var array $crumbs
419 419
 	 * @return array
420 420
 	 */
421
-	public function meal_breadcrumb_filter( $crumbs ) {
422
-		$meal  = \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' );
423
-		$meals = \lsx_health_plan\functions\get_option( 'endpoint_meal_archive', 'meal' );
421
+	public function meal_breadcrumb_filter($crumbs) {
422
+		$meal  = \lsx_health_plan\functions\get_option('endpoint_meal', 'meal');
423
+		$meals = \lsx_health_plan\functions\get_option('endpoint_meal_archive', 'meal');
424 424
 
425
-		if ( is_singular( 'meal' ) ) {	
425
+		if (is_singular('meal')) {	
426 426
 			$meal_name     = get_the_title();
427
-			$url           = get_post_type_archive_link( $meal );
428
-			$term_obj_list = get_the_terms( get_the_ID(), 'meal-type' );
427
+			$url           = get_post_type_archive_link($meal);
428
+			$term_obj_list = get_the_terms(get_the_ID(), 'meal-type');
429 429
 			$meal_type     = $term_obj_list[0]->name;
430
-			if ( empty( $meal_type ) ) {
431
-				$meal_type = __( 'Meal', 'lsx-health-plan' );
430
+			if (empty($meal_type)) {
431
+				$meal_type = __('Meal', 'lsx-health-plan');
432 432
 			}
433
-			$meal_type_url = get_term_link( $term_obj_list[0]->term_id );
433
+			$meal_type_url = get_term_link($term_obj_list[0]->term_id);
434 434
 
435 435
 			$new_crumbs    = array();
436 436
 			$new_crumbs[0] = $crumbs[0];
437 437
 
438
-			if ( function_exists( 'woocommerce_breadcrumb' ) ) {
438
+			if (function_exists('woocommerce_breadcrumb')) {
439 439
 				$new_crumbs[1] = array(
440 440
 					0 => $meals,
441 441
 					1 => $url,
@@ -463,12 +463,12 @@  discard block
 block discarded – undo
463 463
 			$crumbs = $new_crumbs;
464 464
 
465 465
 		}
466
-		if ( is_post_type_archive( 'meal' ) ) {
466
+		if (is_post_type_archive('meal')) {
467 467
 
468 468
 			$new_crumbs    = array();
469 469
 			$new_crumbs[0] = $crumbs[0];
470 470
 
471
-			if ( function_exists( 'woocommerce_breadcrumb' ) ) {
471
+			if (function_exists('woocommerce_breadcrumb')) {
472 472
 				$new_crumbs[1] = array(
473 473
 					0 => $meals,
474 474
 				);
Please login to merge, or discard this patch.