Passed
Push — dependabot/github_actions/styf... ( 4ca7c3 )
by
unknown
10:47
created
templates/single-plan-tabs.php 2 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -8,14 +8,14 @@  discard block
 block discarded – undo
8 8
 $plan_link       = get_permalink();
9 9
 $current_section = get_query_var( 'section', false );
10 10
 if ( '' !== $current_section ) {
11
-	$plan_link = \lsx_health_plan\functions\plan\get_permalink( get_the_ID(), $current_section );
11
+     $plan_link = \lsx_health_plan\functions\plan\get_permalink( get_the_ID(), $current_section );
12 12
 }
13 13
 
14 14
 if ( false !== $current_section && \lsx_health_plan\functions\plan\has_sections() ) {
15
-	$section_info = \lsx_health_plan\functions\plan\get_section_info( $current_section );
16
-	if ( empty( $section_info ) || ( isset( $section_info['rest_day_enabled'] ) && ! empty( $section_info['rest_day_enabled'] ) && ! lsx_health_plan_has_meal() ) ) {
17
-		return;
18
-	}
15
+     $section_info = \lsx_health_plan\functions\plan\get_section_info( $current_section );
16
+     if ( empty( $section_info ) || ( isset( $section_info['rest_day_enabled'] ) && ! empty( $section_info['rest_day_enabled'] ) && ! lsx_health_plan_has_meal() ) ) {
17
+          return;
18
+     }
19 19
 }
20 20
 
21 21
 ?>
@@ -23,33 +23,33 @@  discard block
 block discarded – undo
23 23
 	<ul class="nav nav-pills">
24 24
 		<li class="<?php lsx_health_plan_nav_class( '' ); ?>"><a class="overview-tab" href="<?php echo esc_attr( $plan_link ); ?>"><?php lsx_get_svg_icon( 'eye.svg' ); ?> <?php esc_html_e( 'Overview', 'lsx-health-plan' ); ?></a></li>
25 25
 		<?php
26
-		if ( lsx_health_plan_has_warmup() ) {
27
-			$warm_up = \lsx_health_plan\functions\get_option( 'endpoint_warm_up', false );
28
-			if ( false === $warm_up ) {
29
-				$warm_up = 'warm-up';
30
-			}
31
-			?>
26
+          if ( lsx_health_plan_has_warmup() ) {
27
+               $warm_up = \lsx_health_plan\functions\get_option( 'endpoint_warm_up', false );
28
+               if ( false === $warm_up ) {
29
+                    $warm_up = 'warm-up';
30
+               }
31
+               ?>
32 32
 				<li class="<?php lsx_health_plan_nav_class( 'warm-up' ); ?>"><a class="warm-up-tab" href="<?php echo esc_attr( $plan_link ); ?><?php echo esc_attr( $warm_up ); ?>/"><?php lsx_get_svg_icon( 'warm.svg' ); ?> <?php esc_html_e( 'Warm-up', 'lsx-health-plan' ); ?></a></li>				
33 33
 			<?php
34
-		}
35
-		if ( lsx_health_plan_has_workout() ) {
36
-			$workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', false );
37
-			if ( false === $workout ) {
38
-				$workout = 'workout';
39
-			}
40
-			?>
34
+          }
35
+          if ( lsx_health_plan_has_workout() ) {
36
+               $workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', false );
37
+               if ( false === $workout ) {
38
+                    $workout = 'workout';
39
+               }
40
+               ?>
41 41
 				<li class="<?php lsx_health_plan_nav_class( 'workout' ); ?>"><a class="workout-tab" href="<?php echo esc_attr( $plan_link ); ?><?php echo esc_attr( $workout ); ?>/"><?php lsx_get_svg_icon( 'work.svg' ); ?> <?php esc_html_e( 'Workout', 'lsx-health-plan' ); ?></a></li>
42 42
 			<?php
43
-		}
44
-		if ( lsx_health_plan_has_meal() ) {
45
-			$meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', false );
46
-			if ( false === $meal ) {
47
-				$meal = 'meal';
48
-			}
49
-			?>
43
+          }
44
+          if ( lsx_health_plan_has_meal() ) {
45
+               $meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', false );
46
+               if ( false === $meal ) {
47
+                    $meal = 'meal';
48
+               }
49
+               ?>
50 50
 				<li class="<?php lsx_health_plan_nav_class( 'meal' ); ?>"><a class="meal-plan-tab" href="<?php echo esc_attr( $plan_link ); ?><?php echo esc_attr( $meal ); ?>/"><?php lsx_get_svg_icon( 'meal.svg' ); ?> <?php esc_html_e( 'Meal Plan', 'lsx-health-plan' ); ?></a></li>
51 51
 			<?php
52
-		}
53
-		?>
52
+          }
53
+          ?>
54 54
 	</ul>
55 55
 </div>
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -6,14 +6,14 @@  discard block
 block discarded – undo
6 6
 */
7 7
 
8 8
 $plan_link       = get_permalink();
9
-$current_section = get_query_var( 'section', false );
10
-if ( '' !== $current_section ) {
11
-	$plan_link = \lsx_health_plan\functions\plan\get_permalink( get_the_ID(), $current_section );
9
+$current_section = get_query_var('section', false);
10
+if ('' !== $current_section) {
11
+	$plan_link = \lsx_health_plan\functions\plan\get_permalink(get_the_ID(), $current_section);
12 12
 }
13 13
 
14
-if ( false !== $current_section && \lsx_health_plan\functions\plan\has_sections() ) {
15
-	$section_info = \lsx_health_plan\functions\plan\get_section_info( $current_section );
16
-	if ( empty( $section_info ) || ( isset( $section_info['rest_day_enabled'] ) && ! empty( $section_info['rest_day_enabled'] ) && ! lsx_health_plan_has_meal() ) ) {
14
+if (false !== $current_section && \lsx_health_plan\functions\plan\has_sections()) {
15
+	$section_info = \lsx_health_plan\functions\plan\get_section_info($current_section);
16
+	if (empty($section_info) || (isset($section_info['rest_day_enabled']) && ! empty($section_info['rest_day_enabled']) && ! lsx_health_plan_has_meal())) {
17 17
 		return;
18 18
 	}
19 19
 }
@@ -21,33 +21,33 @@  discard block
 block discarded – undo
21 21
 ?>
22 22
 <div id="single-plan-nav">
23 23
 	<ul class="nav nav-pills">
24
-		<li class="<?php lsx_health_plan_nav_class( '' ); ?>"><a class="overview-tab" href="<?php echo esc_attr( $plan_link ); ?>"><?php lsx_get_svg_icon( 'eye.svg' ); ?> <?php esc_html_e( 'Overview', 'lsx-health-plan' ); ?></a></li>
24
+		<li class="<?php lsx_health_plan_nav_class(''); ?>"><a class="overview-tab" href="<?php echo esc_attr($plan_link); ?>"><?php lsx_get_svg_icon('eye.svg'); ?> <?php esc_html_e('Overview', 'lsx-health-plan'); ?></a></li>
25 25
 		<?php
26
-		if ( lsx_health_plan_has_warmup() ) {
27
-			$warm_up = \lsx_health_plan\functions\get_option( 'endpoint_warm_up', false );
28
-			if ( false === $warm_up ) {
26
+		if (lsx_health_plan_has_warmup()) {
27
+			$warm_up = \lsx_health_plan\functions\get_option('endpoint_warm_up', false);
28
+			if (false === $warm_up) {
29 29
 				$warm_up = 'warm-up';
30 30
 			}
31 31
 			?>
32
-				<li class="<?php lsx_health_plan_nav_class( 'warm-up' ); ?>"><a class="warm-up-tab" href="<?php echo esc_attr( $plan_link ); ?><?php echo esc_attr( $warm_up ); ?>/"><?php lsx_get_svg_icon( 'warm.svg' ); ?> <?php esc_html_e( 'Warm-up', 'lsx-health-plan' ); ?></a></li>				
32
+				<li class="<?php lsx_health_plan_nav_class('warm-up'); ?>"><a class="warm-up-tab" href="<?php echo esc_attr($plan_link); ?><?php echo esc_attr($warm_up); ?>/"><?php lsx_get_svg_icon('warm.svg'); ?> <?php esc_html_e('Warm-up', 'lsx-health-plan'); ?></a></li>				
33 33
 			<?php
34 34
 		}
35
-		if ( lsx_health_plan_has_workout() ) {
36
-			$workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', false );
37
-			if ( false === $workout ) {
35
+		if (lsx_health_plan_has_workout()) {
36
+			$workout = \lsx_health_plan\functions\get_option('endpoint_workout', false);
37
+			if (false === $workout) {
38 38
 				$workout = 'workout';
39 39
 			}
40 40
 			?>
41
-				<li class="<?php lsx_health_plan_nav_class( 'workout' ); ?>"><a class="workout-tab" href="<?php echo esc_attr( $plan_link ); ?><?php echo esc_attr( $workout ); ?>/"><?php lsx_get_svg_icon( 'work.svg' ); ?> <?php esc_html_e( 'Workout', 'lsx-health-plan' ); ?></a></li>
41
+				<li class="<?php lsx_health_plan_nav_class('workout'); ?>"><a class="workout-tab" href="<?php echo esc_attr($plan_link); ?><?php echo esc_attr($workout); ?>/"><?php lsx_get_svg_icon('work.svg'); ?> <?php esc_html_e('Workout', 'lsx-health-plan'); ?></a></li>
42 42
 			<?php
43 43
 		}
44
-		if ( lsx_health_plan_has_meal() ) {
45
-			$meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', false );
46
-			if ( false === $meal ) {
44
+		if (lsx_health_plan_has_meal()) {
45
+			$meal = \lsx_health_plan\functions\get_option('endpoint_meal', false);
46
+			if (false === $meal) {
47 47
 				$meal = 'meal';
48 48
 			}
49 49
 			?>
50
-				<li class="<?php lsx_health_plan_nav_class( 'meal' ); ?>"><a class="meal-plan-tab" href="<?php echo esc_attr( $plan_link ); ?><?php echo esc_attr( $meal ); ?>/"><?php lsx_get_svg_icon( 'meal.svg' ); ?> <?php esc_html_e( 'Meal Plan', 'lsx-health-plan' ); ?></a></li>
50
+				<li class="<?php lsx_health_plan_nav_class('meal'); ?>"><a class="meal-plan-tab" href="<?php echo esc_attr($plan_link); ?><?php echo esc_attr($meal); ?>/"><?php lsx_get_svg_icon('meal.svg'); ?> <?php esc_html_e('Meal Plan', 'lsx-health-plan'); ?></a></li>
51 51
 			<?php
52 52
 		}
53 53
 		?>
Please login to merge, or discard this patch.
classes/admin/class-settings.php 2 patches
Indentation   +225 added lines, -225 removed lines patch added patch discarded remove patch
@@ -12,257 +12,257 @@
 block discarded – undo
12 12
  */
13 13
 class Settings {
14 14
 
15
-	/**
16
-	 * Holds class instance
17
-	 *
18
-	 * @since 1.0.0
19
-	 *
20
-	 * @var      object \lsx_health_plan\classes\admin\Settings()
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\Settings()
21
+      */
22
+     protected static $instance = null;
23 23
 
24
-	/**
25
-	 * Option key, and option page slug
26
-	 *
27
-	 * @var string
28
-	 */
29
-	protected $screen_id = 'lsx_health_plan_settings';
24
+     /**
25
+      * Option key, and option page slug
26
+      *
27
+      * @var string
28
+      */
29
+     protected $screen_id = 'lsx_health_plan_settings';
30 30
 
31
-	/**
32
-	 * An array of the post types for the Global Downloads field.
33
-	 *
34
-	 * @var array
35
-	 */
36
-	public $download_types = array();
31
+     /**
32
+      * An array of the post types for the Global Downloads field.
33
+      *
34
+      * @var array
35
+      */
36
+     public $download_types = array();
37 37
 
38
-	/**
39
-	 * An array of the post types for the Global Defaults field.
40
-	 *
41
-	 * @var array
42
-	 */
43
-	//public $default_types = array();
38
+     /**
39
+      * An array of the post types for the Global Defaults field.
40
+      *
41
+      * @var array
42
+      */
43
+     //public $default_types = array();
44 44
 
45
-	/**
46
-	 * An array of the endpoints for the Endpoint Translation field.
47
-	 *
48
-	 * @var array
49
-	 */
50
-	public $endpoints = array();
45
+     /**
46
+      * An array of the endpoints for the Endpoint Translation field.
47
+      *
48
+      * @var array
49
+      */
50
+     public $endpoints = array();
51 51
 
52
-	/**
53
-	 * Constructor
54
-	 */
55
-	public function __construct() {
56
-		$this->load_classes();
57
-		add_action( 'cmb2_admin_init', array( $this, 'register_settings_page' ) );
58
-		add_action( 'lsx_hp_settings_page', array( $this, 'generate_tabs' ), 1, 1 );
52
+     /**
53
+      * Constructor
54
+      */
55
+     public function __construct() {
56
+          $this->load_classes();
57
+          add_action( 'cmb2_admin_init', array( $this, 'register_settings_page' ) );
58
+          add_action( 'lsx_hp_settings_page', array( $this, 'generate_tabs' ), 1, 1 );
59 59
 
60
-		add_action( 'lsx_hp_settings_page_general_top', array( $this, 'general_settings' ), 1, 1 );
61
-	}
60
+          add_action( 'lsx_hp_settings_page_general_top', array( $this, 'general_settings' ), 1, 1 );
61
+     }
62 62
 
63
-	/**
64
-	 * Return an instance of this class.
65
-	 *
66
-	 * @since 1.0.0
67
-	 *
68
-	 * @return    object \lsx_health_plan\classes\admin\Settings()    A single instance of this class.
69
-	 */
70
-	public static function get_instance() {
71
-		// If the single instance hasn't been set, set it now.
72
-		if ( null === self::$instance ) {
73
-			self::$instance = new self();
74
-		}
75
-		return self::$instance;
76
-	}
63
+     /**
64
+      * Return an instance of this class.
65
+      *
66
+      * @since 1.0.0
67
+      *
68
+      * @return    object \lsx_health_plan\classes\admin\Settings()    A single instance of this class.
69
+      */
70
+     public static function get_instance() {
71
+          // If the single instance hasn't been set, set it now.
72
+          if ( null === self::$instance ) {
73
+               self::$instance = new self();
74
+          }
75
+          return self::$instance;
76
+     }
77 77
 
78
-	/**
79
-	 * Loads the variable classes and the static classes.
80
-	 */
81
-	private function load_classes() {
78
+     /**
79
+      * Loads the variable classes and the static classes.
80
+      */
81
+     private function load_classes() {
82 82
 
83
-		$this->post_types = array(
84
-			'my-plans',
85
-			'workout',
86
-			'exercise',
87
-			'meal',
88
-			'recipe',
89
-			//'tip',
90
-			'recipe',
91
-		);
83
+          $this->post_types = array(
84
+               'my-plans',
85
+               'workout',
86
+               'exercise',
87
+               'meal',
88
+               'recipe',
89
+               //'tip',
90
+               'recipe',
91
+          );
92 92
 
93
-		foreach ( $this->post_types as $post_type ) {
94
-			$this->$post_type = require_once LSX_HEALTH_PLAN_PATH . 'classes/admin/settings/class-' . $post_type . '.php';
95
-		}
93
+          foreach ( $this->post_types as $post_type ) {
94
+               $this->$post_type = require_once LSX_HEALTH_PLAN_PATH . 'classes/admin/settings/class-' . $post_type . '.php';
95
+          }
96 96
 
97
-	}
97
+     }
98 98
 
99
-	/**
100
-	 * Hook in and register a submenu options page for the Page post-type menu.
101
-	 */
102
-	public function register_settings_page() {
103
-		$cmb = new_cmb2_box(
104
-			array(
105
-				'id'           => $this->screen_id,
106
-				'title'        => esc_html__( 'Settings', 'lsx-health-plan' ),
107
-				'object_types' => array( 'options-page' ),
108
-				'option_key'   => 'lsx_health_plan_options', // The option key and admin menu page slug.
109
-				'parent_slug'  => 'edit.php?post_type=plan', // Make options page a submenu item of the themes menu.
110
-				'capability'   => 'manage_options', // Cap required to view options-page.
111
-			)
112
-		);
113
-		do_action( 'lsx_hp_settings_page', $cmb );
114
-	}
99
+     /**
100
+      * Hook in and register a submenu options page for the Page post-type menu.
101
+      */
102
+     public function register_settings_page() {
103
+          $cmb = new_cmb2_box(
104
+               array(
105
+                    'id'           => $this->screen_id,
106
+                    'title'        => esc_html__( 'Settings', 'lsx-health-plan' ),
107
+                    'object_types' => array( 'options-page' ),
108
+                    'option_key'   => 'lsx_health_plan_options', // The option key and admin menu page slug.
109
+                    'parent_slug'  => 'edit.php?post_type=plan', // Make options page a submenu item of the themes menu.
110
+                    'capability'   => 'manage_options', // Cap required to view options-page.
111
+               )
112
+          );
113
+          do_action( 'lsx_hp_settings_page', $cmb );
114
+     }
115 115
 
116
-	/**
117
-	 * Registers the general settings.
118
-	 *
119
-	 * @param object $cmb new_cmb2_box().
120
-	 * @return void
121
-	 */
122
-	public function general_settings( $cmb ) {
123
-		$cmb->add_field(
124
-			array(
125
-				'name'        => __( 'Exercises', 'lsx-health-plan' ),
126
-				'id'          => 'exercise_enabled',
127
-				'type'        => 'checkbox',
128
-				'value'       => 1,
129
-				'default'     => 0,
130
-				'description' => __( 'Enabling the exercise post type will automatically replace the Video post type.', 'lsx-health-plan' ),
131
-			)
132
-		);
116
+     /**
117
+      * Registers the general settings.
118
+      *
119
+      * @param object $cmb new_cmb2_box().
120
+      * @return void
121
+      */
122
+     public function general_settings( $cmb ) {
123
+          $cmb->add_field(
124
+               array(
125
+                    'name'        => __( 'Exercises', 'lsx-health-plan' ),
126
+                    'id'          => 'exercise_enabled',
127
+                    'type'        => 'checkbox',
128
+                    'value'       => 1,
129
+                    'default'     => 0,
130
+                    'description' => __( 'Enabling the exercise post type will automatically replace the Video post type.', 'lsx-health-plan' ),
131
+               )
132
+          );
133 133
 
134
-		$cmb->add_field(
135
-			array(
136
-				'name'        => __( 'Disable Workouts', 'lsx-health-plan' ),
137
-				'id'          => 'workout_disabled',
138
-				'type'        => 'checkbox',
139
-				'value'       => 1,
140
-				'default'     => 0,
141
-				'description' => __( 'Disable workout post type if you are wanting a minimal site.', 'lsx-health-plan' ),
142
-			)
143
-		);
134
+          $cmb->add_field(
135
+               array(
136
+                    'name'        => __( 'Disable Workouts', 'lsx-health-plan' ),
137
+                    'id'          => 'workout_disabled',
138
+                    'type'        => 'checkbox',
139
+                    'value'       => 1,
140
+                    'default'     => 0,
141
+                    'description' => __( 'Disable workout post type if you are wanting a minimal site.', 'lsx-health-plan' ),
142
+               )
143
+          );
144 144
 
145
-		$cmb->add_field(
146
-			array(
147
-				'name'        => __( 'Disable Recipes', 'lsx-health-plan' ),
148
-				'id'          => 'recipe_disabled',
149
-				'type'        => 'checkbox',
150
-				'value'       => 1,
151
-				'default'     => 0,
152
-				'description' => __( 'Disable recipe post type if you are wanting a minimal site.', 'lsx-health-plan' ),
153
-			)
154
-		);
145
+          $cmb->add_field(
146
+               array(
147
+                    'name'        => __( 'Disable Recipes', 'lsx-health-plan' ),
148
+                    'id'          => 'recipe_disabled',
149
+                    'type'        => 'checkbox',
150
+                    'value'       => 1,
151
+                    'default'     => 0,
152
+                    'description' => __( 'Disable recipe post type if you are wanting a minimal site.', 'lsx-health-plan' ),
153
+               )
154
+          );
155 155
 
156
-		$cmb->add_field(
157
-			array(
158
-				'name'        => __( 'Disable Meals', 'lsx-health-plan' ),
159
-				'id'          => 'meal_disabled',
160
-				'type'        => 'checkbox',
161
-				'value'       => 1,
162
-				'default'     => 0,
163
-				'description' => __( 'Disable meal post type if you are wanting a minimal site.', 'lsx-health-plan' ),
164
-			)
165
-		);
156
+          $cmb->add_field(
157
+               array(
158
+                    'name'        => __( 'Disable Meals', 'lsx-health-plan' ),
159
+                    'id'          => 'meal_disabled',
160
+                    'type'        => 'checkbox',
161
+                    'value'       => 1,
162
+                    'default'     => 0,
163
+                    'description' => __( 'Disable meal post type if you are wanting a minimal site.', 'lsx-health-plan' ),
164
+               )
165
+          );
166 166
 		
167 167
 
168
-		$cmb->add_field(
169
-			array(
170
-				'name'      =>  __( 'Login Slug', 'lsx-health-plan' ),
171
-				'id'        => 'login_slug',
172
-				'type'      => 'input',
173
-				'value'     => '',
174
-				'default'   => 'login',
175
-				'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' ),
176
-			)
177
-		);
168
+          $cmb->add_field(
169
+               array(
170
+                    'name'      =>  __( 'Login Slug', 'lsx-health-plan' ),
171
+                    'id'        => 'login_slug',
172
+                    'type'      => 'input',
173
+                    'value'     => '',
174
+                    'default'   => 'login',
175
+                    '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' ),
176
+               )
177
+          );
178 178
 
179
-	}
179
+     }
180 180
 
181
-	/**
182
-	 * Enable Business Directory Search settings only if LSX Search plugin is enabled.
183
-	 *
184
-	 * @param object $cmb The CMB2() class.
185
-	 * @param string $section either engine,archive or single.
186
-	 * @return void
187
-	 */
188
-	public function generate_tabs( $cmb ) {
189
-		$tabs = $this->get_settings_tabs();
181
+     /**
182
+      * Enable Business Directory Search settings only if LSX Search plugin is enabled.
183
+      *
184
+      * @param object $cmb The CMB2() class.
185
+      * @param string $section either engine,archive or single.
186
+      * @return void
187
+      */
188
+     public function generate_tabs( $cmb ) {
189
+          $tabs = $this->get_settings_tabs();
190 190
 
191
-		foreach ( $tabs as $tab_key => $tab ) {
192
-			$cmb->add_field(
193
-				array(
194
-					'id'          => 'settings_' . $tab_key . '_title',
195
-					'type'        => 'title',
196
-					'name'        => $tab['title'],
197
-					'default'     => $tab['title'],
198
-					'description' => $tab['desc'],
199
-				)
200
-			);
201
-			do_action( 'lsx_hp_settings_page_' . $tab_key . '_top', $cmb );
191
+          foreach ( $tabs as $tab_key => $tab ) {
192
+               $cmb->add_field(
193
+                    array(
194
+                         'id'          => 'settings_' . $tab_key . '_title',
195
+                         'type'        => 'title',
196
+                         'name'        => $tab['title'],
197
+                         'default'     => $tab['title'],
198
+                         'description' => $tab['desc'],
199
+                    )
200
+               );
201
+               do_action( 'lsx_hp_settings_page_' . $tab_key . '_top', $cmb );
202 202
 
203
-			do_action( 'lsx_hp_settings_page_' . $tab_key . '_middle', $cmb );
203
+               do_action( 'lsx_hp_settings_page_' . $tab_key . '_middle', $cmb );
204 204
 
205
-			do_action( 'lsx_hp_settings_page_' . $tab_key . '_bottom', $cmb );
205
+               do_action( 'lsx_hp_settings_page_' . $tab_key . '_bottom', $cmb );
206 206
 
207
-			$cmb->add_field(
208
-				array(
209
-					'id'   => 'settings_' . $tab_key . '_closing',
210
-					'type' => 'tab_closing',
211
-				)
212
-			);
213
-		}
214
-	}
207
+               $cmb->add_field(
208
+                    array(
209
+                         'id'   => 'settings_' . $tab_key . '_closing',
210
+                         'type' => 'tab_closing',
211
+                    )
212
+               );
213
+          }
214
+     }
215 215
 
216 216
 
217
-	/**
218
-	 * Returns the tabs and their descriptions.
219
-	 *
220
-	 * @return array
221
-	 */
222
-	public function get_settings_tabs() {
223
-		$tabs = array(
224
-			'general' => array(
225
-				'title' => __( 'General', 'lsx-health-plan' ),
226
-				'desc'  => __( 'Control the sitewide settings for the LSX HP site.', 'lsx-health-plan' ),
227
-			),
228
-		);
217
+     /**
218
+      * Returns the tabs and their descriptions.
219
+      *
220
+      * @return array
221
+      */
222
+     public function get_settings_tabs() {
223
+          $tabs = array(
224
+               'general' => array(
225
+                    'title' => __( 'General', 'lsx-health-plan' ),
226
+                    'desc'  => __( 'Control the sitewide settings for the LSX HP site.', 'lsx-health-plan' ),
227
+               ),
228
+          );
229 229
 
230
-		foreach ( $this->post_types as $post_type ) {
231
-			switch ( $post_type ) {
232
-				case 'my-plans':
233
-					$page_url    = get_post_type_archive_link( 'plan' );
234
-					$description = sprintf(
235
-						/* translators: %s: The subscription info */
236
-						__( 'Control the settings for your <a target="_blank" href="%1$s">%2$s</a> pages.', 'lsx-search' ),
237
-						$page_url,
238
-						__( 'plan', 'lsx-health-plan' )
239
-					);
240
-					$tabs[ $post_type ] = array(
241
-						'title' => __( 'My Plans', 'lsx-health-plan' ),
242
-						'desc'  => $description,
243
-					);
244
-					break;
245
-				default:
246
-					//if ( ! in_array( $post_type, \lsx\search\includes\get_restricted_post_types() ) ) {
247
-						$temp_post_type = get_post_type_object( $post_type );
248
-						if ( ! is_wp_error( $temp_post_type ) ) {
249
-							$page_url    = get_post_type_archive_link( $temp_post_type->name );
250
-							$description = sprintf(
251
-								/* translators: %s: The subscription info */
252
-								__( 'Control the settings for your <a target="_blank" href="%1$s">%2$s</a> archive.', 'lsx-search' ),
253
-								$page_url,
254
-								$temp_post_type->label
255
-							);
230
+          foreach ( $this->post_types as $post_type ) {
231
+               switch ( $post_type ) {
232
+                    case 'my-plans':
233
+                         $page_url    = get_post_type_archive_link( 'plan' );
234
+                         $description = sprintf(
235
+                              /* translators: %s: The subscription info */
236
+                              __( 'Control the settings for your <a target="_blank" href="%1$s">%2$s</a> pages.', 'lsx-search' ),
237
+                              $page_url,
238
+                              __( 'plan', 'lsx-health-plan' )
239
+                         );
240
+                         $tabs[ $post_type ] = array(
241
+                              'title' => __( 'My Plans', 'lsx-health-plan' ),
242
+                              'desc'  => $description,
243
+                         );
244
+                         break;
245
+                    default:
246
+                         //if ( ! in_array( $post_type, \lsx\search\includes\get_restricted_post_types() ) ) {
247
+                              $temp_post_type = get_post_type_object( $post_type );
248
+                              if ( ! is_wp_error( $temp_post_type ) ) {
249
+                                   $page_url    = get_post_type_archive_link( $temp_post_type->name );
250
+                                   $description = sprintf(
251
+                                        /* translators: %s: The subscription info */
252
+                                        __( 'Control the settings for your <a target="_blank" href="%1$s">%2$s</a> archive.', 'lsx-search' ),
253
+                                        $page_url,
254
+                                        $temp_post_type->label
255
+                                   );
256 256
 
257
-							$tabs[ $post_type ] = array(
258
-								'title' => $temp_post_type->label,
259
-								'desc'  => $description,
260
-							);
261
-						}
262
-					//}
263
-					break;
264
-			}
265
-		}
266
-		return $tabs;
267
-	}
257
+                                   $tabs[ $post_type ] = array(
258
+                                        'title' => $temp_post_type->label,
259
+                                        'desc'  => $description,
260
+                                   );
261
+                              }
262
+                         //}
263
+                         break;
264
+               }
265
+          }
266
+          return $tabs;
267
+     }
268 268
 }
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
 	 */
55 55
 	public function __construct() {
56 56
 		$this->load_classes();
57
-		add_action( 'cmb2_admin_init', array( $this, 'register_settings_page' ) );
58
-		add_action( 'lsx_hp_settings_page', array( $this, 'generate_tabs' ), 1, 1 );
57
+		add_action('cmb2_admin_init', array($this, 'register_settings_page'));
58
+		add_action('lsx_hp_settings_page', array($this, 'generate_tabs'), 1, 1);
59 59
 
60
-		add_action( 'lsx_hp_settings_page_general_top', array( $this, 'general_settings' ), 1, 1 );
60
+		add_action('lsx_hp_settings_page_general_top', array($this, 'general_settings'), 1, 1);
61 61
 	}
62 62
 
63 63
 	/**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 */
70 70
 	public static function get_instance() {
71 71
 		// If the single instance hasn't been set, set it now.
72
-		if ( null === self::$instance ) {
72
+		if (null === self::$instance) {
73 73
 			self::$instance = new self();
74 74
 		}
75 75
 		return self::$instance;
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 			'recipe',
91 91
 		);
92 92
 
93
-		foreach ( $this->post_types as $post_type ) {
93
+		foreach ($this->post_types as $post_type) {
94 94
 			$this->$post_type = require_once LSX_HEALTH_PLAN_PATH . 'classes/admin/settings/class-' . $post_type . '.php';
95 95
 		}
96 96
 
@@ -103,14 +103,14 @@  discard block
 block discarded – undo
103 103
 		$cmb = new_cmb2_box(
104 104
 			array(
105 105
 				'id'           => $this->screen_id,
106
-				'title'        => esc_html__( 'Settings', 'lsx-health-plan' ),
107
-				'object_types' => array( 'options-page' ),
106
+				'title'        => esc_html__('Settings', 'lsx-health-plan'),
107
+				'object_types' => array('options-page'),
108 108
 				'option_key'   => 'lsx_health_plan_options', // The option key and admin menu page slug.
109 109
 				'parent_slug'  => 'edit.php?post_type=plan', // Make options page a submenu item of the themes menu.
110 110
 				'capability'   => 'manage_options', // Cap required to view options-page.
111 111
 			)
112 112
 		);
113
-		do_action( 'lsx_hp_settings_page', $cmb );
113
+		do_action('lsx_hp_settings_page', $cmb);
114 114
 	}
115 115
 
116 116
 	/**
@@ -119,60 +119,60 @@  discard block
 block discarded – undo
119 119
 	 * @param object $cmb new_cmb2_box().
120 120
 	 * @return void
121 121
 	 */
122
-	public function general_settings( $cmb ) {
122
+	public function general_settings($cmb) {
123 123
 		$cmb->add_field(
124 124
 			array(
125
-				'name'        => __( 'Exercises', 'lsx-health-plan' ),
125
+				'name'        => __('Exercises', 'lsx-health-plan'),
126 126
 				'id'          => 'exercise_enabled',
127 127
 				'type'        => 'checkbox',
128 128
 				'value'       => 1,
129 129
 				'default'     => 0,
130
-				'description' => __( 'Enabling the exercise post type will automatically replace the Video post type.', 'lsx-health-plan' ),
130
+				'description' => __('Enabling the exercise post type will automatically replace the Video post type.', 'lsx-health-plan'),
131 131
 			)
132 132
 		);
133 133
 
134 134
 		$cmb->add_field(
135 135
 			array(
136
-				'name'        => __( 'Disable Workouts', 'lsx-health-plan' ),
136
+				'name'        => __('Disable Workouts', 'lsx-health-plan'),
137 137
 				'id'          => 'workout_disabled',
138 138
 				'type'        => 'checkbox',
139 139
 				'value'       => 1,
140 140
 				'default'     => 0,
141
-				'description' => __( 'Disable workout post type if you are wanting a minimal site.', 'lsx-health-plan' ),
141
+				'description' => __('Disable workout post type if you are wanting a minimal site.', 'lsx-health-plan'),
142 142
 			)
143 143
 		);
144 144
 
145 145
 		$cmb->add_field(
146 146
 			array(
147
-				'name'        => __( 'Disable Recipes', 'lsx-health-plan' ),
147
+				'name'        => __('Disable Recipes', 'lsx-health-plan'),
148 148
 				'id'          => 'recipe_disabled',
149 149
 				'type'        => 'checkbox',
150 150
 				'value'       => 1,
151 151
 				'default'     => 0,
152
-				'description' => __( 'Disable recipe post type if you are wanting a minimal site.', 'lsx-health-plan' ),
152
+				'description' => __('Disable recipe post type if you are wanting a minimal site.', 'lsx-health-plan'),
153 153
 			)
154 154
 		);
155 155
 
156 156
 		$cmb->add_field(
157 157
 			array(
158
-				'name'        => __( 'Disable Meals', 'lsx-health-plan' ),
158
+				'name'        => __('Disable Meals', 'lsx-health-plan'),
159 159
 				'id'          => 'meal_disabled',
160 160
 				'type'        => 'checkbox',
161 161
 				'value'       => 1,
162 162
 				'default'     => 0,
163
-				'description' => __( 'Disable meal post type if you are wanting a minimal site.', 'lsx-health-plan' ),
163
+				'description' => __('Disable meal post type if you are wanting a minimal site.', 'lsx-health-plan'),
164 164
 			)
165 165
 		);
166 166
 		
167 167
 
168 168
 		$cmb->add_field(
169 169
 			array(
170
-				'name'      =>  __( 'Login Slug', 'lsx-health-plan' ),
170
+				'name'      =>  __('Login Slug', 'lsx-health-plan'),
171 171
 				'id'        => 'login_slug',
172 172
 				'type'      => 'input',
173 173
 				'value'     => '',
174 174
 				'default'   => 'login',
175
-				'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' ),
175
+				'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'),
176 176
 			)
177 177
 		);
178 178
 
@@ -185,10 +185,10 @@  discard block
 block discarded – undo
185 185
 	 * @param string $section either engine,archive or single.
186 186
 	 * @return void
187 187
 	 */
188
-	public function generate_tabs( $cmb ) {
188
+	public function generate_tabs($cmb) {
189 189
 		$tabs = $this->get_settings_tabs();
190 190
 
191
-		foreach ( $tabs as $tab_key => $tab ) {
191
+		foreach ($tabs as $tab_key => $tab) {
192 192
 			$cmb->add_field(
193 193
 				array(
194 194
 					'id'          => 'settings_' . $tab_key . '_title',
@@ -198,11 +198,11 @@  discard block
 block discarded – undo
198 198
 					'description' => $tab['desc'],
199 199
 				)
200 200
 			);
201
-			do_action( 'lsx_hp_settings_page_' . $tab_key . '_top', $cmb );
201
+			do_action('lsx_hp_settings_page_' . $tab_key . '_top', $cmb);
202 202
 
203
-			do_action( 'lsx_hp_settings_page_' . $tab_key . '_middle', $cmb );
203
+			do_action('lsx_hp_settings_page_' . $tab_key . '_middle', $cmb);
204 204
 
205
-			do_action( 'lsx_hp_settings_page_' . $tab_key . '_bottom', $cmb );
205
+			do_action('lsx_hp_settings_page_' . $tab_key . '_bottom', $cmb);
206 206
 
207 207
 			$cmb->add_field(
208 208
 				array(
@@ -222,39 +222,39 @@  discard block
 block discarded – undo
222 222
 	public function get_settings_tabs() {
223 223
 		$tabs = array(
224 224
 			'general' => array(
225
-				'title' => __( 'General', 'lsx-health-plan' ),
226
-				'desc'  => __( 'Control the sitewide settings for the LSX HP site.', 'lsx-health-plan' ),
225
+				'title' => __('General', 'lsx-health-plan'),
226
+				'desc'  => __('Control the sitewide settings for the LSX HP site.', 'lsx-health-plan'),
227 227
 			),
228 228
 		);
229 229
 
230
-		foreach ( $this->post_types as $post_type ) {
231
-			switch ( $post_type ) {
230
+		foreach ($this->post_types as $post_type) {
231
+			switch ($post_type) {
232 232
 				case 'my-plans':
233
-					$page_url    = get_post_type_archive_link( 'plan' );
233
+					$page_url    = get_post_type_archive_link('plan');
234 234
 					$description = sprintf(
235 235
 						/* translators: %s: The subscription info */
236
-						__( 'Control the settings for your <a target="_blank" href="%1$s">%2$s</a> pages.', 'lsx-search' ),
236
+						__('Control the settings for your <a target="_blank" href="%1$s">%2$s</a> pages.', 'lsx-search'),
237 237
 						$page_url,
238
-						__( 'plan', 'lsx-health-plan' )
238
+						__('plan', 'lsx-health-plan')
239 239
 					);
240
-					$tabs[ $post_type ] = array(
241
-						'title' => __( 'My Plans', 'lsx-health-plan' ),
240
+					$tabs[$post_type] = array(
241
+						'title' => __('My Plans', 'lsx-health-plan'),
242 242
 						'desc'  => $description,
243 243
 					);
244 244
 					break;
245 245
 				default:
246 246
 					//if ( ! in_array( $post_type, \lsx\search\includes\get_restricted_post_types() ) ) {
247
-						$temp_post_type = get_post_type_object( $post_type );
248
-						if ( ! is_wp_error( $temp_post_type ) ) {
249
-							$page_url    = get_post_type_archive_link( $temp_post_type->name );
247
+						$temp_post_type = get_post_type_object($post_type);
248
+						if ( ! is_wp_error($temp_post_type)) {
249
+							$page_url    = get_post_type_archive_link($temp_post_type->name);
250 250
 							$description = sprintf(
251 251
 								/* translators: %s: The subscription info */
252
-								__( 'Control the settings for your <a target="_blank" href="%1$s">%2$s</a> archive.', 'lsx-search' ),
252
+								__('Control the settings for your <a target="_blank" href="%1$s">%2$s</a> archive.', 'lsx-search'),
253 253
 								$page_url,
254 254
 								$temp_post_type->label
255 255
 							);
256 256
 
257
-							$tabs[ $post_type ] = array(
257
+							$tabs[$post_type] = array(
258 258
 								'title' => $temp_post_type->label,
259 259
 								'desc'  => $description,
260 260
 							);
Please login to merge, or discard this patch.
classes/admin/settings/class-my-plans.php 2 patches
Indentation   +154 added lines, -154 removed lines patch added patch discarded remove patch
@@ -12,167 +12,167 @@
 block discarded – undo
12 12
  */
13 13
 class Plan {
14 14
 
15
-	/**
16
-	 * Holds class instance
17
-	 *
18
-	 * @since 1.0.0
19
-	 *
20
-	 * @var      object \lsx_health_plan\classes\admin\My_Plans()
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\My_Plans()
21
+      */
22
+     protected static $instance = null;
23 23
 
24
-	/**
25
-	 * Constructor
26
-	 */
27
-	public function __construct() {
28
-		add_action( 'lsx_hp_settings_page_my-plans_top', array( $this, 'settings' ), 1, 1 );
29
-	}
24
+     /**
25
+      * Constructor
26
+      */
27
+     public function __construct() {
28
+          add_action( 'lsx_hp_settings_page_my-plans_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\My_Plans()    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\My_Plans()    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'        => __( 'Plan Filters', 'lsx-health-plan' ),
56
-				'id'          => 'plan_filters_disabled',
57
-				'type'        => 'checkbox',
58
-				'value'       => 1,
59
-				'default'     => 0,
60
-				'description' => __( 'Toggle the display of the tab filters on the post type archive.', 'lsx-health-plan' ),
61
-			)
62
-		);
46
+     /**
47
+      * Registers the general settings.
48
+      *
49
+      * @param object $cmb new_cmb2_box().
50
+      * @return void
51
+      */
52
+     public function settings( $cmb ) {
53
+          $cmb->add_field(
54
+               array(
55
+                    'name'        => __( 'Plan Filters', 'lsx-health-plan' ),
56
+                    'id'          => 'plan_filters_disabled',
57
+                    'type'        => 'checkbox',
58
+                    'value'       => 1,
59
+                    'default'     => 0,
60
+                    'description' => __( 'Toggle the display of the tab filters on the post type archive.', 'lsx-health-plan' ),
61
+               )
62
+          );
63 63
 
64
-		$cmb->add_field(
65
-			array(
66
-				'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>',
67
-				'name'        =>  __( 'My Plan Slug', 'lsx-health-plan' ),
68
-				'description' => __( 'This will be the slug url for redirecting users after login, use the login page slug.', 'lsx-health-plan' ),
69
-				'id'          => 'my_plan_slug',
70
-				'type'        => 'select',
71
-				'default'     => 'my-plan',
72
-				'options'     => $this->get_page_options(),
73
-			)
74
-		);
64
+          $cmb->add_field(
65
+               array(
66
+                    '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>',
67
+                    'name'        =>  __( 'My Plan Slug', 'lsx-health-plan' ),
68
+                    'description' => __( 'This will be the slug url for redirecting users after login, use the login page slug.', 'lsx-health-plan' ),
69
+                    'id'          => 'my_plan_slug',
70
+                    'type'        => 'select',
71
+                    'default'     => 'my-plan',
72
+                    'options'     => $this->get_page_options(),
73
+               )
74
+          );
75 75
 
76
-		$cmb->add_field(
77
-			array(
78
-				'before_row'  => '<h4><b><u>Default Options</u></b></h4>',
79
-				'name'        => __( 'Recipe', 'lsx-health-plan' ),
80
-				'description' => __( 'Set a default recipe.', 'lsx-health-plan' ),
81
-				'limit'       => 1,
82
-				'id'          => 'connected_recipes',
83
-				'type'        => 'post_search_ajax',
84
-			)
85
-		);
76
+          $cmb->add_field(
77
+               array(
78
+                    'before_row'  => '<h4><b><u>Default Options</u></b></h4>',
79
+                    'name'        => __( 'Recipe', 'lsx-health-plan' ),
80
+                    'description' => __( 'Set a default recipe.', 'lsx-health-plan' ),
81
+                    'limit'       => 1,
82
+                    'id'          => 'connected_recipes',
83
+                    'type'        => 'post_search_ajax',
84
+               )
85
+          );
86 86
 
87
-		$cmb->add_field(
88
-			array(
89
-				'name'    =>  __( 'Single Plan Slug', 'lsx-health-plan' ),
90
-				'id'      => 'plan_single_slug',
91
-				'type'    => 'input',
92
-				'value'   => '',
93
-				'default' => 'plan',
94
-			)
95
-		);
96
-		$cmb->add_field(
97
-			array(
98
-				'name'    =>  __( 'Plans Archive Slug', 'lsx-health-plan' ),
99
-				'id'      => 'endpoint_plan_archive',
100
-				'type'    => 'input',
101
-				'value'   => '',
102
-				'default' => 'plans',
103
-			)
104
-		);
87
+          $cmb->add_field(
88
+               array(
89
+                    'name'    =>  __( 'Single Plan Slug', 'lsx-health-plan' ),
90
+                    'id'      => 'plan_single_slug',
91
+                    'type'    => 'input',
92
+                    'value'   => '',
93
+                    'default' => 'plan',
94
+               )
95
+          );
96
+          $cmb->add_field(
97
+               array(
98
+                    'name'    =>  __( 'Plans Archive Slug', 'lsx-health-plan' ),
99
+                    'id'      => 'endpoint_plan_archive',
100
+                    'type'    => 'input',
101
+                    'value'   => '',
102
+                    'default' => 'plans',
103
+               )
104
+          );
105 105
 
106
-		$cmb->add_field(
107
-			array(
108
-				'before_row' => '<h4><b><u>My Stats Options</u></b></h4>',
109
-				'name'       => __( 'Disable All Stats', 'lsx-health-plan' ),
110
-				'desc'       => 'Disable All Stats',
111
-				'id'         => 'disable_all_stats',
112
-				'type'       => 'checkbox',
113
-				'value'      => 1,
114
-				'default'    => 0,
115
-			)
116
-		);
117
-		$cmb->add_field(
118
-			array(
119
-				'name'    => __( 'Disable Weight', 'lsx-health-plan' ),
120
-				'id'      => 'disable_weight_checkbox',
121
-				'type'    => 'checkbox',
122
-				'value'   => 1,
123
-				'default' => 0,
124
-			)
125
-		);
126
-		$cmb->add_field(
127
-			array(
128
-				'name'    => __( 'Disable Height', 'lsx-health-plan' ),
129
-				'id'      => 'disable_height_checkbox',
130
-				'type'    => 'checkbox',
131
-				'value'   => 1,
132
-				'default' => 0,
133
-			)
134
-		);
135
-		$cmb->add_field(
136
-			array(
137
-				'name'    => __( 'Disable Waist', 'lsx-health-plan' ),
138
-				'id'      => 'disable_waist_checkbox',
139
-				'type'    => 'checkbox',
140
-				'value'   => 1,
141
-				'default' => 0,
142
-			)
143
-		);
144
-		$cmb->add_field(
145
-			array(
146
-				'name'      => __( 'Disable BMI', 'lsx-health-plan' ),
147
-				'id'        => 'disable_bmi_checkbox',
148
-				'type'      => 'checkbox',
149
-				'value'     => 1,
150
-				'default'   => 0,
151
-				'after_row' => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ),
152
-			)
153
-		);
154
-	}
106
+          $cmb->add_field(
107
+               array(
108
+                    'before_row' => '<h4><b><u>My Stats Options</u></b></h4>',
109
+                    'name'       => __( 'Disable All Stats', 'lsx-health-plan' ),
110
+                    'desc'       => 'Disable All Stats',
111
+                    'id'         => 'disable_all_stats',
112
+                    'type'       => 'checkbox',
113
+                    'value'      => 1,
114
+                    'default'    => 0,
115
+               )
116
+          );
117
+          $cmb->add_field(
118
+               array(
119
+                    'name'    => __( 'Disable Weight', 'lsx-health-plan' ),
120
+                    'id'      => 'disable_weight_checkbox',
121
+                    'type'    => 'checkbox',
122
+                    'value'   => 1,
123
+                    'default' => 0,
124
+               )
125
+          );
126
+          $cmb->add_field(
127
+               array(
128
+                    'name'    => __( 'Disable Height', 'lsx-health-plan' ),
129
+                    'id'      => 'disable_height_checkbox',
130
+                    'type'    => 'checkbox',
131
+                    'value'   => 1,
132
+                    'default' => 0,
133
+               )
134
+          );
135
+          $cmb->add_field(
136
+               array(
137
+                    'name'    => __( 'Disable Waist', 'lsx-health-plan' ),
138
+                    'id'      => 'disable_waist_checkbox',
139
+                    'type'    => 'checkbox',
140
+                    'value'   => 1,
141
+                    'default' => 0,
142
+               )
143
+          );
144
+          $cmb->add_field(
145
+               array(
146
+                    'name'      => __( 'Disable BMI', 'lsx-health-plan' ),
147
+                    'id'        => 'disable_bmi_checkbox',
148
+                    'type'      => 'checkbox',
149
+                    'value'     => 1,
150
+                    'default'   => 0,
151
+                    'after_row' => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ),
152
+               )
153
+          );
154
+     }
155 155
 
156
-	public function get_page_options() {
157
-		$query_args = array(
158
-			'post_type'      => 'page',
159
-			'post_status'    => array( 'publish' ),
160
-			'posts_per_page' => -1,
161
-			'orderby'        => 'title',
162
-			'fields'         => array( 'ids' ),
163
-		);
164
-		$options = array(
165
-			'' => __( 'Select a page', 'lsx-health-plan' ),
166
-		);
167
-		$page_query = new \WP_Query( $query_args );
168
-		if ( $page_query->have_posts() ) {
169
-			foreach ( $page_query->posts as $pid ) {
170
-				$title       = get_the_title( $pid );
171
-				$key         = sanitize_title( $title );
172
-				$options[ $key ] = $title;
173
-			}
174
-		}
175
-		return $options;
176
-	}
156
+     public function get_page_options() {
157
+          $query_args = array(
158
+               'post_type'      => 'page',
159
+               'post_status'    => array( 'publish' ),
160
+               'posts_per_page' => -1,
161
+               'orderby'        => 'title',
162
+               'fields'         => array( 'ids' ),
163
+          );
164
+          $options = array(
165
+               '' => __( 'Select a page', 'lsx-health-plan' ),
166
+          );
167
+          $page_query = new \WP_Query( $query_args );
168
+          if ( $page_query->have_posts() ) {
169
+               foreach ( $page_query->posts as $pid ) {
170
+                    $title       = get_the_title( $pid );
171
+                    $key         = sanitize_title( $title );
172
+                    $options[ $key ] = $title;
173
+               }
174
+          }
175
+          return $options;
176
+     }
177 177
 }
178 178
 Plan::get_instance();
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 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_my-plans_top', array( $this, 'settings' ), 1, 1 );
28
+		add_action('lsx_hp_settings_page_my-plans_top', array($this, 'settings'), 1, 1);
29 29
 	}
30 30
 
31 31
 	/**
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 */
38 38
 	public static function get_instance() {
39 39
 		// If the single instance hasn't been set, set it now.
40
-		if ( null === self::$instance ) {
40
+		if (null === self::$instance) {
41 41
 			self::$instance = new self();
42 42
 		}
43 43
 		return self::$instance;
@@ -49,23 +49,23 @@  discard block
 block discarded – undo
49 49
 	 * @param object $cmb new_cmb2_box().
50 50
 	 * @return void
51 51
 	 */
52
-	public function settings( $cmb ) {
52
+	public function settings($cmb) {
53 53
 		$cmb->add_field(
54 54
 			array(
55
-				'name'        => __( 'Plan Filters', 'lsx-health-plan' ),
55
+				'name'        => __('Plan Filters', 'lsx-health-plan'),
56 56
 				'id'          => 'plan_filters_disabled',
57 57
 				'type'        => 'checkbox',
58 58
 				'value'       => 1,
59 59
 				'default'     => 0,
60
-				'description' => __( 'Toggle the display of the tab filters on the post type archive.', 'lsx-health-plan' ),
60
+				'description' => __('Toggle the display of the tab filters on the post type archive.', 'lsx-health-plan'),
61 61
 			)
62 62
 		);
63 63
 
64 64
 		$cmb->add_field(
65 65
 			array(
66 66
 				'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>',
67
-				'name'        =>  __( 'My Plan Slug', 'lsx-health-plan' ),
68
-				'description' => __( 'This will be the slug url for redirecting users after login, use the login page slug.', 'lsx-health-plan' ),
67
+				'name'        =>  __('My Plan Slug', 'lsx-health-plan'),
68
+				'description' => __('This will be the slug url for redirecting users after login, use the login page slug.', 'lsx-health-plan'),
69 69
 				'id'          => 'my_plan_slug',
70 70
 				'type'        => 'select',
71 71
 				'default'     => 'my-plan',
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
 		$cmb->add_field(
77 77
 			array(
78 78
 				'before_row'  => '<h4><b><u>Default Options</u></b></h4>',
79
-				'name'        => __( 'Recipe', 'lsx-health-plan' ),
80
-				'description' => __( 'Set a default recipe.', 'lsx-health-plan' ),
79
+				'name'        => __('Recipe', 'lsx-health-plan'),
80
+				'description' => __('Set a default recipe.', 'lsx-health-plan'),
81 81
 				'limit'       => 1,
82 82
 				'id'          => 'connected_recipes',
83 83
 				'type'        => 'post_search_ajax',
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
 		$cmb->add_field(
88 88
 			array(
89
-				'name'    =>  __( 'Single Plan Slug', 'lsx-health-plan' ),
89
+				'name'    =>  __('Single Plan Slug', 'lsx-health-plan'),
90 90
 				'id'      => 'plan_single_slug',
91 91
 				'type'    => 'input',
92 92
 				'value'   => '',
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		);
96 96
 		$cmb->add_field(
97 97
 			array(
98
-				'name'    =>  __( 'Plans Archive Slug', 'lsx-health-plan' ),
98
+				'name'    =>  __('Plans Archive Slug', 'lsx-health-plan'),
99 99
 				'id'      => 'endpoint_plan_archive',
100 100
 				'type'    => 'input',
101 101
 				'value'   => '',
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 		$cmb->add_field(
107 107
 			array(
108 108
 				'before_row' => '<h4><b><u>My Stats Options</u></b></h4>',
109
-				'name'       => __( 'Disable All Stats', 'lsx-health-plan' ),
109
+				'name'       => __('Disable All Stats', 'lsx-health-plan'),
110 110
 				'desc'       => 'Disable All Stats',
111 111
 				'id'         => 'disable_all_stats',
112 112
 				'type'       => 'checkbox',
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		);
117 117
 		$cmb->add_field(
118 118
 			array(
119
-				'name'    => __( 'Disable Weight', 'lsx-health-plan' ),
119
+				'name'    => __('Disable Weight', 'lsx-health-plan'),
120 120
 				'id'      => 'disable_weight_checkbox',
121 121
 				'type'    => 'checkbox',
122 122
 				'value'   => 1,
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 		);
126 126
 		$cmb->add_field(
127 127
 			array(
128
-				'name'    => __( 'Disable Height', 'lsx-health-plan' ),
128
+				'name'    => __('Disable Height', 'lsx-health-plan'),
129 129
 				'id'      => 'disable_height_checkbox',
130 130
 				'type'    => 'checkbox',
131 131
 				'value'   => 1,
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 		);
135 135
 		$cmb->add_field(
136 136
 			array(
137
-				'name'    => __( 'Disable Waist', 'lsx-health-plan' ),
137
+				'name'    => __('Disable Waist', 'lsx-health-plan'),
138 138
 				'id'      => 'disable_waist_checkbox',
139 139
 				'type'    => 'checkbox',
140 140
 				'value'   => 1,
@@ -143,12 +143,12 @@  discard block
 block discarded – undo
143 143
 		);
144 144
 		$cmb->add_field(
145 145
 			array(
146
-				'name'      => __( 'Disable BMI', 'lsx-health-plan' ),
146
+				'name'      => __('Disable BMI', 'lsx-health-plan'),
147 147
 				'id'        => 'disable_bmi_checkbox',
148 148
 				'type'      => 'checkbox',
149 149
 				'value'     => 1,
150 150
 				'default'   => 0,
151
-				'after_row' => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ),
151
+				'after_row' => __('<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan'),
152 152
 			)
153 153
 		);
154 154
 	}
@@ -156,20 +156,20 @@  discard block
 block discarded – undo
156 156
 	public function get_page_options() {
157 157
 		$query_args = array(
158 158
 			'post_type'      => 'page',
159
-			'post_status'    => array( 'publish' ),
159
+			'post_status'    => array('publish'),
160 160
 			'posts_per_page' => -1,
161 161
 			'orderby'        => 'title',
162
-			'fields'         => array( 'ids' ),
162
+			'fields'         => array('ids'),
163 163
 		);
164 164
 		$options = array(
165
-			'' => __( 'Select a page', 'lsx-health-plan' ),
165
+			'' => __('Select a page', 'lsx-health-plan'),
166 166
 		);
167
-		$page_query = new \WP_Query( $query_args );
168
-		if ( $page_query->have_posts() ) {
169
-			foreach ( $page_query->posts as $pid ) {
170
-				$title       = get_the_title( $pid );
171
-				$key         = sanitize_title( $title );
172
-				$options[ $key ] = $title;
167
+		$page_query = new \WP_Query($query_args);
168
+		if ($page_query->have_posts()) {
169
+			foreach ($page_query->posts as $pid) {
170
+				$title       = get_the_title($pid);
171
+				$key         = sanitize_title($title);
172
+				$options[$key] = $title;
173 173
 			}
174 174
 		}
175 175
 		return $options;
Please login to merge, or discard this patch.
includes/conditionals.php 2 patches
Indentation   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
12 12
  * @return boolean
13 13
  */
14 14
 function lsx_health_plan_has_warmup( $post_id = '' ) {
15
-	if ( '' === $post_id ) {
16
-		$post_id = get_the_ID();
17
-	}
18
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'plan_warmup' );
15
+     if ( '' === $post_id ) {
16
+          $post_id = get_the_ID();
17
+     }
18
+     return \lsx_health_plan\functions\has_attached_post( $post_id, 'plan_warmup' );
19 19
 }
20 20
 
21 21
 /**
@@ -25,25 +25,25 @@  discard block
 block discarded – undo
25 25
  * @return boolean
26 26
  */
27 27
 function lsx_health_plan_has_workout( $post_id = '' ) {
28
-	if ( ! post_type_exists( 'workout' ) ) {
29
-		return false;
30
-	}
31
-	if ( '' === $post_id ) {
32
-		$post_id = get_the_ID();
33
-	}
34
-	$has_workouts = false;
35
-
36
-	$section_key = get_query_var( 'section', false );
37
-	if ( false !== $section_key ) {
38
-		$section_info = \lsx_health_plan\functions\plan\get_section_info( $section_key );
39
-		if ( isset( $section_info['connected_workouts'] ) && ! empty( $section_info['connected_workouts'] ) ) {
40
-			$has_workouts = true;
41
-		}
42
-	} elseif ( \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_workouts' ) ) {
43
-		$has_workouts = true;
44
-	}
45
-
46
-	return $has_workouts;
28
+     if ( ! post_type_exists( 'workout' ) ) {
29
+          return false;
30
+     }
31
+     if ( '' === $post_id ) {
32
+          $post_id = get_the_ID();
33
+     }
34
+     $has_workouts = false;
35
+
36
+     $section_key = get_query_var( 'section', false );
37
+     if ( false !== $section_key ) {
38
+          $section_info = \lsx_health_plan\functions\plan\get_section_info( $section_key );
39
+          if ( isset( $section_info['connected_workouts'] ) && ! empty( $section_info['connected_workouts'] ) ) {
40
+               $has_workouts = true;
41
+          }
42
+     } elseif ( \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_workouts' ) ) {
43
+          $has_workouts = true;
44
+     }
45
+
46
+     return $has_workouts;
47 47
 }
48 48
 
49 49
 /**
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
  * @return boolean
54 54
  */
55 55
 function lsx_health_plan_has_meal( $post_id = '' ) {
56
-	if ( ! post_type_exists( 'meal' ) ) {
57
-		return false;
58
-	}
59
-	if ( '' === $post_id ) {
60
-		$post_id = get_the_ID();
61
-	}
62
-
63
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_meals' );
56
+     if ( ! post_type_exists( 'meal' ) ) {
57
+          return false;
58
+     }
59
+     if ( '' === $post_id ) {
60
+          $post_id = get_the_ID();
61
+     }
62
+
63
+     return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_meals' );
64 64
 }
65 65
 
66 66
 /**
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
  * @return boolean
71 71
  */
72 72
 function lsx_health_plan_has_recipe( $post_id = '' ) {
73
-	if ( ! post_type_exists( 'recipe' ) ) {
74
-		return false;
75
-	}
76
-	if ( '' === $post_id ) {
77
-		$post_id = get_the_ID();
78
-	}
79
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_recipes' );
73
+     if ( ! post_type_exists( 'recipe' ) ) {
74
+          return false;
75
+     }
76
+     if ( '' === $post_id ) {
77
+          $post_id = get_the_ID();
78
+     }
79
+     return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_recipes' );
80 80
 }
81 81
 
82 82
 /**
@@ -86,15 +86,15 @@  discard block
 block discarded – undo
86 86
  * @return boolean
87 87
  */
88 88
 function lsx_health_plan_has_downloads( $post_id = '' ) {
89
-	$has_downloads = false;
90
-	if ( '' === $post_id ) {
91
-		$post_id = get_the_ID();
92
-	}
93
-	$downloads = \lsx_health_plan\functions\get_downloads( 'all', $post_id );
94
-	if ( ! empty( $downloads ) ) {
95
-		$has_downloads = true;
96
-	}
97
-	return $has_downloads;
89
+     $has_downloads = false;
90
+     if ( '' === $post_id ) {
91
+          $post_id = get_the_ID();
92
+     }
93
+     $downloads = \lsx_health_plan\functions\get_downloads( 'all', $post_id );
94
+     if ( ! empty( $downloads ) ) {
95
+          $has_downloads = true;
96
+     }
97
+     return $has_downloads;
98 98
 }
99 99
 
100 100
 /**
@@ -104,13 +104,13 @@  discard block
 block discarded – undo
104 104
  * @return boolean
105 105
  */
106 106
 function lsx_health_plan_has_tip( $post_id = '' ) {
107
-	if ( ! post_type_exists( 'tip' ) ) {
108
-		return false;
109
-	}
110
-	if ( '' === $post_id ) {
111
-		$post_id = get_the_ID();
112
-	}
113
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_tips' );
107
+     if ( ! post_type_exists( 'tip' ) ) {
108
+          return false;
109
+     }
110
+     if ( '' === $post_id ) {
111
+          $post_id = get_the_ID();
112
+     }
113
+     return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_tips' );
114 114
 }
115 115
 
116 116
 /**
@@ -120,13 +120,13 @@  discard block
 block discarded – undo
120 120
  * @return boolean
121 121
  */
122 122
 function lsx_health_plan_has_video( $post_id = '' ) {
123
-	if ( ! post_type_exists( 'video' ) ) {
124
-		return false;
125
-	}
126
-	if ( '' === $post_id ) {
127
-		$post_id = get_the_ID();
128
-	}
129
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_videos' );
123
+     if ( ! post_type_exists( 'video' ) ) {
124
+          return false;
125
+     }
126
+     if ( '' === $post_id ) {
127
+          $post_id = get_the_ID();
128
+     }
129
+     return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_videos' );
130 130
 }
131 131
 
132 132
 /**
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
  * @return boolean
136 136
  */
137 137
 function lsx_health_plan_user_has_purchase() {
138
-	$valid_order = false;
139
-	return $valid_order;
138
+     $valid_order = false;
139
+     return $valid_order;
140 140
 }
141 141
 
142 142
 /**
@@ -146,18 +146,18 @@  discard block
 block discarded – undo
146 146
  * @return boolean
147 147
  */
148 148
 function lsx_health_plan_is_current_tab( $needle = '' ) {
149
-	$is_tab = false;
150
-	$plan_slug = \lsx_health_plan\functions\get_option( 'my_plan_slug', false );
151
-	if ( false === $plan_slug ) {
152
-		$plan_slug = 'my-plan';
153
-	}
154
-	if ( is_singular( 'plan' ) || is_page( $plan_slug ) ) {
155
-		$endpoint = get_query_var( 'endpoint' );
156
-		if ( false !== $endpoint && $needle === $endpoint ) {
157
-			$is_tab = true;
158
-		}
159
-	}
160
-	return $is_tab;
149
+     $is_tab = false;
150
+     $plan_slug = \lsx_health_plan\functions\get_option( 'my_plan_slug', false );
151
+     if ( false === $plan_slug ) {
152
+          $plan_slug = 'my-plan';
153
+     }
154
+     if ( is_singular( 'plan' ) || is_page( $plan_slug ) ) {
155
+          $endpoint = get_query_var( 'endpoint' );
156
+          if ( false !== $endpoint && $needle === $endpoint ) {
157
+               $is_tab = true;
158
+          }
159
+     }
160
+     return $is_tab;
161 161
 }
162 162
 
163 163
 /**
@@ -167,22 +167,22 @@  discard block
 block discarded – undo
167 167
  * @return boolean
168 168
  */
169 169
 function lsx_health_plan_is_day_complete( $post_id = '', $section_key = '' ) {
170
-	$is_complete = false;
171
-	if ( '' === $post_id ) {
172
-		$post_id = get_the_ID();
173
-	}
174
-	$key             = \lsx_health_plan\functions\plan\generate_section_id( $section_key );
175
-	$is_day_complete = get_user_meta( get_current_user_id(), 'day_' . $key . '_complete', true );
176
-	if ( false !== $is_day_complete && '' !== $is_day_complete ) {
177
-		$is_complete = true;
178
-	}
179
-
180
-	return $is_complete;
170
+     $is_complete = false;
171
+     if ( '' === $post_id ) {
172
+          $post_id = get_the_ID();
173
+     }
174
+     $key             = \lsx_health_plan\functions\plan\generate_section_id( $section_key );
175
+     $is_day_complete = get_user_meta( get_current_user_id(), 'day_' . $key . '_complete', true );
176
+     if ( false !== $is_day_complete && '' !== $is_day_complete ) {
177
+          $is_complete = true;
178
+     }
179
+
180
+     return $is_complete;
181 181
 }
182 182
 
183 183
 function lsx_health_plan_is_plan_complete() {
184
-	$complete = false;
185
-	return $complete;
184
+     $complete = false;
185
+     return $complete;
186 186
 }
187 187
 
188 188
 /**
@@ -192,14 +192,14 @@  discard block
 block discarded – undo
192 192
  * @return boolean
193 193
  */
194 194
 function lsx_health_plan_week_has_downloads( $week = '' ) {
195
-	$has_downloads = false;
196
-	if ( '' !== $week ) {
197
-		$downloads = \lsx_health_plan\functions\get_weekly_downloads( $week );
198
-		if ( ! empty( $downloads ) ) {
199
-			$has_downloads = true;
200
-		}
201
-	}
202
-	return $has_downloads;
195
+     $has_downloads = false;
196
+     if ( '' !== $week ) {
197
+          $downloads = \lsx_health_plan\functions\get_weekly_downloads( $week );
198
+          if ( ! empty( $downloads ) ) {
199
+               $has_downloads = true;
200
+          }
201
+     }
202
+     return $has_downloads;
203 203
 }
204 204
 
205 205
 /**
@@ -209,15 +209,15 @@  discard block
 block discarded – undo
209 209
  * @return boolean
210 210
  */
211 211
 function lsx_health_plan_has_tips( $post_id = '' ) {
212
-	$has_tips = false;
213
-	if ( '' === $post_id ) {
214
-		$post_id = get_the_ID();
215
-	}
216
-	$post_type      = get_post_type( $post_id );
217
-	$connected_tips = get_post_meta( get_the_ID(), $post_type . '_connected_tips', true );
218
-	$connected_tips = \lsx_health_plan\functions\check_posts_exist( $connected_tips );
219
-	if ( ! empty( $connected_tips ) ) {
220
-		$has_tips = true;
221
-	}
222
-	return $has_tips;
212
+     $has_tips = false;
213
+     if ( '' === $post_id ) {
214
+          $post_id = get_the_ID();
215
+     }
216
+     $post_type      = get_post_type( $post_id );
217
+     $connected_tips = get_post_meta( get_the_ID(), $post_type . '_connected_tips', true );
218
+     $connected_tips = \lsx_health_plan\functions\check_posts_exist( $connected_tips );
219
+     if ( ! empty( $connected_tips ) ) {
220
+          $has_tips = true;
221
+     }
222
+     return $has_tips;
223 223
 }
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
  * @param string $post_id
12 12
  * @return boolean
13 13
  */
14
-function lsx_health_plan_has_warmup( $post_id = '' ) {
15
-	if ( '' === $post_id ) {
14
+function lsx_health_plan_has_warmup($post_id = '') {
15
+	if ('' === $post_id) {
16 16
 		$post_id = get_the_ID();
17 17
 	}
18
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'plan_warmup' );
18
+	return \lsx_health_plan\functions\has_attached_post($post_id, 'plan_warmup');
19 19
 }
20 20
 
21 21
 /**
@@ -24,22 +24,22 @@  discard block
 block discarded – undo
24 24
  * @param string $post_id
25 25
  * @return boolean
26 26
  */
27
-function lsx_health_plan_has_workout( $post_id = '' ) {
28
-	if ( ! post_type_exists( 'workout' ) ) {
27
+function lsx_health_plan_has_workout($post_id = '') {
28
+	if ( ! post_type_exists('workout')) {
29 29
 		return false;
30 30
 	}
31
-	if ( '' === $post_id ) {
31
+	if ('' === $post_id) {
32 32
 		$post_id = get_the_ID();
33 33
 	}
34 34
 	$has_workouts = false;
35 35
 
36
-	$section_key = get_query_var( 'section', false );
37
-	if ( false !== $section_key ) {
38
-		$section_info = \lsx_health_plan\functions\plan\get_section_info( $section_key );
39
-		if ( isset( $section_info['connected_workouts'] ) && ! empty( $section_info['connected_workouts'] ) ) {
36
+	$section_key = get_query_var('section', false);
37
+	if (false !== $section_key) {
38
+		$section_info = \lsx_health_plan\functions\plan\get_section_info($section_key);
39
+		if (isset($section_info['connected_workouts']) && ! empty($section_info['connected_workouts'])) {
40 40
 			$has_workouts = true;
41 41
 		}
42
-	} elseif ( \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_workouts' ) ) {
42
+	} elseif (\lsx_health_plan\functions\has_attached_post($post_id, 'connected_workouts')) {
43 43
 		$has_workouts = true;
44 44
 	}
45 45
 
@@ -52,15 +52,15 @@  discard block
 block discarded – undo
52 52
  * @param string $post_id
53 53
  * @return boolean
54 54
  */
55
-function lsx_health_plan_has_meal( $post_id = '' ) {
56
-	if ( ! post_type_exists( 'meal' ) ) {
55
+function lsx_health_plan_has_meal($post_id = '') {
56
+	if ( ! post_type_exists('meal')) {
57 57
 		return false;
58 58
 	}
59
-	if ( '' === $post_id ) {
59
+	if ('' === $post_id) {
60 60
 		$post_id = get_the_ID();
61 61
 	}
62 62
 
63
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_meals' );
63
+	return \lsx_health_plan\functions\has_attached_post($post_id, 'connected_meals');
64 64
 }
65 65
 
66 66
 /**
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
  * @param string $post_id
70 70
  * @return boolean
71 71
  */
72
-function lsx_health_plan_has_recipe( $post_id = '' ) {
73
-	if ( ! post_type_exists( 'recipe' ) ) {
72
+function lsx_health_plan_has_recipe($post_id = '') {
73
+	if ( ! post_type_exists('recipe')) {
74 74
 		return false;
75 75
 	}
76
-	if ( '' === $post_id ) {
76
+	if ('' === $post_id) {
77 77
 		$post_id = get_the_ID();
78 78
 	}
79
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_recipes' );
79
+	return \lsx_health_plan\functions\has_attached_post($post_id, 'connected_recipes');
80 80
 }
81 81
 
82 82
 /**
@@ -85,13 +85,13 @@  discard block
 block discarded – undo
85 85
  * @param string $post_id
86 86
  * @return boolean
87 87
  */
88
-function lsx_health_plan_has_downloads( $post_id = '' ) {
88
+function lsx_health_plan_has_downloads($post_id = '') {
89 89
 	$has_downloads = false;
90
-	if ( '' === $post_id ) {
90
+	if ('' === $post_id) {
91 91
 		$post_id = get_the_ID();
92 92
 	}
93
-	$downloads = \lsx_health_plan\functions\get_downloads( 'all', $post_id );
94
-	if ( ! empty( $downloads ) ) {
93
+	$downloads = \lsx_health_plan\functions\get_downloads('all', $post_id);
94
+	if ( ! empty($downloads)) {
95 95
 		$has_downloads = true;
96 96
 	}
97 97
 	return $has_downloads;
@@ -103,14 +103,14 @@  discard block
 block discarded – undo
103 103
  * @param string $post_id
104 104
  * @return boolean
105 105
  */
106
-function lsx_health_plan_has_tip( $post_id = '' ) {
107
-	if ( ! post_type_exists( 'tip' ) ) {
106
+function lsx_health_plan_has_tip($post_id = '') {
107
+	if ( ! post_type_exists('tip')) {
108 108
 		return false;
109 109
 	}
110
-	if ( '' === $post_id ) {
110
+	if ('' === $post_id) {
111 111
 		$post_id = get_the_ID();
112 112
 	}
113
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_tips' );
113
+	return \lsx_health_plan\functions\has_attached_post($post_id, 'connected_tips');
114 114
 }
115 115
 
116 116
 /**
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
  * @param string $post_id
120 120
  * @return boolean
121 121
  */
122
-function lsx_health_plan_has_video( $post_id = '' ) {
123
-	if ( ! post_type_exists( 'video' ) ) {
122
+function lsx_health_plan_has_video($post_id = '') {
123
+	if ( ! post_type_exists('video')) {
124 124
 		return false;
125 125
 	}
126
-	if ( '' === $post_id ) {
126
+	if ('' === $post_id) {
127 127
 		$post_id = get_the_ID();
128 128
 	}
129
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_videos' );
129
+	return \lsx_health_plan\functions\has_attached_post($post_id, 'connected_videos');
130 130
 }
131 131
 
132 132
 /**
@@ -145,15 +145,15 @@  discard block
 block discarded – undo
145 145
  * @param string $post_id
146 146
  * @return boolean
147 147
  */
148
-function lsx_health_plan_is_current_tab( $needle = '' ) {
148
+function lsx_health_plan_is_current_tab($needle = '') {
149 149
 	$is_tab = false;
150
-	$plan_slug = \lsx_health_plan\functions\get_option( 'my_plan_slug', false );
151
-	if ( false === $plan_slug ) {
150
+	$plan_slug = \lsx_health_plan\functions\get_option('my_plan_slug', false);
151
+	if (false === $plan_slug) {
152 152
 		$plan_slug = 'my-plan';
153 153
 	}
154
-	if ( is_singular( 'plan' ) || is_page( $plan_slug ) ) {
155
-		$endpoint = get_query_var( 'endpoint' );
156
-		if ( false !== $endpoint && $needle === $endpoint ) {
154
+	if (is_singular('plan') || is_page($plan_slug)) {
155
+		$endpoint = get_query_var('endpoint');
156
+		if (false !== $endpoint && $needle === $endpoint) {
157 157
 			$is_tab = true;
158 158
 		}
159 159
 	}
@@ -166,14 +166,14 @@  discard block
 block discarded – undo
166 166
  * @param string $post_id
167 167
  * @return boolean
168 168
  */
169
-function lsx_health_plan_is_day_complete( $post_id = '', $section_key = '' ) {
169
+function lsx_health_plan_is_day_complete($post_id = '', $section_key = '') {
170 170
 	$is_complete = false;
171
-	if ( '' === $post_id ) {
171
+	if ('' === $post_id) {
172 172
 		$post_id = get_the_ID();
173 173
 	}
174
-	$key             = \lsx_health_plan\functions\plan\generate_section_id( $section_key );
175
-	$is_day_complete = get_user_meta( get_current_user_id(), 'day_' . $key . '_complete', true );
176
-	if ( false !== $is_day_complete && '' !== $is_day_complete ) {
174
+	$key             = \lsx_health_plan\functions\plan\generate_section_id($section_key);
175
+	$is_day_complete = get_user_meta(get_current_user_id(), 'day_' . $key . '_complete', true);
176
+	if (false !== $is_day_complete && '' !== $is_day_complete) {
177 177
 		$is_complete = true;
178 178
 	}
179 179
 
@@ -191,11 +191,11 @@  discard block
 block discarded – undo
191 191
  * @param string $week The week name 'week-1'.
192 192
  * @return boolean
193 193
  */
194
-function lsx_health_plan_week_has_downloads( $week = '' ) {
194
+function lsx_health_plan_week_has_downloads($week = '') {
195 195
 	$has_downloads = false;
196
-	if ( '' !== $week ) {
197
-		$downloads = \lsx_health_plan\functions\get_weekly_downloads( $week );
198
-		if ( ! empty( $downloads ) ) {
196
+	if ('' !== $week) {
197
+		$downloads = \lsx_health_plan\functions\get_weekly_downloads($week);
198
+		if ( ! empty($downloads)) {
199 199
 			$has_downloads = true;
200 200
 		}
201 201
 	}
@@ -208,15 +208,15 @@  discard block
 block discarded – undo
208 208
  * @param string $post_id
209 209
  * @return boolean
210 210
  */
211
-function lsx_health_plan_has_tips( $post_id = '' ) {
211
+function lsx_health_plan_has_tips($post_id = '') {
212 212
 	$has_tips = false;
213
-	if ( '' === $post_id ) {
213
+	if ('' === $post_id) {
214 214
 		$post_id = get_the_ID();
215 215
 	}
216
-	$post_type      = get_post_type( $post_id );
217
-	$connected_tips = get_post_meta( get_the_ID(), $post_type . '_connected_tips', true );
218
-	$connected_tips = \lsx_health_plan\functions\check_posts_exist( $connected_tips );
219
-	if ( ! empty( $connected_tips ) ) {
216
+	$post_type      = get_post_type($post_id);
217
+	$connected_tips = get_post_meta(get_the_ID(), $post_type . '_connected_tips', true);
218
+	$connected_tips = \lsx_health_plan\functions\check_posts_exist($connected_tips);
219
+	if ( ! empty($connected_tips)) {
220 220
 		$has_tips = true;
221 221
 	}
222 222
 	return $has_tips;
Please login to merge, or discard this patch.
includes/template-tags/plan.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
  * @return void
12 12
  */
13 13
 function lsx_hp_plan_archive_filters() {
14
-	if ( is_post_type_archive( 'plan' ) && function_exists( 'wc_get_page_id' ) && false === apply_filters( 'lsx_hp_disable_plan_archive_filters', false ) ) {
15
-		?>
14
+     if ( is_post_type_archive( 'plan' ) && function_exists( 'wc_get_page_id' ) && false === apply_filters( 'lsx_hp_disable_plan_archive_filters', false ) ) {
15
+          ?>
16 16
 		<div id="type-nav">
17 17
 			<ul class="nav nav-pills lsx-type-nav-filter">
18 18
 				<li class="active"><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter="*"><?php esc_html_e( 'All', 'lsx-health-plan' ); ?></a></li>
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 			</ul>
23 23
 		</div>
24 24
 		<?php
25
-	}
25
+     }
26 26
 }
27 27
 
28 28
 /**
@@ -31,27 +31,27 @@  discard block
 block discarded – undo
31 31
  * @return string
32 32
  */
33 33
 function lsx_hp_plan_get_classes() {
34
-	$classes = 'filter-free';
35
-	if ( function_exists( 'lsx_health_plan\functions\woocommerce\plan_has_products' ) && \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
36
-		$products       = \lsx_health_plan\functions\woocommerce\get_plan_products();
37
-		$linked_product = wc_get_product( $products[0] );
38
-		$price          = $linked_product->get_price( 'raw' );
39
-		if ( empty( $price ) ) {
40
-			$classes = 'filter-free';
41
-		} else {
42
-			$classes = 'filter-paid';
43
-		}
34
+     $classes = 'filter-free';
35
+     if ( function_exists( 'lsx_health_plan\functions\woocommerce\plan_has_products' ) && \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
36
+          $products       = \lsx_health_plan\functions\woocommerce\get_plan_products();
37
+          $linked_product = wc_get_product( $products[0] );
38
+          $price          = $linked_product->get_price( 'raw' );
39
+          if ( empty( $price ) ) {
40
+               $classes = 'filter-free';
41
+          } else {
42
+               $classes = 'filter-paid';
43
+          }
44 44
 
45
-		$featured = get_post_meta( get_the_ID(), 'plan_featured_plan', true );
46
-		if ( false !== $featured && '' !== $featured ) {
47
-			$classes .= ' filter-featured';
48
-		}
49
-	}
50
-	return $classes;
45
+          $featured = get_post_meta( get_the_ID(), 'plan_featured_plan', true );
46
+          if ( false !== $featured && '' !== $featured ) {
47
+               $classes .= ' filter-featured';
48
+          }
49
+     }
50
+     return $classes;
51 51
 }
52 52
 
53 53
 function lsx_health_plan_back_to_plan_button() {
54
-	?>
54
+     ?>
55 55
 	<div  class="back-plan-btn">
56 56
 		<a class="btn" href="<?php the_permalink(); ?>"><?php esc_html_e( 'Back To Plan', 'lsx-health-plan' ); ?></a>
57 57
 	</div>
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -11,14 +11,14 @@  discard block
 block discarded – undo
11 11
  * @return void
12 12
  */
13 13
 function lsx_hp_plan_archive_filters() {
14
-	if ( is_post_type_archive( 'plan' ) && function_exists( 'wc_get_page_id' ) && false === apply_filters( 'lsx_hp_disable_plan_archive_filters', false ) ) {
14
+	if (is_post_type_archive('plan') && function_exists('wc_get_page_id') && false === apply_filters('lsx_hp_disable_plan_archive_filters', false)) {
15 15
 		?>
16 16
 		<div id="type-nav">
17 17
 			<ul class="nav nav-pills lsx-type-nav-filter">
18
-				<li class="active"><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter="*"><?php esc_html_e( 'All', 'lsx-health-plan' ); ?></a></li>
19
-				<li><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter=".filter-free"><?php esc_html_e( 'Free', 'lsx-health-plan' ); ?></a></li>
20
-				<li><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter=".filter-paid"><?php esc_html_e( 'Paid', 'lsx-health-plan' ); ?></a></li>
21
-				<li><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter=".filter-featured"><?php esc_html_e( 'Featured', 'lsx-health-plan' ); ?></a></li>
18
+				<li class="active"><a href="<?php echo empty($group_selected) ? '#' : esc_url(get_post_type_archive_link('plan')); ?>" data-filter="*"><?php esc_html_e('All', 'lsx-health-plan'); ?></a></li>
19
+				<li><a href="<?php echo empty($group_selected) ? '#' : esc_url(get_post_type_archive_link('plan')); ?>" data-filter=".filter-free"><?php esc_html_e('Free', 'lsx-health-plan'); ?></a></li>
20
+				<li><a href="<?php echo empty($group_selected) ? '#' : esc_url(get_post_type_archive_link('plan')); ?>" data-filter=".filter-paid"><?php esc_html_e('Paid', 'lsx-health-plan'); ?></a></li>
21
+				<li><a href="<?php echo empty($group_selected) ? '#' : esc_url(get_post_type_archive_link('plan')); ?>" data-filter=".filter-featured"><?php esc_html_e('Featured', 'lsx-health-plan'); ?></a></li>
22 22
 			</ul>
23 23
 		</div>
24 24
 		<?php
@@ -32,18 +32,18 @@  discard block
 block discarded – undo
32 32
  */
33 33
 function lsx_hp_plan_get_classes() {
34 34
 	$classes = 'filter-free';
35
-	if ( function_exists( 'lsx_health_plan\functions\woocommerce\plan_has_products' ) && \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
35
+	if (function_exists('lsx_health_plan\functions\woocommerce\plan_has_products') && \lsx_health_plan\functions\woocommerce\plan_has_products()) {
36 36
 		$products       = \lsx_health_plan\functions\woocommerce\get_plan_products();
37
-		$linked_product = wc_get_product( $products[0] );
38
-		$price          = $linked_product->get_price( 'raw' );
39
-		if ( empty( $price ) ) {
37
+		$linked_product = wc_get_product($products[0]);
38
+		$price          = $linked_product->get_price('raw');
39
+		if (empty($price)) {
40 40
 			$classes = 'filter-free';
41 41
 		} else {
42 42
 			$classes = 'filter-paid';
43 43
 		}
44 44
 
45
-		$featured = get_post_meta( get_the_ID(), 'plan_featured_plan', true );
46
-		if ( false !== $featured && '' !== $featured ) {
45
+		$featured = get_post_meta(get_the_ID(), 'plan_featured_plan', true);
46
+		if (false !== $featured && '' !== $featured) {
47 47
 			$classes .= ' filter-featured';
48 48
 		}
49 49
 	}
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 function lsx_health_plan_back_to_plan_button() {
54 54
 	?>
55 55
 	<div  class="back-plan-btn">
56
-		<a class="btn" href="<?php the_permalink(); ?>"><?php esc_html_e( 'Back To Plan', 'lsx-health-plan' ); ?></a>
56
+		<a class="btn" href="<?php the_permalink(); ?>"><?php esc_html_e('Back To Plan', 'lsx-health-plan'); ?></a>
57 57
 	</div>
58 58
 	<?php
59 59
 }
Please login to merge, or discard this patch.
templates/content-archive-plan.php 2 patches
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -18,51 +18,51 @@  discard block
 block discarded – undo
18 18
 $linked_product  = false;
19 19
 $restricted      = '';
20 20
 if ( function_exists( 'lsx_health_plan\functions\woocommerce\plan_has_products' ) && \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
21
-	$products       = \lsx_health_plan\functions\woocommerce\get_plan_products();
22
-	$linked_product = wc_get_product( $products[0] );
23
-	$product        = $linked_product;
21
+     $products       = \lsx_health_plan\functions\woocommerce\get_plan_products();
22
+     $linked_product = wc_get_product( $products[0] );
23
+     $product        = $linked_product;
24 24
 
25
-	if ( function_exists( 'wc_memberships_is_post_content_restricted' ) && wc_memberships_is_post_content_restricted( get_the_ID() ) ) {
26
-		$restricted = ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
27
-	}
25
+     if ( function_exists( 'wc_memberships_is_post_content_restricted' ) && wc_memberships_is_post_content_restricted( get_the_ID() ) ) {
26
+          $restricted = ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
27
+     }
28 28
 }
29 29
 
30 30
 // Check for shortcode overrides.
31 31
 if ( null !== $shortcode_args ) {
32
-	if ( isset( $shortcode_args['columns'] ) ) {
33
-		$column_class = $shortcode_args['columns'];
34
-		$column_class = \lsx_health_plan\functions\column_class( $column_class );
35
-	}
36
-	if ( isset( $shortcode_args['link'] ) ) {
37
-		$link_setting = $shortcode_args['link'];
38
-		// Setup our link and content.
39
-		switch ( $link_setting ) {
40
-			case 'single':
41
-				$link_html  = '<a href="' . get_permalink( $group['connected_plans'] ) . '">';
42
-				$link_close = '</a>';
43
-				break;
32
+     if ( isset( $shortcode_args['columns'] ) ) {
33
+          $column_class = $shortcode_args['columns'];
34
+          $column_class = \lsx_health_plan\functions\column_class( $column_class );
35
+     }
36
+     if ( isset( $shortcode_args['link'] ) ) {
37
+          $link_setting = $shortcode_args['link'];
38
+          // Setup our link and content.
39
+          switch ( $link_setting ) {
40
+               case 'single':
41
+                    $link_html  = '<a href="' . get_permalink( $group['connected_plans'] ) . '">';
42
+                    $link_close = '</a>';
43
+                    break;
44 44
 
45
-			case 'modal':
46
-				$link_html  = '<a data-toggle="modal" href="#workout-plan-modal-' . $group['connected_plans'] . '">';
47
-				$link_close = '</a>';
48
-				$modal_content_setting = \lsx_health_plan\functions\get_option( 'workout_tab_modal_content', 'excerpt' );
49
-				$modal_args = array(
50
-					'modal_content' => $modal_content_setting,
51
-				);
52
-				// We call the button to register the modal, but we do not output it.
53
-				lsx_health_plan_workout_plan_button( $group['connected_plans'], $group, false, $modal_args );
54
-				break;
45
+               case 'modal':
46
+                    $link_html  = '<a data-toggle="modal" href="#workout-plan-modal-' . $group['connected_plans'] . '">';
47
+                    $link_close = '</a>';
48
+                    $modal_content_setting = \lsx_health_plan\functions\get_option( 'workout_tab_modal_content', 'excerpt' );
49
+                    $modal_args = array(
50
+                         'modal_content' => $modal_content_setting,
51
+                    );
52
+                    // We call the button to register the modal, but we do not output it.
53
+                    lsx_health_plan_workout_plan_button( $group['connected_plans'], $group, false, $modal_args );
54
+                    break;
55 55
 
56
-			case 'none':
57
-			default:
58
-				$link_html  = '';
59
-				$link_close = '';
60
-				break;
61
-		}
62
-	}
63
-	if ( isset( $shortcode_args['description'] ) ) {
64
-		$content_setting = $shortcode_args['description'];
65
-	}
56
+               case 'none':
57
+               default:
58
+                    $link_html  = '';
59
+                    $link_close = '';
60
+                    break;
61
+          }
62
+     }
63
+     if ( isset( $shortcode_args['description'] ) ) {
64
+          $content_setting = $shortcode_args['description'];
65
+     }
66 66
 }
67 67
 
68 68
 $featured      = get_post_meta( get_the_ID(), 'plan_featured_plan', true );
@@ -78,62 +78,62 @@  discard block
 block discarded – undo
78 78
 			<?php } ?>
79 79
 			<a href="<?php echo esc_url( get_permalink() ); ?>">
80 80
 			<?php
81
-			$featured_image = get_the_post_thumbnail();
82
-			if ( ! empty( $featured_image ) && '' !== $featured_image ) {
83
-				the_post_thumbnail( 'lsx-thumbnail', array(
84
-					'class' => 'aligncenter',
85
-				) );
86
-			} else {
87
-				?>
81
+               $featured_image = get_the_post_thumbnail();
82
+               if ( ! empty( $featured_image ) && '' !== $featured_image ) {
83
+                    the_post_thumbnail( 'lsx-thumbnail', array(
84
+                         'class' => 'aligncenter',
85
+                    ) );
86
+               } else {
87
+                    ?>
88 88
 				<img loading="lazy" class="placeholder" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>">
89 89
 				<?php
90
-			}
91
-			?>
90
+               }
91
+               ?>
92 92
 			</a>
93 93
 		</div>
94 94
 		<div class="content-box plan-content-box white-bg">
95 95
 			<h3 class="plan id-<?php the_ID(); ?> <?php echo esc_attr( $completed_class ); ?>"><a href="<?php echo esc_url( get_permalink() ); ?>"><?php the_title(); ?></a></h3>
96 96
 			<?php
97
-				echo wp_kses_post( \lsx_health_plan\functions\hp_get_plan_type_meta( $post ) );
98
-			?>
97
+                    echo wp_kses_post( \lsx_health_plan\functions\hp_get_plan_type_meta( $post ) );
98
+               ?>
99 99
 			<?php
100
-			if ( false !== $linked_product ) {
101
-				echo '<div class="plan-price">';
102
-				echo wp_kses_post( $linked_product->get_price_html() );
103
-				echo '</div>';
104
-			}
105
-			?>
100
+               if ( false !== $linked_product ) {
101
+                    echo '<div class="plan-price">';
102
+                    echo wp_kses_post( $linked_product->get_price_html() );
103
+                    echo '</div>';
104
+               }
105
+               ?>
106 106
 			<div class="excerpt">
107 107
 				<?php
108
-				if ( ! has_excerpt() ) {
109
-					$content = wp_trim_words( get_the_content(), 20 );
110
-					$content = '<p>' . $content . '</p>';
111
-				} else {
112
-					$content = apply_filters( 'the_excerpt', get_the_excerpt() );
113
-				}
114
-				echo wp_kses_post( $content );
115
-				?>
108
+                    if ( ! has_excerpt() ) {
109
+                         $content = wp_trim_words( get_the_content(), 20 );
110
+                         $content = '<p>' . $content . '</p>';
111
+                    } else {
112
+                         $content = apply_filters( 'the_excerpt', get_the_excerpt() );
113
+                    }
114
+                    echo wp_kses_post( $content );
115
+                    ?>
116 116
 			</div>
117 117
 
118 118
 			<?php
119
-			$button_link  = get_permalink();
120
-			$button_text  = __( 'Sign Up', 'lsx-health-plan' );
121
-			$button_class = '';
119
+               $button_link  = get_permalink();
120
+               $button_text  = __( 'Sign Up', 'lsx-health-plan' );
121
+               $button_class = '';
122 122
 
123
-			if ( true === $restricted ) {
124
-				if ( 1 < count( $products ) ) {
125
-					$button_text = __( 'Select Options', 'lsx-health-plan' );
126
-				} else {
127
-					$button_link = $linked_product->add_to_cart_url() . '&plan_id=' . get_the_ID();
128
-					$button_text = $linked_product->add_to_cart_text();
129
-				}
130
-				?>
123
+               if ( true === $restricted ) {
124
+                    if ( 1 < count( $products ) ) {
125
+                         $button_text = __( 'Select Options', 'lsx-health-plan' );
126
+                    } else {
127
+                         $button_link = $linked_product->add_to_cart_url() . '&plan_id=' . get_the_ID();
128
+                         $button_text = $linked_product->add_to_cart_text();
129
+                    }
130
+                    ?>
131 131
 				<?php
132
-			} elseif ( false === $restricted ) {
133
-				$button_text  = __( 'Already Signed Up', 'lsx-health-plan' );
134
-				$button_class = 'btn-disabled';
135
-			}
136
-			?>
132
+               } elseif ( false === $restricted ) {
133
+                    $button_text  = __( 'Already Signed Up', 'lsx-health-plan' );
134
+                    $button_class = 'btn-disabled';
135
+               }
136
+               ?>
137 137
 			<a class="btn <?php echo esc_attr( $button_class ); ?>" href="<?php echo esc_attr( $button_link ); ?>"><?php echo esc_attr( $button_text ); ?></a>
138 138
 		</div>
139 139
 		<?php lsx_entry_bottom(); ?>
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -17,40 +17,40 @@  discard block
 block discarded – undo
17 17
 $link_close      = '';
18 18
 $linked_product  = false;
19 19
 $restricted      = '';
20
-if ( function_exists( 'lsx_health_plan\functions\woocommerce\plan_has_products' ) && \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
20
+if (function_exists('lsx_health_plan\functions\woocommerce\plan_has_products') && \lsx_health_plan\functions\woocommerce\plan_has_products()) {
21 21
 	$products       = \lsx_health_plan\functions\woocommerce\get_plan_products();
22
-	$linked_product = wc_get_product( $products[0] );
22
+	$linked_product = wc_get_product($products[0]);
23 23
 	$product        = $linked_product;
24 24
 
25
-	if ( function_exists( 'wc_memberships_is_post_content_restricted' ) && wc_memberships_is_post_content_restricted( get_the_ID() ) ) {
26
-		$restricted = ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
25
+	if (function_exists('wc_memberships_is_post_content_restricted') && wc_memberships_is_post_content_restricted(get_the_ID())) {
26
+		$restricted = ! current_user_can('wc_memberships_view_restricted_post_content', get_the_ID());
27 27
 	}
28 28
 }
29 29
 
30 30
 // Check for shortcode overrides.
31
-if ( null !== $shortcode_args ) {
32
-	if ( isset( $shortcode_args['columns'] ) ) {
31
+if (null !== $shortcode_args) {
32
+	if (isset($shortcode_args['columns'])) {
33 33
 		$column_class = $shortcode_args['columns'];
34
-		$column_class = \lsx_health_plan\functions\column_class( $column_class );
34
+		$column_class = \lsx_health_plan\functions\column_class($column_class);
35 35
 	}
36
-	if ( isset( $shortcode_args['link'] ) ) {
36
+	if (isset($shortcode_args['link'])) {
37 37
 		$link_setting = $shortcode_args['link'];
38 38
 		// Setup our link and content.
39
-		switch ( $link_setting ) {
39
+		switch ($link_setting) {
40 40
 			case 'single':
41
-				$link_html  = '<a href="' . get_permalink( $group['connected_plans'] ) . '">';
41
+				$link_html  = '<a href="' . get_permalink($group['connected_plans']) . '">';
42 42
 				$link_close = '</a>';
43 43
 				break;
44 44
 
45 45
 			case 'modal':
46 46
 				$link_html  = '<a data-toggle="modal" href="#workout-plan-modal-' . $group['connected_plans'] . '">';
47 47
 				$link_close = '</a>';
48
-				$modal_content_setting = \lsx_health_plan\functions\get_option( 'workout_tab_modal_content', 'excerpt' );
48
+				$modal_content_setting = \lsx_health_plan\functions\get_option('workout_tab_modal_content', 'excerpt');
49 49
 				$modal_args = array(
50 50
 					'modal_content' => $modal_content_setting,
51 51
 				);
52 52
 				// We call the button to register the modal, but we do not output it.
53
-				lsx_health_plan_workout_plan_button( $group['connected_plans'], $group, false, $modal_args );
53
+				lsx_health_plan_workout_plan_button($group['connected_plans'], $group, false, $modal_args);
54 54
 				break;
55 55
 
56 56
 			case 'none':
@@ -60,81 +60,81 @@  discard block
 block discarded – undo
60 60
 				break;
61 61
 		}
62 62
 	}
63
-	if ( isset( $shortcode_args['description'] ) ) {
63
+	if (isset($shortcode_args['description'])) {
64 64
 		$content_setting = $shortcode_args['description'];
65 65
 	}
66 66
 }
67 67
 
68
-$featured      = get_post_meta( get_the_ID(), 'plan_featured_plan', true );
68
+$featured = get_post_meta(get_the_ID(), 'plan_featured_plan', true);
69 69
 ?>
70 70
 
71
-<div class="lsx-plan-column col-xs-12 col-sm-6 col-md-<?php echo esc_attr( $column_class ); ?> <?php echo esc_attr( lsx_hp_plan_get_classes() ); ?>">
71
+<div class="lsx-plan-column col-xs-12 col-sm-6 col-md-<?php echo esc_attr($column_class); ?> <?php echo esc_attr(lsx_hp_plan_get_classes()); ?>">
72 72
 	<article class="lsx-slot box-shadow">
73 73
 		<?php lsx_entry_top(); ?>
74 74
 
75 75
 		<div class="plan-feature-img">
76
-			<?php if ( $featured ) { ?>
76
+			<?php if ($featured) { ?>
77 77
 				<span class="featured-plan"><?php //lsx_get_svg_icon( 'icon-featured.svg' ); ?></span>
78 78
 			<?php } ?>
79
-			<a href="<?php echo esc_url( get_permalink() ); ?>">
79
+			<a href="<?php echo esc_url(get_permalink()); ?>">
80 80
 			<?php
81 81
 			$featured_image = get_the_post_thumbnail();
82
-			if ( ! empty( $featured_image ) && '' !== $featured_image ) {
83
-				the_post_thumbnail( 'lsx-thumbnail', array(
82
+			if ( ! empty($featured_image) && '' !== $featured_image) {
83
+				the_post_thumbnail('lsx-thumbnail', array(
84 84
 					'class' => 'aligncenter',
85
-				) );
85
+				));
86 86
 			} else {
87 87
 				?>
88
-				<img loading="lazy" class="placeholder" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>">
88
+				<img loading="lazy" class="placeholder" src="<?php echo esc_attr(plugin_dir_url(__FILE__) . '../assets/images/placeholder.jpg'); ?>">
89 89
 				<?php
90 90
 			}
91 91
 			?>
92 92
 			</a>
93 93
 		</div>
94 94
 		<div class="content-box plan-content-box white-bg">
95
-			<h3 class="plan id-<?php the_ID(); ?> <?php echo esc_attr( $completed_class ); ?>"><a href="<?php echo esc_url( get_permalink() ); ?>"><?php the_title(); ?></a></h3>
95
+			<h3 class="plan id-<?php the_ID(); ?> <?php echo esc_attr($completed_class); ?>"><a href="<?php echo esc_url(get_permalink()); ?>"><?php the_title(); ?></a></h3>
96 96
 			<?php
97
-				echo wp_kses_post( \lsx_health_plan\functions\hp_get_plan_type_meta( $post ) );
97
+				echo wp_kses_post(\lsx_health_plan\functions\hp_get_plan_type_meta($post));
98 98
 			?>
99 99
 			<?php
100
-			if ( false !== $linked_product ) {
100
+			if (false !== $linked_product) {
101 101
 				echo '<div class="plan-price">';
102
-				echo wp_kses_post( $linked_product->get_price_html() );
102
+				echo wp_kses_post($linked_product->get_price_html());
103 103
 				echo '</div>';
104 104
 			}
105 105
 			?>
106 106
 			<div class="excerpt">
107 107
 				<?php
108
-				if ( ! has_excerpt() ) {
109
-					$content = wp_trim_words( get_the_content(), 20 );
108
+				if ( ! has_excerpt()) {
109
+					$content = wp_trim_words(get_the_content(), 20);
110 110
 					$content = '<p>' . $content . '</p>';
111 111
 				} else {
112
-					$content = apply_filters( 'the_excerpt', get_the_excerpt() );
112
+					$content = apply_filters('the_excerpt', get_the_excerpt());
113 113
 				}
114
-				echo wp_kses_post( $content );
114
+				echo wp_kses_post($content);
115 115
 				?>
116 116
 			</div>
117 117
 
118 118
 			<?php
119 119
 			$button_link  = get_permalink();
120
-			$button_text  = __( 'Sign Up', 'lsx-health-plan' );
120
+			$button_text  = __('Sign Up', 'lsx-health-plan');
121 121
 			$button_class = '';
122 122
 
123
-			if ( true === $restricted ) {
124
-				if ( 1 < count( $products ) ) {
125
-					$button_text = __( 'Select Options', 'lsx-health-plan' );
123
+			if (true === $restricted) {
124
+				if (1 < count($products)) {
125
+					$button_text = __('Select Options', 'lsx-health-plan');
126 126
 				} else {
127 127
 					$button_link = $linked_product->add_to_cart_url() . '&plan_id=' . get_the_ID();
128 128
 					$button_text = $linked_product->add_to_cart_text();
129 129
 				}
130 130
 				?>
131 131
 				<?php
132
-			} elseif ( false === $restricted ) {
133
-				$button_text  = __( 'Already Signed Up', 'lsx-health-plan' );
132
+			} elseif (false === $restricted) {
133
+				$button_text  = __('Already Signed Up', 'lsx-health-plan');
134 134
 				$button_class = 'btn-disabled';
135 135
 			}
136 136
 			?>
137
-			<a class="btn <?php echo esc_attr( $button_class ); ?>" href="<?php echo esc_attr( $button_link ); ?>"><?php echo esc_attr( $button_text ); ?></a>
137
+			<a class="btn <?php echo esc_attr($button_class); ?>" href="<?php echo esc_attr($button_link); ?>"><?php echo esc_attr($button_text); ?></a>
138 138
 		</div>
139 139
 		<?php lsx_entry_bottom(); ?>
140 140
 	</article>
Please login to merge, or discard this patch.
templates/partials/workout-sets.php 2 patches
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -8,57 +8,57 @@  discard block
 block discarded – undo
8 8
 
9 9
 // Check for any shortcode overrides.
10 10
 if ( null !== $shortcode_args && isset( $shortcode_args['include'] ) ) {
11
-	$connected_workouts = array( get_the_ID() );
11
+     $connected_workouts = array( get_the_ID() );
12 12
 }
13 13
 ?>
14 14
 <div class="sets-wrapper">
15 15
 	<?php
16
-	if ( empty( $connected_workouts ) || null === $connected_workouts ) {
17
-		$connected_workouts = get_post_meta( get_the_ID(), 'connected_workouts', true );
18
-		if ( empty( $connected_workouts ) ) {
19
-			$options = \lsx_health_plan\functions\get_option( 'all' );
20
-			if ( isset( $options['connected_workouts'] ) && '' !== $options['connected_workouts'] && ! empty( $options['connected_workouts'] ) ) {
21
-				$connected_workouts = $options['connected_workouts'];
22
-				if ( ! array( $connected_workouts ) ) {
23
-					$connected_workouts = array( $connected_workouts );
24
-				}
25
-			}
26
-		}
27
-	}
28
-	$args     = array(
29
-		'orderby'   => 'date',
30
-		'order'     => 'DESC',
31
-		'post_type' => 'workout',
32
-		'post__in'  => $connected_workouts,
33
-	);
34
-	$workouts = new WP_Query( $args );
16
+     if ( empty( $connected_workouts ) || null === $connected_workouts ) {
17
+          $connected_workouts = get_post_meta( get_the_ID(), 'connected_workouts', true );
18
+          if ( empty( $connected_workouts ) ) {
19
+               $options = \lsx_health_plan\functions\get_option( 'all' );
20
+               if ( isset( $options['connected_workouts'] ) && '' !== $options['connected_workouts'] && ! empty( $options['connected_workouts'] ) ) {
21
+                    $connected_workouts = $options['connected_workouts'];
22
+                    if ( ! array( $connected_workouts ) ) {
23
+                         $connected_workouts = array( $connected_workouts );
24
+                    }
25
+               }
26
+          }
27
+     }
28
+     $args     = array(
29
+          'orderby'   => 'date',
30
+          'order'     => 'DESC',
31
+          'post_type' => 'workout',
32
+          'post__in'  => $connected_workouts,
33
+     );
34
+     $workouts = new WP_Query( $args );
35 35
 
36
-	if ( $workouts->have_posts() ) {
37
-		while ( $workouts->have_posts() ) {
38
-			$workouts->the_post();
39
-			// Brings the workout post content first.
40
-			echo wp_kses_post( lsx_health_plan_workout_main_content() );
36
+     if ( $workouts->have_posts() ) {
37
+          while ( $workouts->have_posts() ) {
38
+               $workouts->the_post();
39
+               // Brings the workout post content first.
40
+               echo wp_kses_post( lsx_health_plan_workout_main_content() );
41 41
 
42
-			$i               = 1;
43
-			$section_counter = 6;
44
-			echo '<div class="sets">';
45
-			while ( $i <= $section_counter ) {
42
+               $i               = 1;
43
+               $section_counter = 6;
44
+               echo '<div class="sets">';
45
+               while ( $i <= $section_counter ) {
46 46
 
47
-				$workout_section = 'workout_section_' . ( $i ) . '_title';
48
-				$workout_desc    = 'workout_section_' . ( $i ) . '_description';
47
+                    $workout_section = 'workout_section_' . ( $i ) . '_title';
48
+                    $workout_desc    = 'workout_section_' . ( $i ) . '_description';
49 49
 
50
-				$section_title = get_post_meta( get_the_ID(), $workout_section, true );
51
-				$description   = get_post_meta( get_the_ID(), $workout_desc, true );
52
-				if ( is_singular( 'workout' ) ) {
53
-					$section_title = get_post_meta( get_queried_object_id(), $workout_section, true );
54
-					$description   = get_post_meta( get_queried_object_id(), $workout_desc, true );
55
-				}
50
+                    $section_title = get_post_meta( get_the_ID(), $workout_section, true );
51
+                    $description   = get_post_meta( get_the_ID(), $workout_desc, true );
52
+                    if ( is_singular( 'workout' ) ) {
53
+                         $section_title = get_post_meta( get_queried_object_id(), $workout_section, true );
54
+                         $description   = get_post_meta( get_queried_object_id(), $workout_desc, true );
55
+                    }
56 56
 
57
-				if ( '' === $section_title ) {
58
-					$i++;
59
-					continue;
60
-				}
61
-				?>
57
+                    if ( '' === $section_title ) {
58
+                         $i++;
59
+                         continue;
60
+                    }
61
+                    ?>
62 62
 				<div class="set-box set content-box">
63 63
 					<h3 class="set-title"><?php echo esc_html( $section_title ); ?></h3>
64 64
 					<div class="set-content">
@@ -67,11 +67,11 @@  discard block
 block discarded – undo
67 67
 					<?php lsx_health_plan_workout_tab_content( $i ); ?>
68 68
 				</div>
69 69
 				<?php
70
-				$i++;
71
-			}
72
-			echo '</div>';
73
-		}
74
-		?>
70
+                    $i++;
71
+               }
72
+               echo '</div>';
73
+          }
74
+          ?>
75 75
 	<?php } ?>
76 76
 	<?php wp_reset_postdata(); ?>
77 77
 </div>
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -7,64 +7,64 @@
 block discarded – undo
7 7
 global $group_name, $connected_workouts, $shortcode_args;
8 8
 
9 9
 // Check for any shortcode overrides.
10
-if ( null !== $shortcode_args && isset( $shortcode_args['include'] ) ) {
11
-	$connected_workouts = array( get_the_ID() );
10
+if (null !== $shortcode_args && isset($shortcode_args['include'])) {
11
+	$connected_workouts = array(get_the_ID());
12 12
 }
13 13
 ?>
14 14
 <div class="sets-wrapper">
15 15
 	<?php
16
-	if ( empty( $connected_workouts ) || null === $connected_workouts ) {
17
-		$connected_workouts = get_post_meta( get_the_ID(), 'connected_workouts', true );
18
-		if ( empty( $connected_workouts ) ) {
19
-			$options = \lsx_health_plan\functions\get_option( 'all' );
20
-			if ( isset( $options['connected_workouts'] ) && '' !== $options['connected_workouts'] && ! empty( $options['connected_workouts'] ) ) {
16
+	if (empty($connected_workouts) || null === $connected_workouts) {
17
+		$connected_workouts = get_post_meta(get_the_ID(), 'connected_workouts', true);
18
+		if (empty($connected_workouts)) {
19
+			$options = \lsx_health_plan\functions\get_option('all');
20
+			if (isset($options['connected_workouts']) && '' !== $options['connected_workouts'] && ! empty($options['connected_workouts'])) {
21 21
 				$connected_workouts = $options['connected_workouts'];
22
-				if ( ! array( $connected_workouts ) ) {
23
-					$connected_workouts = array( $connected_workouts );
22
+				if ( ! array($connected_workouts)) {
23
+					$connected_workouts = array($connected_workouts);
24 24
 				}
25 25
 			}
26 26
 		}
27 27
 	}
28
-	$args     = array(
28
+	$args = array(
29 29
 		'orderby'   => 'date',
30 30
 		'order'     => 'DESC',
31 31
 		'post_type' => 'workout',
32 32
 		'post__in'  => $connected_workouts,
33 33
 	);
34
-	$workouts = new WP_Query( $args );
34
+	$workouts = new WP_Query($args);
35 35
 
36
-	if ( $workouts->have_posts() ) {
37
-		while ( $workouts->have_posts() ) {
36
+	if ($workouts->have_posts()) {
37
+		while ($workouts->have_posts()) {
38 38
 			$workouts->the_post();
39 39
 			// Brings the workout post content first.
40
-			echo wp_kses_post( lsx_health_plan_workout_main_content() );
40
+			echo wp_kses_post(lsx_health_plan_workout_main_content());
41 41
 
42 42
 			$i               = 1;
43 43
 			$section_counter = 6;
44 44
 			echo '<div class="sets">';
45
-			while ( $i <= $section_counter ) {
45
+			while ($i <= $section_counter) {
46 46
 
47
-				$workout_section = 'workout_section_' . ( $i ) . '_title';
48
-				$workout_desc    = 'workout_section_' . ( $i ) . '_description';
47
+				$workout_section = 'workout_section_' . ($i) . '_title';
48
+				$workout_desc    = 'workout_section_' . ($i) . '_description';
49 49
 
50
-				$section_title = get_post_meta( get_the_ID(), $workout_section, true );
51
-				$description   = get_post_meta( get_the_ID(), $workout_desc, true );
52
-				if ( is_singular( 'workout' ) ) {
53
-					$section_title = get_post_meta( get_queried_object_id(), $workout_section, true );
54
-					$description   = get_post_meta( get_queried_object_id(), $workout_desc, true );
50
+				$section_title = get_post_meta(get_the_ID(), $workout_section, true);
51
+				$description   = get_post_meta(get_the_ID(), $workout_desc, true);
52
+				if (is_singular('workout')) {
53
+					$section_title = get_post_meta(get_queried_object_id(), $workout_section, true);
54
+					$description   = get_post_meta(get_queried_object_id(), $workout_desc, true);
55 55
 				}
56 56
 
57
-				if ( '' === $section_title ) {
57
+				if ('' === $section_title) {
58 58
 					$i++;
59 59
 					continue;
60 60
 				}
61 61
 				?>
62 62
 				<div class="set-box set content-box">
63
-					<h3 class="set-title"><?php echo esc_html( $section_title ); ?></h3>
63
+					<h3 class="set-title"><?php echo esc_html($section_title); ?></h3>
64 64
 					<div class="set-content">
65
-						<p><?php echo wp_kses_post( apply_filters( 'the_content', $description ) ); ?></p>
65
+						<p><?php echo wp_kses_post(apply_filters('the_content', $description)); ?></p>
66 66
 					</div>
67
-					<?php lsx_health_plan_workout_tab_content( $i ); ?>
67
+					<?php lsx_health_plan_workout_tab_content($i); ?>
68 68
 				</div>
69 69
 				<?php
70 70
 				$i++;
Please login to merge, or discard this patch.
templates/content-exercise.php 2 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
 $sharing = 'sharing-disabled';
19 19
 if ( class_exists( 'LSX_Sharing' ) || ( function_exists( 'sharing_display' ) || class_exists( 'Jetpack_Likes' ) ) ) :
20
-	$sharing = 'sharing-enabled';
20
+     $sharing = 'sharing-enabled';
21 21
 endif;
22 22
 
23 23
 ?>
@@ -38,19 +38,19 @@  discard block
 block discarded – undo
38 38
 			<?php if ( class_exists( 'LSX_Sharing' ) || ( function_exists( 'sharing_display' ) || class_exists( 'Jetpack_Likes' ) ) ) : ?>
39 39
 
40 40
 					<?php
41
-					if ( class_exists( 'LSX_Sharing' ) ) {
42
-						lsx_content_sharing();
43
-					} else {
44
-						if ( function_exists( 'sharing_display' ) ) {
45
-							sharing_display( '', true );
46
-						}
47
-
48
-						if ( class_exists( 'Jetpack_Likes' ) ) {
49
-							$custom_likes = new Jetpack_Likes();
50
-							echo wp_kses_post( $custom_likes->post_likes( '' ) );
51
-						}
52
-					}
53
-					?>
41
+                         if ( class_exists( 'LSX_Sharing' ) ) {
42
+                              lsx_content_sharing();
43
+                         } else {
44
+                              if ( function_exists( 'sharing_display' ) ) {
45
+                                   sharing_display( '', true );
46
+                              }
47
+
48
+                              if ( class_exists( 'Jetpack_Likes' ) ) {
49
+                                   $custom_likes = new Jetpack_Likes();
50
+                                   echo wp_kses_post( $custom_likes->post_likes( '' ) );
51
+                              }
52
+                         }
53
+                         ?>
54 54
 			<?php endif ?>
55 55
 
56 56
 			<?php lsx_health_plan_exercise_title( '<h2>', '</h2>', false ); ?>
@@ -60,23 +60,23 @@  discard block
 block discarded – undo
60 60
 			<div class="col-md-6 exercise-image lsx-hp-shadow">
61 61
 
62 62
 			<?php
63
-			$lsx_hp = lsx_health_plan();
64
-
65
-			if ( $lsx_hp->frontend->gallery->has_gallery( get_the_ID() ) ) {
66
-				lsx_health_plan_gallery();
67
-			} else {
68
-				$featured_image = get_the_post_thumbnail();
69
-				if ( ! empty( $featured_image ) && '' !== $featured_image ) {
70
-					the_post_thumbnail( 'large', array(
71
-						'class' => 'aligncenter',
72
-					) );
73
-				} else {
74
-					?>
63
+               $lsx_hp = lsx_health_plan();
64
+
65
+               if ( $lsx_hp->frontend->gallery->has_gallery( get_the_ID() ) ) {
66
+                    lsx_health_plan_gallery();
67
+               } else {
68
+                    $featured_image = get_the_post_thumbnail();
69
+                    if ( ! empty( $featured_image ) && '' !== $featured_image ) {
70
+                         the_post_thumbnail( 'large', array(
71
+                              'class' => 'aligncenter',
72
+                         ) );
73
+                    } else {
74
+                         ?>
75 75
 					<img loading="lazy" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>">
76 76
 					<?php
77
-				}
78
-			}
79
-			?>
77
+                    }
78
+               }
79
+               ?>
80 80
 
81 81
 				<?php if ( ( ! empty( $exercise_type ) ) || ( ! empty( $equipment ) ) || ( ! empty( $muscle_group ) ) ) { ?>
82 82
 					<div class="exercise-data">
@@ -89,12 +89,12 @@  discard block
 block discarded – undo
89 89
 				<?php echo do_shortcode( '[lsx_health_plan_featured_tips_block]' ); ?>
90 90
 				<div  class="back-plan-btn">
91 91
 				<?php
92
-				if ( function_exists( 'wc_get_page_id' ) ) {
93
-					?>
92
+                    if ( function_exists( 'wc_get_page_id' ) ) {
93
+                         ?>
94 94
 					<a class="btn" href="<?php echo wp_kses_post( get_permalink( wc_get_page_id( 'myaccount' ) ) ); ?>"><?php esc_html_e( 'Back to my plans', 'lsx-health-plan' ); ?></a>
95 95
 					<?php
96
-				}
97
-				?>
96
+                    }
97
+                    ?>
98 98
 				</div>
99 99
 			</div>
100 100
 		</div>
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
 <?php
108 108
 if ( ! empty( $connected_articles ) ) {
109
-	lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) );
109
+     lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) );
110 110
 }
111 111
 ?>
112 112
 
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
 $muscle_group  = lsx_health_plan_muscle_group_equipment();
11 11
 
12 12
 // Getting translated endpoint.
13
-$exercise = \lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' );
13
+$exercise = \lsx_health_plan\functions\get_option('endpoint_exercise_single', 'exercise');
14 14
 
15
-$connected_members  = get_post_meta( get_the_ID(), ( $exercise . '_connected_team_member' ), true );
16
-$connected_articles = get_post_meta( get_the_ID(), ( $exercise . '_connected_articles' ), true );
15
+$connected_members  = get_post_meta(get_the_ID(), ($exercise . '_connected_team_member'), true);
16
+$connected_articles = get_post_meta(get_the_ID(), ($exercise . '_connected_articles'), true);
17 17
 
18 18
 $sharing = 'sharing-disabled';
19
-if ( class_exists( 'LSX_Sharing' ) || ( function_exists( 'sharing_display' ) || class_exists( 'Jetpack_Likes' ) ) ) :
19
+if (class_exists('LSX_Sharing') || (function_exists('sharing_display') || class_exists('Jetpack_Likes'))) :
20 20
 	$sharing = 'sharing-enabled';
21 21
 endif;
22 22
 
@@ -34,51 +34,51 @@  discard block
 block discarded – undo
34 34
 
35 35
 	<div id="single-exercise" class="entry-content">
36 36
 
37
-		<div class="exercise-title-section title-lined <?php echo esc_html( $sharing ); ?>">
38
-			<?php if ( class_exists( 'LSX_Sharing' ) || ( function_exists( 'sharing_display' ) || class_exists( 'Jetpack_Likes' ) ) ) : ?>
37
+		<div class="exercise-title-section title-lined <?php echo esc_html($sharing); ?>">
38
+			<?php if (class_exists('LSX_Sharing') || (function_exists('sharing_display') || class_exists('Jetpack_Likes'))) : ?>
39 39
 
40 40
 					<?php
41
-					if ( class_exists( 'LSX_Sharing' ) ) {
41
+					if (class_exists('LSX_Sharing')) {
42 42
 						lsx_content_sharing();
43 43
 					} else {
44
-						if ( function_exists( 'sharing_display' ) ) {
45
-							sharing_display( '', true );
44
+						if (function_exists('sharing_display')) {
45
+							sharing_display('', true);
46 46
 						}
47 47
 
48
-						if ( class_exists( 'Jetpack_Likes' ) ) {
48
+						if (class_exists('Jetpack_Likes')) {
49 49
 							$custom_likes = new Jetpack_Likes();
50
-							echo wp_kses_post( $custom_likes->post_likes( '' ) );
50
+							echo wp_kses_post($custom_likes->post_likes(''));
51 51
 						}
52 52
 					}
53 53
 					?>
54 54
 			<?php endif ?>
55 55
 
56
-			<?php lsx_health_plan_exercise_title( '<h2>', '</h2>', false ); ?>
56
+			<?php lsx_health_plan_exercise_title('<h2>', '</h2>', false); ?>
57 57
 		</div>
58
-		<?php echo wp_kses_post( lsx_hp_member_connected( $connected_members, 'exercise' ) ); ?>
58
+		<?php echo wp_kses_post(lsx_hp_member_connected($connected_members, 'exercise')); ?>
59 59
 		<div class="row">
60 60
 			<div class="col-md-6 exercise-image lsx-hp-shadow">
61 61
 
62 62
 			<?php
63 63
 			$lsx_hp = lsx_health_plan();
64 64
 
65
-			if ( $lsx_hp->frontend->gallery->has_gallery( get_the_ID() ) ) {
65
+			if ($lsx_hp->frontend->gallery->has_gallery(get_the_ID())) {
66 66
 				lsx_health_plan_gallery();
67 67
 			} else {
68 68
 				$featured_image = get_the_post_thumbnail();
69
-				if ( ! empty( $featured_image ) && '' !== $featured_image ) {
70
-					the_post_thumbnail( 'large', array(
69
+				if ( ! empty($featured_image) && '' !== $featured_image) {
70
+					the_post_thumbnail('large', array(
71 71
 						'class' => 'aligncenter',
72
-					) );
72
+					));
73 73
 				} else {
74 74
 					?>
75
-					<img loading="lazy" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>">
75
+					<img loading="lazy" src="<?php echo esc_attr(plugin_dir_url(__FILE__) . '../assets/images/placeholder.jpg'); ?>">
76 76
 					<?php
77 77
 				}
78 78
 			}
79 79
 			?>
80 80
 
81
-				<?php if ( ( ! empty( $exercise_type ) ) || ( ! empty( $equipment ) ) || ( ! empty( $muscle_group ) ) ) { ?>
81
+				<?php if (( ! empty($exercise_type)) || ( ! empty($equipment)) || ( ! empty($muscle_group))) { ?>
82 82
 					<div class="exercise-data">
83 83
 						<?php lsx_health_plan_exercise_data(); ?>
84 84
 					</div>
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
 			</div>
87 87
 			<div class="col-md-6 exercise-content">
88 88
 				<?php the_content(); ?>
89
-				<?php echo do_shortcode( '[lsx_health_plan_featured_tips_block]' ); ?>
89
+				<?php echo do_shortcode('[lsx_health_plan_featured_tips_block]'); ?>
90 90
 				<div  class="back-plan-btn">
91 91
 				<?php
92
-				if ( function_exists( 'wc_get_page_id' ) ) {
92
+				if (function_exists('wc_get_page_id')) {
93 93
 					?>
94
-					<a class="btn" href="<?php echo wp_kses_post( get_permalink( wc_get_page_id( 'myaccount' ) ) ); ?>"><?php esc_html_e( 'Back to my plans', 'lsx-health-plan' ); ?></a>
94
+					<a class="btn" href="<?php echo wp_kses_post(get_permalink(wc_get_page_id('myaccount'))); ?>"><?php esc_html_e('Back to my plans', 'lsx-health-plan'); ?></a>
95 95
 					<?php
96 96
 				}
97 97
 				?>
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
 </article><!-- #post-## -->
106 106
 
107 107
 <?php
108
-if ( ! empty( $connected_articles ) ) {
109
-	lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) );
108
+if ( ! empty($connected_articles)) {
109
+	lsx_hp_single_related($connected_articles, __('Related articles', 'lsx-health-plan'));
110 110
 }
111 111
 ?>
112 112
 
Please login to merge, or discard this patch.
templates/partials/workout-list.php 2 patches
Indentation   +95 added lines, -95 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 global $group_name,$shortcode_args;
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
 $link_setting          = \lsx_health_plan\functions\get_option( 'workout_tab_link', 'single' );
14 14
 $content_setting       = \lsx_health_plan\functions\get_option( 'workout_tab_content', '' );
@@ -16,113 +16,113 @@  discard block
 block discarded – undo
16 16
 
17 17
 // Check for shortcode overrides.
18 18
 if ( null !== $shortcode_args ) {
19
-	if ( isset( $shortcode_args['link'] ) ) {
20
-		$link_setting = $shortcode_args['link'];
21
-	}
22
-	if ( isset( $shortcode_args['description'] ) ) {
23
-		$content_setting = $shortcode_args['description'];
24
-	}
25
-	if ( isset( $shortcode_args['modal_content'] ) ) {
26
-		$modal_content_setting = $shortcode_args['modal_content'];
27
-	}
19
+     if ( isset( $shortcode_args['link'] ) ) {
20
+          $link_setting = $shortcode_args['link'];
21
+     }
22
+     if ( isset( $shortcode_args['description'] ) ) {
23
+          $content_setting = $shortcode_args['description'];
24
+     }
25
+     if ( isset( $shortcode_args['modal_content'] ) ) {
26
+          $modal_content_setting = $shortcode_args['modal_content'];
27
+     }
28 28
 }
29 29
 
30 30
 $modal_args = array(
31
-	'modal_content' => $modal_content_setting,
31
+     'modal_content' => $modal_content_setting,
32 32
 );
33 33
 
34 34
 if ( ! empty( $groups ) ) {
35
-	?>
35
+     ?>
36 36
 	<div class="set-list">
37 37
 		<div class="workout-list">
38 38
 			<?php
39
-			foreach ( $groups as $group ) {
39
+               foreach ( $groups as $group ) {
40 40
 
41
-				$connected_exercise = false;
42
-				if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) {
43
-					$connected_exercise = true;
44
-				}
41
+                    $connected_exercise = false;
42
+                    if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) {
43
+                         $connected_exercise = true;
44
+                    }
45 45
 
46
-				if ( ( $connected_exercise ) || ( ( ! $connected_exercise ) && '' !== $group['alt_title'] && isset( $group['alt_title'] ) ) ) {
46
+                    if ( ( $connected_exercise ) || ( ( ! $connected_exercise ) && '' !== $group['alt_title'] && isset( $group['alt_title'] ) ) ) {
47 47
 
48
-					$alt_title = '';
49
-					if ( isset( $group['alt_title'] ) && '' !== $group['alt_title'] ) {
50
-						$alt_title = '<span class="alt-title">' . esc_html( $group['alt_title'] ) . '</span>';
51
-					}
48
+                         $alt_title = '';
49
+                         if ( isset( $group['alt_title'] ) && '' !== $group['alt_title'] ) {
50
+                              $alt_title = '<span class="alt-title">' . esc_html( $group['alt_title'] ) . '</span>';
51
+                         }
52 52
 
53
-					$alt_description = '';
54
-					if ( isset( $group['alt_description'] ) && '' !== $group['alt_description'] ) {
55
-						$alt_description = '<span class="alt-description">' . esc_html( $group['alt_description'] ) . '</span>';
56
-					}
53
+                         $alt_description = '';
54
+                         if ( isset( $group['alt_description'] ) && '' !== $group['alt_description'] ) {
55
+                              $alt_description = '<span class="alt-description">' . esc_html( $group['alt_description'] ) . '</span>';
56
+                         }
57 57
 
58
-					$alt_image = '';
59
-					if ( isset( $group['exercise_alt_thumbnail'] ) && '' !== $group['exercise_alt_thumbnail'] ) {
60
-						$alt_image = $group['exercise_alt_thumbnail'];
61
-					}
58
+                         $alt_image = '';
59
+                         if ( isset( $group['exercise_alt_thumbnail'] ) && '' !== $group['exercise_alt_thumbnail'] ) {
60
+                              $alt_image = $group['exercise_alt_thumbnail'];
61
+                         }
62 62
 
63
-					$reps = '';
64
-					if ( isset( $group['reps'] ) && '' !== $group['reps'] ) {
65
-						$reps = '<span class="reps">' . esc_html( $group['reps'] ) . '</span>';
66
-					}
67
-					// Setup our link and content.
68
-					switch ( $link_setting ) {
69
-						case 'single':
70
-							$link_html  = '';
71
-							$link_close = '';
72
-							if ( $connected_exercise ) {
73
-								$link_html  = '<a href="' . get_permalink( $group['connected_exercises'] ) . '">';
74
-								$link_close = '</a>';
75
-							}
76
-							break;
63
+                         $reps = '';
64
+                         if ( isset( $group['reps'] ) && '' !== $group['reps'] ) {
65
+                              $reps = '<span class="reps">' . esc_html( $group['reps'] ) . '</span>';
66
+                         }
67
+                         // Setup our link and content.
68
+                         switch ( $link_setting ) {
69
+                              case 'single':
70
+                                   $link_html  = '';
71
+                                   $link_close = '';
72
+                                   if ( $connected_exercise ) {
73
+                                        $link_html  = '<a href="' . get_permalink( $group['connected_exercises'] ) . '">';
74
+                                        $link_close = '</a>';
75
+                                   }
76
+                                   break;
77 77
 
78
-						case 'modal':
79
-							$link_html  = '';
80
-							$link_close = '';
81
-							if ( $connected_exercise ) {
82
-								if ( ( '' !== $alt_title ) || ( '' !== $alt_description ) || ( '' !== $alt_image ) ) {
83
-									$link_html  = '<a class="alt-modal" data-toggle="modal" href="#workout-alt-exercise-modal-' . $group['connected_exercises'] . '">';
84
-									$link_close = '</a>';
85
-									// We call the button to register the alt modal, but we do not output it.
86
-									lsx_health_plan_workout_exercise_alt_button( $group['connected_exercises'], $group, false, $modal_args, $alt_title, $alt_description, $alt_image );
87
-								} else {
88
-									$link_html  = '<a data-toggle="modal" href="#workout-exercise-modal-' . $group['connected_exercises'] . '">';
89
-									$link_close = '</a>';
90
-									// We call the button to register the modal, but we do not output it.
91
-									lsx_health_plan_workout_exercise_button( $group['connected_exercises'], $group, false, $modal_args );
92
-								}
93
-							}
94
-							break;
78
+                              case 'modal':
79
+                                   $link_html  = '';
80
+                                   $link_close = '';
81
+                                   if ( $connected_exercise ) {
82
+                                        if ( ( '' !== $alt_title ) || ( '' !== $alt_description ) || ( '' !== $alt_image ) ) {
83
+                                             $link_html  = '<a class="alt-modal" data-toggle="modal" href="#workout-alt-exercise-modal-' . $group['connected_exercises'] . '">';
84
+                                             $link_close = '</a>';
85
+                                             // We call the button to register the alt modal, but we do not output it.
86
+                                             lsx_health_plan_workout_exercise_alt_button( $group['connected_exercises'], $group, false, $modal_args, $alt_title, $alt_description, $alt_image );
87
+                                        } else {
88
+                                             $link_html  = '<a data-toggle="modal" href="#workout-exercise-modal-' . $group['connected_exercises'] . '">';
89
+                                             $link_close = '</a>';
90
+                                             // We call the button to register the modal, but we do not output it.
91
+                                             lsx_health_plan_workout_exercise_button( $group['connected_exercises'], $group, false, $modal_args );
92
+                                        }
93
+                                   }
94
+                                   break;
95 95
 
96
-						case 'none':
97
-						default:
98
-							$link_html  = '';
99
-							$link_close = '';
100
-							break;
101
-					}
102
-					?>
96
+                              case 'none':
97
+                              default:
98
+                                   $link_html  = '';
99
+                                   $link_close = '';
100
+                                   break;
101
+                         }
102
+                         ?>
103 103
 					<article class="lsx-slot box-shadow">
104 104
 						<div class="row">
105 105
 							<div class="col-sm-6 col-md-2">
106 106
 								<div class="exercise-feature-img">
107 107
 									<?php echo wp_kses_post( $link_html ); ?>
108 108
 										<?php
109
-										// We call the button to register the modal, but we do not output it.
110
-										lsx_health_plan_workout_exercise_button( $group['connected_exercises'], $group, false, $modal_args );
111
-										$thumbnail_args = array(
112
-											'class' => 'aligncenter',
113
-										);
114
-										$featured_image = get_the_post_thumbnail( $group['connected_exercises'], 'medium', $thumbnail_args );
115
-										if ( $alt_image ) {
116
-											$featured_image = '<img alt="thumbnail" loading="lazy" class="aligncenter wp-post-image" src="' . $alt_image . '">';
117
-										}
118
-										if ( ! empty( $featured_image ) && '' !== $featured_image ) {
119
-											echo wp_kses_post( $featured_image );
120
-										} else {
121
-											?>
109
+                                                  // We call the button to register the modal, but we do not output it.
110
+                                                  lsx_health_plan_workout_exercise_button( $group['connected_exercises'], $group, false, $modal_args );
111
+                                                  $thumbnail_args = array(
112
+                                                       'class' => 'aligncenter',
113
+                                                  );
114
+                                                  $featured_image = get_the_post_thumbnail( $group['connected_exercises'], 'medium', $thumbnail_args );
115
+                                                  if ( $alt_image ) {
116
+                                                       $featured_image = '<img alt="thumbnail" loading="lazy" class="aligncenter wp-post-image" src="' . $alt_image . '">';
117
+                                                  }
118
+                                                  if ( ! empty( $featured_image ) && '' !== $featured_image ) {
119
+                                                       echo wp_kses_post( $featured_image );
120
+                                                  } else {
121
+                                                       ?>
122 122
 											<img loading="lazy" src="<?php echo esc_attr( plugin_dir_url( __DIR__ ) . '../assets/images/placeholder.jpg' ); ?>">
123 123
 											<?php
124
-										}
125
-										?>
124
+                                                  }
125
+                                                  ?>
126 126
 									<?php echo wp_kses_post( $link_close ); ?>
127 127
 								</div>
128 128
 							</div>
@@ -131,15 +131,15 @@  discard block
 block discarded – undo
131 131
 									<h3>
132 132
 									<?php echo wp_kses_post( $link_html ); ?>
133 133
 											<?php
134
-											$exercise_title = lsx_health_plan_exercise_title( '', '', false, false, $group['connected_exercises'] );
135
-											if ( '' !== $alt_title ) {
136
-												$exercise_title = $alt_title;
137
-											}
138
-											if ( '' !== $reps ) {
139
-												$exercise_title .= $reps;
140
-											}
141
-											echo wp_kses_post( $exercise_title );
142
-											?>
134
+                                                       $exercise_title = lsx_health_plan_exercise_title( '', '', false, false, $group['connected_exercises'] );
135
+                                                       if ( '' !== $alt_title ) {
136
+                                                            $exercise_title = $alt_title;
137
+                                                       }
138
+                                                       if ( '' !== $reps ) {
139
+                                                            $exercise_title .= $reps;
140
+                                                       }
141
+                                                       echo wp_kses_post( $exercise_title );
142
+                                                       ?>
143 143
 										<?php echo wp_kses_post( $link_close ); ?>
144 144
 									</h3>
145 145
 								</div>
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
 						</div>
153 153
 					</article>
154 154
 					<?php
155
-				}
156
-			}
157
-			?>
155
+                    }
156
+               }
157
+               ?>
158 158
 		</div>
159 159
 	</div>	
160 160
 	<?php
Please login to merge, or discard this patch.
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -5,24 +5,24 @@  discard block
 block discarded – undo
5 5
  * @package lsx-health-plan
6 6
  */
7 7
 
8
-global $group_name,$shortcode_args;
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 );
8
+global $group_name, $shortcode_args;
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
-$link_setting          = \lsx_health_plan\functions\get_option( 'workout_tab_link', 'single' );
14
-$content_setting       = \lsx_health_plan\functions\get_option( 'workout_tab_content', '' );
15
-$modal_content_setting = \lsx_health_plan\functions\get_option( 'workout_tab_modal_content', 'excerpt' );
13
+$link_setting          = \lsx_health_plan\functions\get_option('workout_tab_link', 'single');
14
+$content_setting       = \lsx_health_plan\functions\get_option('workout_tab_content', '');
15
+$modal_content_setting = \lsx_health_plan\functions\get_option('workout_tab_modal_content', 'excerpt');
16 16
 
17 17
 // Check for shortcode overrides.
18
-if ( null !== $shortcode_args ) {
19
-	if ( isset( $shortcode_args['link'] ) ) {
18
+if (null !== $shortcode_args) {
19
+	if (isset($shortcode_args['link'])) {
20 20
 		$link_setting = $shortcode_args['link'];
21 21
 	}
22
-	if ( isset( $shortcode_args['description'] ) ) {
22
+	if (isset($shortcode_args['description'])) {
23 23
 		$content_setting = $shortcode_args['description'];
24 24
 	}
25
-	if ( isset( $shortcode_args['modal_content'] ) ) {
25
+	if (isset($shortcode_args['modal_content'])) {
26 26
 		$modal_content_setting = $shortcode_args['modal_content'];
27 27
 	}
28 28
 }
@@ -31,46 +31,46 @@  discard block
 block discarded – undo
31 31
 	'modal_content' => $modal_content_setting,
32 32
 );
33 33
 
34
-if ( ! empty( $groups ) ) {
34
+if ( ! empty($groups)) {
35 35
 	?>
36 36
 	<div class="set-list">
37 37
 		<div class="workout-list">
38 38
 			<?php
39
-			foreach ( $groups as $group ) {
39
+			foreach ($groups as $group) {
40 40
 
41 41
 				$connected_exercise = false;
42
-				if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) {
42
+				if (isset($group['connected_exercises']) && '' !== $group['connected_exercises']) {
43 43
 					$connected_exercise = true;
44 44
 				}
45 45
 
46
-				if ( ( $connected_exercise ) || ( ( ! $connected_exercise ) && '' !== $group['alt_title'] && isset( $group['alt_title'] ) ) ) {
46
+				if (($connected_exercise) || (( ! $connected_exercise) && '' !== $group['alt_title'] && isset($group['alt_title']))) {
47 47
 
48 48
 					$alt_title = '';
49
-					if ( isset( $group['alt_title'] ) && '' !== $group['alt_title'] ) {
50
-						$alt_title = '<span class="alt-title">' . esc_html( $group['alt_title'] ) . '</span>';
49
+					if (isset($group['alt_title']) && '' !== $group['alt_title']) {
50
+						$alt_title = '<span class="alt-title">' . esc_html($group['alt_title']) . '</span>';
51 51
 					}
52 52
 
53 53
 					$alt_description = '';
54
-					if ( isset( $group['alt_description'] ) && '' !== $group['alt_description'] ) {
55
-						$alt_description = '<span class="alt-description">' . esc_html( $group['alt_description'] ) . '</span>';
54
+					if (isset($group['alt_description']) && '' !== $group['alt_description']) {
55
+						$alt_description = '<span class="alt-description">' . esc_html($group['alt_description']) . '</span>';
56 56
 					}
57 57
 
58 58
 					$alt_image = '';
59
-					if ( isset( $group['exercise_alt_thumbnail'] ) && '' !== $group['exercise_alt_thumbnail'] ) {
59
+					if (isset($group['exercise_alt_thumbnail']) && '' !== $group['exercise_alt_thumbnail']) {
60 60
 						$alt_image = $group['exercise_alt_thumbnail'];
61 61
 					}
62 62
 
63 63
 					$reps = '';
64
-					if ( isset( $group['reps'] ) && '' !== $group['reps'] ) {
65
-						$reps = '<span class="reps">' . esc_html( $group['reps'] ) . '</span>';
64
+					if (isset($group['reps']) && '' !== $group['reps']) {
65
+						$reps = '<span class="reps">' . esc_html($group['reps']) . '</span>';
66 66
 					}
67 67
 					// Setup our link and content.
68
-					switch ( $link_setting ) {
68
+					switch ($link_setting) {
69 69
 						case 'single':
70 70
 							$link_html  = '';
71 71
 							$link_close = '';
72
-							if ( $connected_exercise ) {
73
-								$link_html  = '<a href="' . get_permalink( $group['connected_exercises'] ) . '">';
72
+							if ($connected_exercise) {
73
+								$link_html  = '<a href="' . get_permalink($group['connected_exercises']) . '">';
74 74
 								$link_close = '</a>';
75 75
 							}
76 76
 							break;
@@ -78,17 +78,17 @@  discard block
 block discarded – undo
78 78
 						case 'modal':
79 79
 							$link_html  = '';
80 80
 							$link_close = '';
81
-							if ( $connected_exercise ) {
82
-								if ( ( '' !== $alt_title ) || ( '' !== $alt_description ) || ( '' !== $alt_image ) ) {
81
+							if ($connected_exercise) {
82
+								if (('' !== $alt_title) || ('' !== $alt_description) || ('' !== $alt_image)) {
83 83
 									$link_html  = '<a class="alt-modal" data-toggle="modal" href="#workout-alt-exercise-modal-' . $group['connected_exercises'] . '">';
84 84
 									$link_close = '</a>';
85 85
 									// We call the button to register the alt modal, but we do not output it.
86
-									lsx_health_plan_workout_exercise_alt_button( $group['connected_exercises'], $group, false, $modal_args, $alt_title, $alt_description, $alt_image );
86
+									lsx_health_plan_workout_exercise_alt_button($group['connected_exercises'], $group, false, $modal_args, $alt_title, $alt_description, $alt_image);
87 87
 								} else {
88 88
 									$link_html  = '<a data-toggle="modal" href="#workout-exercise-modal-' . $group['connected_exercises'] . '">';
89 89
 									$link_close = '</a>';
90 90
 									// We call the button to register the modal, but we do not output it.
91
-									lsx_health_plan_workout_exercise_button( $group['connected_exercises'], $group, false, $modal_args );
91
+									lsx_health_plan_workout_exercise_button($group['connected_exercises'], $group, false, $modal_args);
92 92
 								}
93 93
 							}
94 94
 							break;
@@ -104,49 +104,49 @@  discard block
 block discarded – undo
104 104
 						<div class="row">
105 105
 							<div class="col-sm-6 col-md-2">
106 106
 								<div class="exercise-feature-img">
107
-									<?php echo wp_kses_post( $link_html ); ?>
107
+									<?php echo wp_kses_post($link_html); ?>
108 108
 										<?php
109 109
 										// We call the button to register the modal, but we do not output it.
110
-										lsx_health_plan_workout_exercise_button( $group['connected_exercises'], $group, false, $modal_args );
110
+										lsx_health_plan_workout_exercise_button($group['connected_exercises'], $group, false, $modal_args);
111 111
 										$thumbnail_args = array(
112 112
 											'class' => 'aligncenter',
113 113
 										);
114
-										$featured_image = get_the_post_thumbnail( $group['connected_exercises'], 'medium', $thumbnail_args );
115
-										if ( $alt_image ) {
114
+										$featured_image = get_the_post_thumbnail($group['connected_exercises'], 'medium', $thumbnail_args);
115
+										if ($alt_image) {
116 116
 											$featured_image = '<img alt="thumbnail" loading="lazy" class="aligncenter wp-post-image" src="' . $alt_image . '">';
117 117
 										}
118
-										if ( ! empty( $featured_image ) && '' !== $featured_image ) {
119
-											echo wp_kses_post( $featured_image );
118
+										if ( ! empty($featured_image) && '' !== $featured_image) {
119
+											echo wp_kses_post($featured_image);
120 120
 										} else {
121 121
 											?>
122
-											<img loading="lazy" src="<?php echo esc_attr( plugin_dir_url( __DIR__ ) . '../assets/images/placeholder.jpg' ); ?>">
122
+											<img loading="lazy" src="<?php echo esc_attr(plugin_dir_url(__DIR__) . '../assets/images/placeholder.jpg'); ?>">
123 123
 											<?php
124 124
 										}
125 125
 										?>
126
-									<?php echo wp_kses_post( $link_close ); ?>
126
+									<?php echo wp_kses_post($link_close); ?>
127 127
 								</div>
128 128
 							</div>
129 129
 							<div class="col-sm-6 col-md-10">
130 130
 								<div class="title">
131 131
 									<h3>
132
-									<?php echo wp_kses_post( $link_html ); ?>
132
+									<?php echo wp_kses_post($link_html); ?>
133 133
 											<?php
134
-											$exercise_title = lsx_health_plan_exercise_title( '', '', false, false, $group['connected_exercises'] );
135
-											if ( '' !== $alt_title ) {
134
+											$exercise_title = lsx_health_plan_exercise_title('', '', false, false, $group['connected_exercises']);
135
+											if ('' !== $alt_title) {
136 136
 												$exercise_title = $alt_title;
137 137
 											}
138
-											if ( '' !== $reps ) {
138
+											if ('' !== $reps) {
139 139
 												$exercise_title .= $reps;
140 140
 											}
141
-											echo wp_kses_post( $exercise_title );
141
+											echo wp_kses_post($exercise_title);
142 142
 											?>
143
-										<?php echo wp_kses_post( $link_close ); ?>
143
+										<?php echo wp_kses_post($link_close); ?>
144 144
 									</h3>
145 145
 								</div>
146
-								<?php if ( '' !== $link_html ) { ?>
147
-									<?php echo wp_kses_post( str_replace( '<a', '<a class="btn border-btn" ', $link_html ) ); ?>
148
-									<?php esc_html_e( 'How to do it?', 'lsx-health-plan' ); ?>
149
-									<?php echo wp_kses_post( $link_close ); ?>
146
+								<?php if ('' !== $link_html) { ?>
147
+									<?php echo wp_kses_post(str_replace('<a', '<a class="btn border-btn" ', $link_html)); ?>
148
+									<?php esc_html_e('How to do it?', 'lsx-health-plan'); ?>
149
+									<?php echo wp_kses_post($link_close); ?>
150 150
 								<?php } ?>
151 151
 							</div>
152 152
 						</div>
Please login to merge, or discard this patch.