Passed
Branch master (ac4436)
by Ashley
04:38
created
includes/functions.php 1 patch
Spacing   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -16,21 +16,21 @@  discard block
 block discarded – undo
16 16
  * @param boolean $single
17 17
  * @return boolean
18 18
  */
19
-function has_attached_post( $post_id = '', $meta_key = '', $single = true ) {
19
+function has_attached_post($post_id = '', $meta_key = '', $single = true) {
20 20
 	$has_post = false;
21
-	if ( '' === $post_id ) {
21
+	if ('' === $post_id) {
22 22
 		$post_id = get_the_ID();
23 23
 	}
24
-	$items = get_post_meta( $post_id, $meta_key, $single );
25
-	if ( '' !== $items && false !== $items && 0 !== $items ) {
26
-		$items = check_posts_exist( $items );
27
-		if ( ! empty( $items ) ) {
24
+	$items = get_post_meta($post_id, $meta_key, $single);
25
+	if ('' !== $items && false !== $items && 0 !== $items) {
26
+		$items = check_posts_exist($items);
27
+		if ( ! empty($items)) {
28 28
 			$has_post = true;
29 29
 		}
30 30
 	} else {
31 31
 		// Check for defaults.
32
-		$options = get_option( 'all' );
33
-		if ( isset( $options[ $meta_key ] ) && '' !== $options[ $meta_key ] && ! empty( $options[ $meta_key ] ) ) {
32
+		$options = get_option('all');
33
+		if (isset($options[$meta_key]) && '' !== $options[$meta_key] && ! empty($options[$meta_key])) {
34 34
 			$has_post = true;
35 35
 		}
36 36
 	}
@@ -44,17 +44,17 @@  discard block
 block discarded – undo
44 44
  * @param  mixed  $default Optional default value
45 45
  * @return mixed           Option value
46 46
  */
47
-function get_option( $key = '', $default = false ) {
48
-	if ( function_exists( 'cmb2_get_option' ) ) {
49
-		return cmb2_get_option( 'lsx_health_plan_options', $key, $default );
47
+function get_option($key = '', $default = false) {
48
+	if (function_exists('cmb2_get_option')) {
49
+		return cmb2_get_option('lsx_health_plan_options', $key, $default);
50 50
 	}
51 51
 	// Fallback to get_option if CMB2 is not loaded yet.
52
-	$opts = \get_option( 'lsx_health_plan_options', $default );
52
+	$opts = \get_option('lsx_health_plan_options', $default);
53 53
 	$val  = $default;
54
-	if ( 'all' === $key ) {
54
+	if ('all' === $key) {
55 55
 		$val = $opts;
56
-	} elseif ( is_array( $opts ) && array_key_exists( $key, $opts ) && false !== $opts[ $key ] ) {
57
-		$val = $opts[ $key ];
56
+	} elseif (is_array($opts) && array_key_exists($key, $opts) && false !== $opts[$key]) {
57
+		$val = $opts[$key];
58 58
 	}
59 59
 	return $val;
60 60
 }
@@ -66,54 +66,54 @@  discard block
 block discarded – undo
66 66
  * @param  mixed  $default Optional default value
67 67
  * @return mixed           Option value
68 68
  */
69
-function get_downloads( $type = 'all', $post_id = '' ) {
69
+function get_downloads($type = 'all', $post_id = '') {
70 70
 	$lsx_health_plan = \lsx_health_plan();
71 71
 	$post_types      = $lsx_health_plan->get_post_types();
72
-	if ( '' === $post_id ) {
72
+	if ('' === $post_id) {
73 73
 		$post_id = get_the_ID();
74 74
 	}
75 75
 	$downloads = array();
76
-	$options   = get_option( 'all' );
76
+	$options   = get_option('all');
77 77
 
78
-	foreach ( $post_types as $post_type ) {
79
-		if ( 'all' === $type || in_array( $type, $post_types, true ) ) {
78
+	foreach ($post_types as $post_type) {
79
+		if ('all' === $type || in_array($type, $post_types, true)) {
80 80
 
81 81
 			// Get the default downloads for this post type.
82 82
 			$default_downloads = array();
83 83
 			$new_downloads     = array();
84
-			if ( isset( $options[ 'download_' . $post_type ] ) ) {
85
-				if ( is_array( $options[ 'download_' . $post_type ] ) ) {
86
-					$default_downloads = $options[ 'download_' . $post_type ];
84
+			if (isset($options['download_' . $post_type])) {
85
+				if (is_array($options['download_' . $post_type])) {
86
+					$default_downloads = $options['download_' . $post_type];
87 87
 				} else {
88
-					$default_downloads[] = $options[ 'download_' . $post_type ];
88
+					$default_downloads[] = $options['download_' . $post_type];
89 89
 				}
90 90
 			}
91 91
 
92
-			if ( 'page' === $post_type ) {
92
+			if ('page' === $post_type) {
93 93
 				$key = 'plan_warmup';
94 94
 			} else {
95 95
 				$key = 'connected_' . $post_type . 's';
96 96
 			}
97 97
 
98
-			$connected_items = get_post_meta( $post_id, $key, true );
99
-			if ( ! empty( $connected_items ) ) {
100
-				foreach ( $connected_items as $connected_item ) {
101
-					$current_downloads = get_post_meta( $connected_item, 'connected_downloads', true );
102
-					if ( false !== $current_downloads && ! empty( $current_downloads ) ) {
103
-						$new_downloads = array_merge( $new_downloads, $current_downloads );
98
+			$connected_items = get_post_meta($post_id, $key, true);
99
+			if ( ! empty($connected_items)) {
100
+				foreach ($connected_items as $connected_item) {
101
+					$current_downloads = get_post_meta($connected_item, 'connected_downloads', true);
102
+					if (false !== $current_downloads && ! empty($current_downloads)) {
103
+						$new_downloads = array_merge($new_downloads, $current_downloads);
104 104
 					}
105 105
 				}
106 106
 			}
107 107
 
108
-			if ( ! empty( $new_downloads ) ) {
109
-				$downloads = array_merge( $downloads, $new_downloads );
110
-			} elseif ( ! empty( $default_downloads ) ) {
111
-				$downloads = array_merge( $downloads, $default_downloads );
108
+			if ( ! empty($new_downloads)) {
109
+				$downloads = array_merge($downloads, $new_downloads);
110
+			} elseif ( ! empty($default_downloads)) {
111
+				$downloads = array_merge($downloads, $default_downloads);
112 112
 			}
113
-			$downloads = array_unique( $downloads );
113
+			$downloads = array_unique($downloads);
114 114
 		}
115 115
 	}
116
-	$downloads = check_posts_exist( $downloads );
116
+	$downloads = check_posts_exist($downloads);
117 117
 	return $downloads;
118 118
 }
119 119
 
@@ -123,11 +123,11 @@  discard block
 block discarded – undo
123 123
  * @param  string $week    Week name 'week-1'.
124 124
  * @return array           an array of the downloads or empty.
125 125
  */
126
-function get_weekly_downloads( $week = '' ) {
126
+function get_weekly_downloads($week = '') {
127 127
 	$downloads = array();
128
-	if ( '' !== $week ) {
129
-		$saved_downloads = get_transient( 'lsx_hp_weekly_downloads_' . $week );
130
-		if ( false !== $saved_downloads && ! empty( $saved_downloads ) ) {
128
+	if ('' !== $week) {
129
+		$saved_downloads = get_transient('lsx_hp_weekly_downloads_' . $week);
130
+		if (false !== $saved_downloads && ! empty($saved_downloads)) {
131 131
 			$downloads = $saved_downloads;
132 132
 		} else {
133 133
 			$args = array(
@@ -141,17 +141,17 @@  discard block
 block discarded – undo
141 141
 					array(
142 142
 						'taxonomy' => 'dlm_download_category',
143 143
 						'field'    => 'slug',
144
-						'terms'    => array( $week ),
144
+						'terms'    => array($week),
145 145
 					),
146 146
 				),
147 147
 			);
148
-			$download_query = new \WP_Query( $args );
149
-			if ( $download_query->have_posts() ) {
148
+			$download_query = new \WP_Query($args);
149
+			if ($download_query->have_posts()) {
150 150
 				$downloads = $download_query->posts;
151 151
 			}
152 152
 		}
153 153
 	}
154
-	$downloads = check_posts_exist( $downloads );
154
+	$downloads = check_posts_exist($downloads);
155 155
 	return $downloads;
156 156
 }
157 157
 
@@ -161,20 +161,20 @@  discard block
 block discarded – undo
161 161
  * @param array $post_ids
162 162
  * @return void
163 163
  */
164
-function check_posts_exist( $post_ids = array() ) {
164
+function check_posts_exist($post_ids = array()) {
165 165
 	$new_ids = array();
166 166
 	global $wpdb;
167
-	if ( is_array( $post_ids ) && ! empty( $post_ids ) ) {
168
-		$post_ids = "'" . implode( "','", $post_ids ) . "'";
167
+	if (is_array($post_ids) && ! empty($post_ids)) {
168
+		$post_ids = "'" . implode("','", $post_ids) . "'";
169 169
 		$query    = "
170 170
 			SELECT `ID` 
171 171
 			FROM `{$wpdb->posts}`
172 172
 			WHERE `ID` IN ({$post_ids})
173 173
 			AND `post_status` != 'trash'
174 174
 		";
175
-		$results = $wpdb->get_results( $query ); // WPCS: unprepared SQL
176
-		if ( ! empty( $results ) ) {
177
-			$new_ids = wp_list_pluck( $results, 'ID' );
175
+		$results = $wpdb->get_results($query); // WPCS: unprepared SQL
176
+		if ( ! empty($results)) {
177
+			$new_ids = wp_list_pluck($results, 'ID');
178 178
 		}
179 179
 	}
180 180
 	return $new_ids;
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
  * @param string $body
189 189
  * @return void
190 190
  */
191
-function register_modal( $id = '', $title = '', $body = '' ) {
191
+function register_modal($id = '', $title = '', $body = '') {
192 192
 	lsx_health_plan()->frontend->modals->register_modal(
193 193
 		array(
194 194
 			'title' => $title,
@@ -204,36 +204,36 @@  discard block
 block discarded – undo
204 204
  * @param array $args
205 205
  * @return void
206 206
  */
207
-function output_modal( $args = array() ) {
207
+function output_modal($args = array()) {
208 208
 	$defaults = array(
209 209
 		'id'    => '',
210 210
 		'title' => '',
211 211
 		'body'  => '',
212 212
 	);
213
-	$args     = wp_parse_args( $args, $defaults );
213
+	$args = wp_parse_args($args, $defaults);
214 214
 	?>
215 215
 	<!-- Modal -->
216
-	<div class="modal fade lsx-health-plan-modal" id="<?php echo esc_html( $args['id'] ); ?>" tabindex="-1" role="dialog" aria-labelledby="<?php echo esc_html( $args['id'] ); ?>"  aria-hidden="true">
216
+	<div class="modal fade lsx-health-plan-modal" id="<?php echo esc_html($args['id']); ?>" tabindex="-1" role="dialog" aria-labelledby="<?php echo esc_html($args['id']); ?>"  aria-hidden="true">
217 217
 		<div class="modal-dialog" role="document">
218 218
 			<div class="modal-content">
219 219
 			<button type="button" class="close" data-dismiss="modal">&times;</button>			
220 220
 				<div class="modal-header">
221 221
 					<?php
222
-					if ( '' !== $args['title'] ) {
223
-						echo wp_kses_post( '<h2>' . $args['title'] . '</h2>' );
222
+					if ('' !== $args['title']) {
223
+						echo wp_kses_post('<h2>' . $args['title'] . '</h2>');
224 224
 					}
225 225
 					?>
226 226
 				</div>
227 227
 				<div class="modal-body">
228 228
 				<?php
229
-				if ( '' !== $args['body'] ) {
229
+				if ('' !== $args['body']) {
230 230
 					$allowed_html = array(
231 231
 						'iframe' => array(
232 232
 							'data-src'        => array(),
233 233
 							'src'             => array(),
234 234
 							'width'           => array(),
235 235
 							'height'          => array(),
236
-							'frameBorder'     => array( '0' ),
236
+							'frameBorder'     => array('0'),
237 237
 							'class'           => array(),
238 238
 							'allowFullScreen' => array(),
239 239
 							'style'           => array(),
@@ -242,10 +242,10 @@  discard block
 block discarded – undo
242 242
 							'class' => array(),
243 243
 						),
244 244
 					);
245
-					if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) {
246
-						echo wp_kses_post( $args['body'] );
245
+					if (false !== \lsx_health_plan\functions\get_option('exercise_enabled', false)) {
246
+						echo wp_kses_post($args['body']);
247 247
 					} else {
248
-						echo wp_kses( $args['body'], $allowed_html );
248
+						echo wp_kses($args['body'], $allowed_html);
249 249
 					}
250 250
 				}
251 251
 				?>
@@ -263,11 +263,11 @@  discard block
 block discarded – undo
263 263
  * @param [type] $embed
264 264
  * @return void
265 265
  */
266
-function get_video_url( $embed ) {
266
+function get_video_url($embed) {
267 267
 	$url = '';
268
-	if ( false !== stripos( $embed, '<iframe' ) ) {
269
-		preg_match( '/src="([^"]+)"/', $embed, $match );
270
-		if ( is_array( $match ) && isset( $match[1] ) ) {
268
+	if (false !== stripos($embed, '<iframe')) {
269
+		preg_match('/src="([^"]+)"/', $embed, $match);
270
+		if (is_array($match) && isset($match[1])) {
271 271
 			$url = '<iframe data-src="' . $match[1] . '" style="border: 0;" frameBorder="0" class="giphy-embed" allowFullScreen height="300" width="100%"></iframe>';
272 272
 		} else {
273 273
 			$url = $embed;
@@ -285,14 +285,14 @@  discard block
 block discarded – undo
285 285
  * @param array $post_ids
286 286
  * @return boolean
287 287
  */
288
-function is_week_complete( $term_id = false, $post_ids = array() ) {
288
+function is_week_complete($term_id = false, $post_ids = array()) {
289 289
 	$return = false;
290
-	if ( ! empty( $post_ids ) ) {
291
-		foreach ( $post_ids as &$pid ) {
290
+	if ( ! empty($post_ids)) {
291
+		foreach ($post_ids as &$pid) {
292 292
 			$pid = 'day_' . $pid . '_complete';
293 293
 		}
294
-		$days_complete = get_meta_amounts( $post_ids );
295
-		if ( 7 === $days_complete || '7' === $days_complete ) {
294
+		$days_complete = get_meta_amounts($post_ids);
295
+		if (7 === $days_complete || '7' === $days_complete) {
296 296
 			$return = true;
297 297
 		}
298 298
 	}
@@ -306,20 +306,20 @@  discard block
 block discarded – undo
306 306
  * @param string $key
307 307
  * @return void
308 308
  */
309
-function get_meta_amounts( $post_ids = array() ) {
309
+function get_meta_amounts($post_ids = array()) {
310 310
 	global $wpdb;
311 311
 	$amount       = 0;
312 312
 	$current_user = wp_get_current_user();
313
-	if ( false !== $current_user && ! empty( $post_ids ) ) {
314
-		$post_ids = "'" . implode( "','", $post_ids ) . "'";
313
+	if (false !== $current_user && ! empty($post_ids)) {
314
+		$post_ids = "'" . implode("','", $post_ids) . "'";
315 315
 		$query    = "
316 316
 			SELECT COUNT(`meta_value`) 
317 317
 			FROM `{$wpdb->usermeta}`
318 318
 			WHERE `meta_key` IN ({$post_ids})
319 319
 			AND `user_id` = '{$current_user->ID}'
320 320
 		";
321
-		$results  = $wpdb->get_var( $query ); // WPCS: unprepared SQL
322
-		if ( ! empty( $results ) ) {
321
+		$results = $wpdb->get_var($query); // WPCS: unprepared SQL
322
+		if ( ! empty($results)) {
323 323
 			$amount = $results;
324 324
 		}
325 325
 	}
@@ -329,14 +329,14 @@  discard block
 block discarded – undo
329 329
 /**
330 330
  * Limit media library access
331 331
  */
332
-function set_only_author( $wp_query ) {
332
+function set_only_author($wp_query) {
333 333
 	global $current_user;
334
-	if ( is_admin() && ! current_user_can( 'edit_others_posts' ) ) {
335
-		$wp_query->set( 'administrator', $current_user->ID );
336
-		add_filter( 'views_upload', 'fix_media_counts' );
334
+	if (is_admin() && ! current_user_can('edit_others_posts')) {
335
+		$wp_query->set('administrator', $current_user->ID);
336
+		add_filter('views_upload', 'fix_media_counts');
337 337
 	}
338 338
 }
339
-add_action( 'pre_get_posts', '\lsx_health_plan\functions\set_only_author' );
339
+add_action('pre_get_posts', '\lsx_health_plan\functions\set_only_author');
340 340
 
341 341
 /**
342 342
  * Outputs an excerpt even if there is not excerpt.
@@ -344,12 +344,12 @@  discard block
 block discarded – undo
344 344
  * @param [type] $post_id
345 345
  * @return void
346 346
  */
347
-function hp_excerpt( $post_id ) {
348
-	if ( ! has_excerpt( $post_id ) ) {
349
-		$content = wp_trim_words( get_the_content( $post_id ), 20 );
347
+function hp_excerpt($post_id) {
348
+	if ( ! has_excerpt($post_id)) {
349
+		$content = wp_trim_words(get_the_content($post_id), 20);
350 350
 		$content = '<p>' . $content . '</p>';
351 351
 	} else {
352
-		$content = get_the_excerpt( $post_id );
352
+		$content = get_the_excerpt($post_id);
353 353
 	}
354 354
 	return $content;
355 355
 }
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
  * @param string $columns
361 361
  * @return void
362 362
  */
363
-function column_class( $columns = '3' ) {
363
+function column_class($columns = '3') {
364 364
 	$cols .= '5' === $columns ? '15' : 12 / $columns;
365 365
 	return $cols;
366 366
 }
@@ -371,16 +371,16 @@  discard block
 block discarded – undo
371 371
  * @param string $workout
372 372
  * @return void
373 373
  */
374
-function get_exercises_by_workout( $workout = '' ) {
374
+function get_exercises_by_workout($workout = '') {
375 375
 	$exercises = array();
376 376
 	$i               = 1;
377 377
 	$section_counter = 6;
378
-	while ( $i <= $section_counter ) {
378
+	while ($i <= $section_counter) {
379 379
 		$group_name = 'workout_section_' . $i;
380
-		$groups     = get_post_meta( $workout, $group_name, true );
381
-		if ( ! empty( $groups ) ) {
382
-			foreach ( $groups as $group ) {
383
-				if ( isset( $group['connected_exercises'] ) ) {
380
+		$groups     = get_post_meta($workout, $group_name, true);
381
+		if ( ! empty($groups)) {
382
+			foreach ($groups as $group) {
383
+				if (isset($group['connected_exercises'])) {
384 384
 					$exercises[] = $group['connected_exercises'];
385 385
 				}
386 386
 			}
Please login to merge, or discard this patch.
includes/conditionals.php 1 patch
Spacing   +50 added lines, -50 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,14 +24,14 @@  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
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_workouts' );
34
+	return \lsx_health_plan\functions\has_attached_post($post_id, 'connected_workouts');
35 35
 }
36 36
 
37 37
 /**
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
  * @param string $post_id
41 41
  * @return boolean
42 42
  */
43
-function lsx_health_plan_has_meal( $post_id = '' ) {
44
-	if ( ! post_type_exists( 'meal' ) ) {
43
+function lsx_health_plan_has_meal($post_id = '') {
44
+	if ( ! post_type_exists('meal')) {
45 45
 		return false;
46 46
 	}
47
-	if ( '' === $post_id ) {
47
+	if ('' === $post_id) {
48 48
 		$post_id = get_the_ID();
49 49
 	}
50
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_meals' );
50
+	return \lsx_health_plan\functions\has_attached_post($post_id, 'connected_meals');
51 51
 }
52 52
 
53 53
 /**
@@ -56,14 +56,14 @@  discard block
 block discarded – undo
56 56
  * @param string $post_id
57 57
  * @return boolean
58 58
  */
59
-function lsx_health_plan_has_recipe( $post_id = '' ) {
60
-	if ( ! post_type_exists( 'recipe' ) ) {
59
+function lsx_health_plan_has_recipe($post_id = '') {
60
+	if ( ! post_type_exists('recipe')) {
61 61
 		return false;
62 62
 	}
63
-	if ( '' === $post_id ) {
63
+	if ('' === $post_id) {
64 64
 		$post_id = get_the_ID();
65 65
 	}
66
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_recipes' );
66
+	return \lsx_health_plan\functions\has_attached_post($post_id, 'connected_recipes');
67 67
 }
68 68
 
69 69
 /**
@@ -72,13 +72,13 @@  discard block
 block discarded – undo
72 72
  * @param string $post_id
73 73
  * @return boolean
74 74
  */
75
-function lsx_health_plan_has_downloads( $post_id = '' ) {
75
+function lsx_health_plan_has_downloads($post_id = '') {
76 76
 	$has_downloads = false;
77
-	if ( '' === $post_id ) {
77
+	if ('' === $post_id) {
78 78
 		$post_id = get_the_ID();
79 79
 	}
80
-	$downloads = \lsx_health_plan\functions\get_downloads( 'all', $post_id );
81
-	if ( ! empty( $downloads ) ) {
80
+	$downloads = \lsx_health_plan\functions\get_downloads('all', $post_id);
81
+	if ( ! empty($downloads)) {
82 82
 		$has_downloads = true;
83 83
 	}
84 84
 	return $has_downloads;
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
  * @param string $post_id
91 91
  * @return boolean
92 92
  */
93
-function lsx_health_plan_has_tip( $post_id = '' ) {
94
-	if ( ! post_type_exists( 'tip' ) ) {
93
+function lsx_health_plan_has_tip($post_id = '') {
94
+	if ( ! post_type_exists('tip')) {
95 95
 		return false;
96 96
 	}
97
-	if ( '' === $post_id ) {
97
+	if ('' === $post_id) {
98 98
 		$post_id = get_the_ID();
99 99
 	}
100
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_tips' );
100
+	return \lsx_health_plan\functions\has_attached_post($post_id, 'connected_tips');
101 101
 }
102 102
 
103 103
 /**
@@ -106,14 +106,14 @@  discard block
 block discarded – undo
106 106
  * @param string $post_id
107 107
  * @return boolean
108 108
  */
109
-function lsx_health_plan_has_video( $post_id = '' ) {
110
-	if ( ! post_type_exists( 'video' ) ) {
109
+function lsx_health_plan_has_video($post_id = '') {
110
+	if ( ! post_type_exists('video')) {
111 111
 		return false;
112 112
 	}
113
-	if ( '' === $post_id ) {
113
+	if ('' === $post_id) {
114 114
 		$post_id = get_the_ID();
115 115
 	}
116
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_videos' );
116
+	return \lsx_health_plan\functions\has_attached_post($post_id, 'connected_videos');
117 117
 }
118 118
 
119 119
 /**
@@ -123,11 +123,11 @@  discard block
 block discarded – undo
123 123
  */
124 124
 function lsx_health_plan_user_has_purchase() {
125 125
 	$valid_order = false;
126
-	$product_id  = \lsx_health_plan\functions\get_option( 'membership_product', false );
126
+	$product_id  = \lsx_health_plan\functions\get_option('membership_product', false);
127 127
 
128
-	if ( is_user_logged_in() && false !== $product_id ) {
128
+	if (is_user_logged_in() && false !== $product_id) {
129 129
 		$current_user = wp_get_current_user();
130
-		if ( wc_customer_bought_product( $current_user->user_email, $current_user->ID, $product_id ) ) {
130
+		if (wc_customer_bought_product($current_user->user_email, $current_user->ID, $product_id)) {
131 131
 			$valid_order = true;
132 132
 		}
133 133
 	}
@@ -140,15 +140,15 @@  discard block
 block discarded – undo
140 140
  * @param string $post_id
141 141
  * @return boolean
142 142
  */
143
-function lsx_health_plan_is_current_tab( $needle = '' ) {
143
+function lsx_health_plan_is_current_tab($needle = '') {
144 144
 	$is_tab = false;
145
-	$plan_slug = \lsx_health_plan\functions\get_option( 'my_plan_slug', false );
146
-	if ( false === $plan_slug ) {
145
+	$plan_slug = \lsx_health_plan\functions\get_option('my_plan_slug', false);
146
+	if (false === $plan_slug) {
147 147
 		$plan_slug = 'my-plan';
148 148
 	}
149
-	if ( is_singular( 'plan' ) || is_page( $plan_slug ) ) {
150
-		$endpoint = get_query_var( 'endpoint' );
151
-		if ( false !== $endpoint && $needle === $endpoint ) {
149
+	if (is_singular('plan') || is_page($plan_slug)) {
150
+		$endpoint = get_query_var('endpoint');
151
+		if (false !== $endpoint && $needle === $endpoint) {
152 152
 			$is_tab = true;
153 153
 		}
154 154
 	}
@@ -161,14 +161,14 @@  discard block
 block discarded – undo
161 161
  * @param string $post_id
162 162
  * @return boolean
163 163
  */
164
-function lsx_health_plan_is_day_complete( $post_id = '' ) {
164
+function lsx_health_plan_is_day_complete($post_id = '') {
165 165
 	$is_complete = false;
166
-	if ( '' === $post_id ) {
166
+	if ('' === $post_id) {
167 167
 		$post_id = get_the_ID();
168 168
 	}
169
-	if ( is_user_logged_in() ) {
170
-		$is_day_complete = get_user_meta( get_current_user_id(), 'day_' . $post_id . '_complete', true );
171
-		if ( false !== $is_day_complete && '' !== $is_day_complete ) {
169
+	if (is_user_logged_in()) {
170
+		$is_day_complete = get_user_meta(get_current_user_id(), 'day_' . $post_id . '_complete', true);
171
+		if (false !== $is_day_complete && '' !== $is_day_complete) {
172 172
 			$is_complete = true;
173 173
 		}
174 174
 	}
@@ -181,11 +181,11 @@  discard block
 block discarded – undo
181 181
  * @param string $week The week name 'week-1'.
182 182
  * @return boolean
183 183
  */
184
-function lsx_health_plan_week_has_downloads( $week = '' ) {
184
+function lsx_health_plan_week_has_downloads($week = '') {
185 185
 	$has_downloads = false;
186
-	if ( '' !== $week ) {
187
-		$downloads = \lsx_health_plan\functions\get_weekly_downloads( $week );
188
-		if ( ! empty( $downloads ) ) {
186
+	if ('' !== $week) {
187
+		$downloads = \lsx_health_plan\functions\get_weekly_downloads($week);
188
+		if ( ! empty($downloads)) {
189 189
 			$has_downloads = true;
190 190
 		}
191 191
 	}
@@ -198,14 +198,14 @@  discard block
 block discarded – undo
198 198
  * @param string $post_id
199 199
  * @return boolean
200 200
  */
201
-function lsx_health_plan_has_tips( $post_id = '' ) {
201
+function lsx_health_plan_has_tips($post_id = '') {
202 202
 	$has_tips = false;
203
-	if ( '' === $post_id ) {
203
+	if ('' === $post_id) {
204 204
 		$post_id = get_the_ID();
205 205
 	}
206
-	$connected_tips = get_post_meta( get_the_ID(), 'connected_tips', true );
207
-	$connected_tips = \lsx_health_plan\functions\check_posts_exist( $connected_tips );
208
-	if ( ! empty( $connected_tips ) ) {
206
+	$connected_tips = get_post_meta(get_the_ID(), 'connected_tips', true);
207
+	$connected_tips = \lsx_health_plan\functions\check_posts_exist($connected_tips);
208
+	if ( ! empty($connected_tips)) {
209 209
 		$has_tips = true;
210 210
 	}
211 211
 	return $has_tips;
Please login to merge, or discard this patch.
classes/class-frontend.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	 * Contructor
32 32
 	 */
33 33
 	public function __construct() {
34
-		add_action( 'wp_enqueue_scripts', array( $this, 'assets' ), 5 );
34
+		add_action('wp_enqueue_scripts', array($this, 'assets'), 5);
35 35
 
36 36
 		require_once LSX_HEALTH_PLAN_PATH . 'classes/frontend/class-endpoints.php';
37 37
 		$this->endpoints = Endpoints::get_instance();
@@ -42,18 +42,18 @@  discard block
 block discarded – undo
42 42
 		require_once LSX_HEALTH_PLAN_PATH . 'classes/frontend/class-gallery.php';
43 43
 		$this->gallery = frontend\Gallery::get_instance();
44 44
 
45
-		if ( is_admin() ) {
46
-			add_filter( 'lsx_customizer_colour_selectors_body', array( $this, 'customizer_body_colours_handler' ), 15, 2 );
45
+		if (is_admin()) {
46
+			add_filter('lsx_customizer_colour_selectors_body', array($this, 'customizer_body_colours_handler'), 15, 2);
47 47
 		}
48 48
 
49 49
 		// Handle the template redirects.
50
-		add_filter( 'template_include', array( $this, 'archive_template_include' ), 99 );
51
-		add_filter( 'template_include', array( $this, 'single_template_include' ), 99 );
52
-		add_filter( 'template_include', array( $this, 'taxonomy_template_include' ), 99 );
53
-		add_action( 'template_redirect', array( $this, 'redirect' ) );
50
+		add_filter('template_include', array($this, 'archive_template_include'), 99);
51
+		add_filter('template_include', array($this, 'single_template_include'), 99);
52
+		add_filter('template_include', array($this, 'taxonomy_template_include'), 99);
53
+		add_action('template_redirect', array($this, 'redirect'));
54 54
 
55
-		add_action( 'init', array( $this, 'handle_day_action' ), 100 );
56
-		add_filter( 'wp_kses_allowed_html', array( $this, 'wpkses_post_tags' ), 100, 2 );
55
+		add_action('init', array($this, 'handle_day_action'), 100);
56
+		add_filter('wp_kses_allowed_html', array($this, 'wpkses_post_tags'), 100, 2);
57 57
 	}
58 58
 
59 59
 	/**
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	 */
66 66
 	public static function get_instance() {
67 67
 		// If the single instance hasn't been set, set it now.
68
-		if ( null === self::$instance ) {
68
+		if (null === self::$instance) {
69 69
 			self::$instance = new self();
70 70
 		}
71 71
 		return self::$instance;
@@ -77,15 +77,15 @@  discard block
 block discarded – undo
77 77
 	 * @return void
78 78
 	 */
79 79
 	public function assets() {
80
-		wp_enqueue_style( 'lsx-health-plan', LSX_HEALTH_PLAN_URL . 'assets/css/lsx-health-plan.css', array(), LSX_HEALTH_PLAN_VER );
81
-		wp_style_add_data( 'lsx-health-plan', 'rtl', 'replace' );
82
-		wp_enqueue_script( 'lsx-health-plan-scripts', LSX_HEALTH_PLAN_URL . 'assets/js/src/lsx-health-plan-admin.js', array( 'jquery' ) );
80
+		wp_enqueue_style('lsx-health-plan', LSX_HEALTH_PLAN_URL . 'assets/css/lsx-health-plan.css', array(), LSX_HEALTH_PLAN_VER);
81
+		wp_style_add_data('lsx-health-plan', 'rtl', 'replace');
82
+		wp_enqueue_script('lsx-health-plan-scripts', LSX_HEALTH_PLAN_URL . 'assets/js/src/lsx-health-plan-admin.js', array('jquery'));
83 83
 	}
84 84
 
85 85
 	/**
86 86
 	 * Handle body colours that might be change by LSX Customizer.
87 87
 	 */
88
-	public function customizer_body_colours_handler( $css, $colors ) {
88
+	public function customizer_body_colours_handler($css, $colors) {
89 89
 		$css .= '
90 90
 			@import "' . LSX_HEALTH_PLAN_PATH . '/assets/css/scss/partials/customizer-health-plan-body-colours";
91 91
 
@@ -108,11 +108,11 @@  discard block
 block discarded – undo
108 108
 	/**
109 109
 	 * Archive template.
110 110
 	 */
111
-	public function archive_template_include( $template ) {
112
-		$applicable_post_types = apply_filters( 'lsx_health_plan_archive_template', array() );
113
-		if ( ! empty( $applicable_post_types ) && is_main_query() && is_post_type_archive( $applicable_post_types ) ) {
111
+	public function archive_template_include($template) {
112
+		$applicable_post_types = apply_filters('lsx_health_plan_archive_template', array());
113
+		if ( ! empty($applicable_post_types) && is_main_query() && is_post_type_archive($applicable_post_types)) {
114 114
 			$post_type = get_post_type();
115
-			if ( empty( locate_template( array( 'archive-' . $post_type . '.php' ) ) ) && file_exists( LSX_HEALTH_PLAN_PATH . 'templates/archive-' . $post_type . '.php' ) ) {
115
+			if (empty(locate_template(array('archive-' . $post_type . '.php'))) && file_exists(LSX_HEALTH_PLAN_PATH . 'templates/archive-' . $post_type . '.php')) {
116 116
 				$template = LSX_HEALTH_PLAN_PATH . 'templates/archive-' . $post_type . '.php';
117 117
 			}
118 118
 		}
@@ -122,11 +122,11 @@  discard block
 block discarded – undo
122 122
 	/**
123 123
 	 * Single template.
124 124
 	 */
125
-	public function single_template_include( $template ) {
126
-		$applicable_post_types = apply_filters( 'lsx_health_plan_single_template', array() );
127
-		if ( ! empty( $applicable_post_types ) && is_main_query() && is_singular( $applicable_post_types ) ) {
125
+	public function single_template_include($template) {
126
+		$applicable_post_types = apply_filters('lsx_health_plan_single_template', array());
127
+		if ( ! empty($applicable_post_types) && is_main_query() && is_singular($applicable_post_types)) {
128 128
 			$post_type = get_post_type();
129
-			if ( empty( locate_template( array( 'single-' . $post_type . '.php' ) ) ) && file_exists( LSX_HEALTH_PLAN_PATH . 'templates/single-' . $post_type . '.php' ) ) {
129
+			if (empty(locate_template(array('single-' . $post_type . '.php'))) && file_exists(LSX_HEALTH_PLAN_PATH . 'templates/single-' . $post_type . '.php')) {
130 130
 				$template = LSX_HEALTH_PLAN_PATH . 'templates/single-' . $post_type . '.php';
131 131
 			}
132 132
 		}
@@ -139,11 +139,11 @@  discard block
 block discarded – undo
139 139
 	 * @param     $template string
140 140
 	 * @return    string
141 141
 	 */
142
-	public function taxonomy_template_include( $template ) {
143
-		$applicable_taxonomies = apply_filters( 'lsx_health_plan_taxonomies_template', array() );
144
-		if ( is_main_query() && is_tax( $applicable_taxonomies ) ) {
145
-			$current_taxonomy = get_query_var( 'taxonomy' );
146
-			if ( '' === locate_template( array( 'taxonomy-' . $current_taxonomy . '.php' ) ) && file_exists( LSX_HEALTH_PLAN_PATH . 'templates/taxonomy-' . $current_taxonomy . '.php' ) ) {
142
+	public function taxonomy_template_include($template) {
143
+		$applicable_taxonomies = apply_filters('lsx_health_plan_taxonomies_template', array());
144
+		if (is_main_query() && is_tax($applicable_taxonomies)) {
145
+			$current_taxonomy = get_query_var('taxonomy');
146
+			if ('' === locate_template(array('taxonomy-' . $current_taxonomy . '.php')) && file_exists(LSX_HEALTH_PLAN_PATH . 'templates/taxonomy-' . $current_taxonomy . '.php')) {
147 147
 				$template = LSX_HEALTH_PLAN_PATH . 'templates/taxonomy-' . $current_taxonomy . '.php';
148 148
 			}
149 149
 		}
@@ -156,17 +156,17 @@  discard block
 block discarded – undo
156 156
 	 * @return void
157 157
 	 */
158 158
 	public function redirect() {
159
-		if ( ! is_user_logged_in() || ! function_exists( 'wc_get_page_id' ) || is_home() ) {
159
+		if ( ! is_user_logged_in() || ! function_exists('wc_get_page_id') || is_home()) {
160 160
 			return;
161 161
 		}
162
-		if ( lsx_health_plan_user_has_purchase() && ( is_page( wc_get_page_id( 'cart' ) ) || is_page( wc_get_page_id( 'checkout' ) ) ) ) {
163
-			wp_redirect( get_permalink( wc_get_page_id( 'myaccount' ) ) );
162
+		if (lsx_health_plan_user_has_purchase() && (is_page(wc_get_page_id('cart')) || is_page(wc_get_page_id('checkout')))) {
163
+			wp_redirect(get_permalink(wc_get_page_id('myaccount')));
164 164
 			die;
165 165
 		}
166 166
 
167
-		$product_id = \lsx_health_plan\functions\get_option( 'membership_product', false );
168
-		if ( false !== $product_id && is_single( $product_id ) ) {
169
-			wp_redirect( home_url() );
167
+		$product_id = \lsx_health_plan\functions\get_option('membership_product', false);
168
+		if (false !== $product_id && is_single($product_id)) {
169
+			wp_redirect(home_url());
170 170
 			die;
171 171
 		}
172 172
 	}
@@ -175,21 +175,21 @@  discard block
 block discarded – undo
175 175
 	 * Registers the rewrites.
176 176
 	 */
177 177
 	public function handle_day_action() {
178
-		if ( isset( $_POST['lsx-health-plan-actions'] ) && wp_verify_nonce( $_POST['lsx-health-plan-actions'], 'complete' ) ) {
179
-			update_user_meta( get_current_user_id(), 'day_' . sanitize_key( $_POST['lsx-health-plan-id'] ) . '_complete', true );
180
-			wp_safe_redirect( get_permalink( wc_get_page_id( 'myaccount' ) ) );
178
+		if (isset($_POST['lsx-health-plan-actions']) && wp_verify_nonce($_POST['lsx-health-plan-actions'], 'complete')) {
179
+			update_user_meta(get_current_user_id(), 'day_' . sanitize_key($_POST['lsx-health-plan-id']) . '_complete', true);
180
+			wp_safe_redirect(get_permalink(wc_get_page_id('myaccount')));
181 181
 		}
182 182
 
183
-		if ( isset( $_POST['lsx-health-plan-actions'] ) && wp_verify_nonce( $_POST['lsx-health-plan-actions'], 'unlock' ) ) {
184
-			delete_user_meta( get_current_user_id(), 'day_' . sanitize_key( $_POST['lsx-health-plan-id'] ) . '_complete' );
183
+		if (isset($_POST['lsx-health-plan-actions']) && wp_verify_nonce($_POST['lsx-health-plan-actions'], 'unlock')) {
184
+			delete_user_meta(get_current_user_id(), 'day_' . sanitize_key($_POST['lsx-health-plan-id']) . '_complete');
185 185
 		}
186 186
 	}
187 187
 
188 188
 	/**
189 189
 	 * Registers the rewrites.
190 190
 	 */
191
-	public function wpkses_post_tags( $tags, $context ) {
192
-		if ( 'post' === $context ) {
191
+	public function wpkses_post_tags($tags, $context) {
192
+		if ('post' === $context) {
193 193
 			$tags['iframe'] = array(
194 194
 				'src'             => true,
195 195
 				'height'          => true,
Please login to merge, or discard this patch.
classes/class-core.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	public static function get_instance() {
61 61
 
62 62
 		// If the single instance hasn't been set, set it now.
63
-		if ( null === self::$instance ) {
63
+		if (null === self::$instance) {
64 64
 			self::$instance = new self();
65 65
 		}
66 66
 
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
 	 * @return void
108 108
 	 */
109 109
 	public function get_post_types() {
110
-		$post_types = apply_filters( 'lsx_health_plan_post_types', isset( $this->post_types ) );
111
-		foreach ( $post_types as $index => $post_type ) {
112
-			$is_disabled = \cmb2_get_option( 'lsx_health_plan_options', $post_type . '_disabled', false );
113
-			if ( true === $is_disabled || 1 === $is_disabled || 'on' === $is_disabled ) {
114
-				unset( $post_types[ $index ] );
110
+		$post_types = apply_filters('lsx_health_plan_post_types', isset($this->post_types));
111
+		foreach ($post_types as $index => $post_type) {
112
+			$is_disabled = \cmb2_get_option('lsx_health_plan_options', $post_type . '_disabled', false);
113
+			if (true === $is_disabled || 1 === $is_disabled || 'on' === $is_disabled) {
114
+				unset($post_types[$index]);
115 115
 			}
116 116
 		}
117 117
 		return $post_types;
Please login to merge, or discard this patch.
classes/frontend/class-endpoints.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	 * Contructor
22 22
 	 */
23 23
 	public function __construct() {
24
-		add_action( 'init', array( $this, 'setup' ) );
24
+		add_action('init', array($this, 'setup'));
25 25
 	}
26 26
 
27 27
 	/**
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 */
34 34
 	public static function get_instance() {
35 35
 		// If the single instance hasn't been set, set it now.
36
-		if ( null === self::$instance ) {
36
+		if (null === self::$instance) {
37 37
 			self::$instance = new self();
38 38
 		}
39 39
 		return self::$instance;
@@ -51,40 +51,40 @@  discard block
 block discarded – undo
51 51
 	 */
52 52
 	public function add_rewrite_rules() {
53 53
 		// Here is where we add in the rewrite rules above the normal WP ones.
54
-		add_rewrite_tag( '%endpoint%', '([^&]+)' );
54
+		add_rewrite_tag('%endpoint%', '([^&]+)');
55 55
 
56 56
 		// Warm up.
57
-		$warm_up = \lsx_health_plan\functions\get_option( 'endpoint_warm_up', false );
58
-		if ( false === $warm_up ) {
57
+		$warm_up = \lsx_health_plan\functions\get_option('endpoint_warm_up', false);
58
+		if (false === $warm_up) {
59 59
 			$warm_up = 'warm-up';
60 60
 		}
61
-		add_rewrite_rule( 'plan/([^/]+)/' . $warm_up . '/?$', 'index.php?plan=$matches[1]&endpoint=warm-up', 'top' );
61
+		add_rewrite_rule('plan/([^/]+)/' . $warm_up . '/?$', 'index.php?plan=$matches[1]&endpoint=warm-up', 'top');
62 62
 
63 63
 		// Workout.
64
-		if ( post_type_exists( 'workout' ) ) {
65
-			$workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', false );
66
-			if ( false === $workout ) {
64
+		if (post_type_exists('workout')) {
65
+			$workout = \lsx_health_plan\functions\get_option('endpoint_workout', false);
66
+			if (false === $workout) {
67 67
 				$workout = 'workout';
68 68
 			}
69 69
 		}
70
-		add_rewrite_rule( 'plan/([^/]+)/' . $workout . '/?$', 'index.php?plan=$matches[1]&endpoint=workout', 'top' );
70
+		add_rewrite_rule('plan/([^/]+)/' . $workout . '/?$', 'index.php?plan=$matches[1]&endpoint=workout', 'top');
71 71
 
72 72
 		// Meal.
73
-		if ( post_type_exists( 'meal' ) ) {
74
-			$meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', false );
75
-			if ( false === $meal ) {
73
+		if (post_type_exists('meal')) {
74
+			$meal = \lsx_health_plan\functions\get_option('endpoint_meal', false);
75
+			if (false === $meal) {
76 76
 				$meal = 'meal';
77 77
 			}
78 78
 		}
79
-		add_rewrite_rule( 'plan/([^/]+)/' . $meal . '/?$', 'index.php?plan=$matches[1]&endpoint=meal', 'top' );
79
+		add_rewrite_rule('plan/([^/]+)/' . $meal . '/?$', 'index.php?plan=$matches[1]&endpoint=meal', 'top');
80 80
 
81 81
 		// Recipe.
82
-		if ( post_type_exists( 'recipe' ) ) {
83
-			$recipe = \lsx_health_plan\functions\get_option( 'endpoint_recipe', false );
84
-			if ( false === $recipe ) {
82
+		if (post_type_exists('recipe')) {
83
+			$recipe = \lsx_health_plan\functions\get_option('endpoint_recipe', false);
84
+			if (false === $recipe) {
85 85
 				$recipe = 'recipes';
86 86
 			}
87 87
 		}
88
-		add_rewrite_rule( 'plan/([^/]+)/' . $recipe . '/?$', 'index.php?plan=$matches[1]&endpoint=recipes', 'top' );
88
+		add_rewrite_rule('plan/([^/]+)/' . $recipe . '/?$', 'index.php?plan=$matches[1]&endpoint=recipes', 'top');
89 89
 	}
90 90
 }
Please login to merge, or discard this patch.
classes/frontend/class-modals.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 * Contructor
29 29
 	 */
30 30
 	public function __construct() {
31
-		add_action( 'wp_footer', array( $this, 'output_modals' ) );
31
+		add_action('wp_footer', array($this, 'output_modals'));
32 32
 	}
33 33
 
34 34
 	/**
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	public static function get_instance() {
42 42
 		// If the single instance hasn't been set, set it now.
43
-		if ( null === self::$instance ) {
43
+		if (null === self::$instance) {
44 44
 			self::$instance = new self();
45 45
 		}
46 46
 		return self::$instance;
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 	 * @param string $index
54 54
 	 * @return void
55 55
 	 */
56
-	public function register_modal( $modal = array(), $index = '' ) {
57
-		if ( '' !== $index && ! empty( $modal ) ) {
56
+	public function register_modal($modal = array(), $index = '') {
57
+		if ('' !== $index && ! empty($modal)) {
58 58
 			$modal['id'] = $index;
59
-			$this->modals[ $index ] = $modal;
59
+			$this->modals[$index] = $modal;
60 60
 		}
61 61
 	}
62 62
 
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
 	 * Registers the rewrites.
65 65
 	 */
66 66
 	public function output_modals() {
67
-		if ( ! empty( $this->modals ) ) {
68
-			wp_enqueue_script( 'lsx-health-plan-modals', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-modals.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true );
67
+		if ( ! empty($this->modals)) {
68
+			wp_enqueue_script('lsx-health-plan-modals', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-modals.min.js', array('slick'), LSX_HEALTH_PLAN_VER, true);
69 69
 
70
-			foreach ( $this->modals as $index => $modal ) {
71
-				\lsx_health_plan\functions\output_modal( $modal );
70
+			foreach ($this->modals as $index => $modal) {
71
+				\lsx_health_plan\functions\output_modal($modal);
72 72
 			}
73 73
 		}
74 74
 	}
Please login to merge, or discard this patch.
classes/frontend/class-gallery.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 */
80 80
 	public static function get_instance() {
81 81
 		// If the single instance hasn't been set, set it now.
82
-		if ( null === self::$instance ) {
82
+		if (null === self::$instance) {
83 83
 			self::$instance = new self();
84 84
 		}
85 85
 		return self::$instance;
@@ -92,22 +92,22 @@  discard block
 block discarded – undo
92 92
 	 * @param  string $post_type
93 93
 	 * @return boolean
94 94
 	 */
95
-	public function has_gallery( $item_id = '', $post_type = '' ) {
96
-		if ( '' === $item_id ) {
95
+	public function has_gallery($item_id = '', $post_type = '') {
96
+		if ('' === $item_id) {
97 97
 			$this->item_id = get_the_ID();
98 98
 		} else {
99 99
 			$this->item_id = $item_id;
100 100
 		}
101 101
 
102
-		if ( '' === $post_type ) {
103
-			$this->post_type = get_post_type( $this->item_id );
102
+		if ('' === $post_type) {
103
+			$this->post_type = get_post_type($this->item_id);
104 104
 		}
105
-		$gallery = get_post_meta( $this->item_id, $this->post_type . '_gallery', true );
106
-		if ( ! empty( $gallery ) ) {
105
+		$gallery = get_post_meta($this->item_id, $this->post_type . '_gallery', true);
106
+		if ( ! empty($gallery)) {
107 107
 			$this->gallery     = $gallery;
108 108
 			$this->has_gallery = true;
109
-			wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/src/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
110
-			wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/src/lsx-health-plan-slider.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true );
109
+			wp_enqueue_script('slick', LSX_HEALTH_PLAN_URL . 'assets/js/src/slick.min.js', array('jquery'), LSX_HEALTH_PLAN_VER, true);
110
+			wp_enqueue_script('lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/src/lsx-health-plan-slider.js', array('slick'), LSX_HEALTH_PLAN_VER, true);
111 111
 		}
112 112
 		return $this->has_gallery;
113 113
 	}
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
 	 * @param  string $post_type
120 120
 	 * @return array
121 121
 	 */
122
-	public function get_defaults( $item_id = '', $post_type = '' ) {
123
-		if ( '' === $item_id ) {
122
+	public function get_defaults($item_id = '', $post_type = '') {
123
+		if ('' === $item_id) {
124 124
 			$item_id = $this->item_id;
125 125
 		}
126
-		if ( '' === $post_type ) {
126
+		if ('' === $post_type) {
127 127
 			$post_type = $this->post_type;
128 128
 		}
129 129
 		$this->defaults = array(
@@ -132,10 +132,10 @@  discard block
 block discarded – undo
132 132
 			'interval'  => false,
133 133
 			'css_class' => false,
134 134
 		);
135
-		foreach ( $this->defaults as $key => $default ) {
136
-			$override = get_post_meta( $item_id, $this->post_type . '_gallery_' . $key, true );
137
-			if ( '' !== $override && false !== $override && ! empty( $override ) ) {
138
-				$this->defaults[ $key ] = $override;
135
+		foreach ($this->defaults as $key => $default) {
136
+			$override = get_post_meta($item_id, $this->post_type . '_gallery_' . $key, true);
137
+			if ('' !== $override && false !== $override && ! empty($override)) {
138
+				$this->defaults[$key] = $override;
139 139
 			}
140 140
 		}
141 141
 		return $this->defaults;
@@ -148,13 +148,13 @@  discard block
 block discarded – undo
148 148
 	 * @param string $post_type
149 149
 	 * @return void
150 150
 	 */
151
-	public function get_gallery( $item_id = '', $post_type = '', $args = array() ) {
151
+	public function get_gallery($item_id = '', $post_type = '', $args = array()) {
152 152
 		$return     = '';
153 153
 		$this->html = array();
154
-		$this->args = wp_parse_args( $args, $this->get_defaults( $item_id, $post_type ) );
155
-		if ( ! empty( $this->gallery ) ) {
154
+		$this->args = wp_parse_args($args, $this->get_defaults($item_id, $post_type));
155
+		if ( ! empty($this->gallery)) {
156 156
 			$this->args['count'] = 1;
157
-			if ( '' !== $post_type ) {
157
+			if ('' !== $post_type) {
158 158
 				$this->args['post_type'] = $post_type;
159 159
 			} else {
160 160
 				$this->args['post_type'] = $this->post_type;
@@ -163,20 +163,20 @@  discard block
 block discarded – undo
163 163
 			// output the opening boostrap row divs.
164 164
 			$this->before_loop();
165 165
 
166
-			foreach ( $this->gallery as $key => $gallery ) {
166
+			foreach ($this->gallery as $key => $gallery) {
167 167
 
168 168
 				$this->loop_start();
169 169
 
170
-				if ( isset( $gallery['exercise_gallery_image_id'] ) && ! empty( $gallery['exercise_gallery_image_id'] ) ) {
171
-					$this->html[] = '<img alt="' . get_the_title( $gallery['exercise_gallery_image_id'] ) . '" src="' . $gallery['exercise_gallery_image'] . '" />';
172
-				} elseif ( isset( $gallery['exercise_gallery_external'] ) && ! empty( $gallery['exercise_gallery_external'] ) ) {
170
+				if (isset($gallery['exercise_gallery_image_id']) && ! empty($gallery['exercise_gallery_image_id'])) {
171
+					$this->html[] = '<img alt="' . get_the_title($gallery['exercise_gallery_image_id']) . '" src="' . $gallery['exercise_gallery_image'] . '" />';
172
+				} elseif (isset($gallery['exercise_gallery_external']) && ! empty($gallery['exercise_gallery_external'])) {
173 173
 					$this->html[] = $gallery['exercise_gallery_external']; // WPCS: XSS OK.
174
-				} elseif ( isset( $gallery['exercise_gallery_embed'] ) && ! empty( $gallery['exercise_gallery_embed'] ) ) {
174
+				} elseif (isset($gallery['exercise_gallery_embed']) && ! empty($gallery['exercise_gallery_embed'])) {
175 175
 					$embed_args = array(
176 176
 						'width' => '530',
177 177
 					);
178
-					$embed        = wp_oembed_get( $gallery['exercise_gallery_embed'], $embed_args );
179
-					$this->html[] = str_replace( 'width="530"', 'width="100%"', $embed ); // WPCS: XSS OK.
178
+					$embed        = wp_oembed_get($gallery['exercise_gallery_embed'], $embed_args);
179
+					$this->html[] = str_replace('width="530"', 'width="100%"', $embed); // WPCS: XSS OK.
180 180
 				}
181 181
 
182 182
 				$this->loop_end();
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 189
 		}
190 190
 
191 191
 		// Join the html output if its not empty.
192
-		if ( ! empty( $this->html ) ) {
193
-			$return = implode( '', $this->html );
192
+		if ( ! empty($this->html)) {
193
+			$return = implode('', $this->html);
194 194
 		}
195 195
 		return $return;
196 196
 	}
@@ -211,8 +211,8 @@  discard block
 block discarded – undo
211 211
 	 * Runs just after the if and before the while statement in $this->output()
212 212
 	 */
213 213
 	public function before_loop() {
214
-		if ( 'slider' === $this->args['layout'] ) {
215
-			$this->carousel_id = wp_rand( 20, 20000 );
214
+		if ('slider' === $this->args['layout']) {
215
+			$this->carousel_id = wp_rand(20, 20000);
216 216
 			$this->html[]      = "<div class='lsx-hp-widget-items slick-slider slick-dotted slick-has-arrows {$this->args['css_class']} ' data-interval='{$this->args['interval']}' data-slick='{ \"slidesToShow\": {$this->args['columns']}, \"slidesToScroll\": {$this->args['columns']} }'>";
217 217
 		} else {
218 218
 			$this->html[] = "<div class='lsx-hp-widget-items widget-item-grid-layout'>";
@@ -224,10 +224,10 @@  discard block
 block discarded – undo
224 224
 	 */
225 225
 	public function loop_start() {
226 226
 		// Get the call for the active slide.
227
-		if ( 'slider' === $this->args['layout'] ) {
227
+		if ('slider' === $this->args['layout']) {
228 228
 			$this->html[] = "<div class='lsx-hp-widget-item-wrap lsx-{$this->args['post_type']}'>";
229 229
 		} else {
230
-			if ( 1 === $this->args['count'] ) {
230
+			if (1 === $this->args['count']) {
231 231
 				$this->html[] = "<div class='row'>";
232 232
 			}
233 233
 			$this->html[] = '<div class="' . $this->column_class() . '">';
@@ -238,16 +238,16 @@  discard block
 block discarded – undo
238 238
 	 * Runs at the very end of the loop before it runs again.
239 239
 	 */
240 240
 	public function loop_end() {
241
-		if ( 'slider' !== $this->args['layout'] ) {
241
+		if ('slider' !== $this->args['layout']) {
242 242
 			$this->html[] = '</div>';
243 243
 		}
244 244
 		// Close the current slide panel.
245
-		if ( 'slider' === $this->args['layout'] ) {
245
+		if ('slider' === $this->args['layout']) {
246 246
 			$this->html[] = '</div>';
247
-		} elseif ( 0 === $this->args['count'] % $this->args['columns'] || count( $this->gallery ) === $this->args['count'] ) {
247
+		} elseif (0 === $this->args['count'] % $this->args['columns'] || count($this->gallery) === $this->args['count']) {
248 248
 			$this->html[] = '</div>';
249 249
 
250
-			if ( $this->args['count'] < count( $this->gallery ) ) {
250
+			if ($this->args['count'] < count($this->gallery)) {
251 251
 				$this->html[] = "<div class='row'>";
252 252
 			}
253 253
 		}
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 	 */
259 259
 	public function after_loop() {
260 260
 		// Slider output Closing.
261
-		if ( 'slider' === $this->args['layout'] ) {
261
+		if ('slider' === $this->args['layout']) {
262 262
 			$this->html[] = '</div>';
263 263
 		} else {
264 264
 			$this->html[] = '</div>';
Please login to merge, or discard this patch.
classes/post-types/class-meal.php 1 patch
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
 	 * Contructor
31 31
 	 */
32 32
 	public function __construct() {
33
-		add_action( 'init', array( $this, 'register_post_type' ) );
33
+		add_action('init', array($this, 'register_post_type'));
34 34
 
35
-		add_filter( 'lsx_health_plan_single_template', array( $this, 'enable_post_type' ), 10, 1 );
36
-		add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 );
35
+		add_filter('lsx_health_plan_single_template', array($this, 'enable_post_type'), 10, 1);
36
+		add_filter('lsx_health_plan_connections', array($this, 'enable_connections'), 10, 1);
37 37
 
38
-		add_action( 'cmb2_admin_init', array( $this, 'details_metaboxes' ) );
39
-		add_action( 'cmb2_admin_init', array( $this, 'meal_connections' ), 15 );
38
+		add_action('cmb2_admin_init', array($this, 'details_metaboxes'));
39
+		add_action('cmb2_admin_init', array($this, 'meal_connections'), 15);
40 40
 	}
41 41
 
42 42
 	/**
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	 */
49 49
 	public static function get_instance() {
50 50
 		// If the single instance hasn't been set, set it now.
51
-		if ( null === self::$instance ) {
51
+		if (null === self::$instance) {
52 52
 			self::$instance = new self();
53 53
 		}
54 54
 		return self::$instance;
@@ -58,21 +58,21 @@  discard block
 block discarded – undo
58 58
 	 */
59 59
 	public function register_post_type() {
60 60
 		$labels = array(
61
-			'name'               => esc_html__( 'Meals', 'lsx-health-plan' ),
62
-			'singular_name'      => esc_html__( 'Meal', 'lsx-health-plan' ),
63
-			'add_new'            => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ),
64
-			'add_new_item'       => esc_html__( 'Add New', 'lsx-health-plan' ),
65
-			'edit_item'          => esc_html__( 'Edit', 'lsx-health-plan' ),
66
-			'new_item'           => esc_html__( 'New', 'lsx-health-plan' ),
67
-			'all_items'          => esc_html__( 'All', 'lsx-health-plan' ),
68
-			'view_item'          => esc_html__( 'View', 'lsx-health-plan' ),
69
-			'search_items'       => esc_html__( 'Search', 'lsx-health-plan' ),
70
-			'not_found'          => esc_html__( 'None found', 'lsx-health-plan' ),
71
-			'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ),
61
+			'name'               => esc_html__('Meals', 'lsx-health-plan'),
62
+			'singular_name'      => esc_html__('Meal', 'lsx-health-plan'),
63
+			'add_new'            => esc_html_x('Add New', 'post type general name', 'lsx-health-plan'),
64
+			'add_new_item'       => esc_html__('Add New', 'lsx-health-plan'),
65
+			'edit_item'          => esc_html__('Edit', 'lsx-health-plan'),
66
+			'new_item'           => esc_html__('New', 'lsx-health-plan'),
67
+			'all_items'          => esc_html__('All', 'lsx-health-plan'),
68
+			'view_item'          => esc_html__('View', 'lsx-health-plan'),
69
+			'search_items'       => esc_html__('Search', 'lsx-health-plan'),
70
+			'not_found'          => esc_html__('None found', 'lsx-health-plan'),
71
+			'not_found_in_trash' => esc_html__('None found in Trash', 'lsx-health-plan'),
72 72
 			'parent_item_colon'  => '',
73
-			'menu_name'          => esc_html__( 'Meals', 'lsx-health-plan' ),
73
+			'menu_name'          => esc_html__('Meals', 'lsx-health-plan'),
74 74
 		);
75
-		$args   = array(
75
+		$args = array(
76 76
 			'labels'             => $labels,
77 77
 			'public'             => true,
78 78
 			'publicly_queryable' => true,
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 				'title',
91 91
 			),
92 92
 		);
93
-		register_post_type( 'meal', $args );
93
+		register_post_type('meal', $args);
94 94
 	}
95 95
 
96 96
 	/**
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 * @param array $post_types
100 100
 	 * @return array
101 101
 	 */
102
-	public function enable_post_type( $post_types = array() ) {
102
+	public function enable_post_type($post_types = array()) {
103 103
 		$post_types[] = $this->slug;
104 104
 		return $post_types;
105 105
 	}
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 	 * @param array $connections
111 111
 	 * @return void
112 112
 	 */
113
-	public function enable_connections( $connections = array() ) {
113
+	public function enable_connections($connections = array()) {
114 114
 		$connections['meal']['connected_plans'] = 'connected_meals';
115 115
 		$connections['plan']['connected_meals'] = 'connected_plans';
116 116
 		return $connections;
@@ -120,117 +120,117 @@  discard block
 block discarded – undo
120 120
 	 * Define the metabox and field configurations.
121 121
 	 */
122 122
 	public function details_metaboxes() {
123
-		$cmb = new_cmb2_box( array(
123
+		$cmb = new_cmb2_box(array(
124 124
 			'id'           => $this->slug . '_shopping_list_metabox',
125
-			'title'        => __( 'Shopping List', 'lsx-health-plan' ),
126
-			'object_types' => array( $this->slug ), // Post type
125
+			'title'        => __('Shopping List', 'lsx-health-plan'),
126
+			'object_types' => array($this->slug), // Post type
127 127
 			'context'      => 'normal',
128 128
 			'priority'     => 'high',
129 129
 			'show_names'   => true,
130
-		) );
131
-		$cmb->add_field( array(
132
-			'name'       => __( 'Shopping List', 'lsx-health-plan' ),
133
-			'desc'       => __( 'Connect the shopping list page that applies to this meal by entering the name of the page in the field provided.' ),
130
+		));
131
+		$cmb->add_field(array(
132
+			'name'       => __('Shopping List', 'lsx-health-plan'),
133
+			'desc'       => __('Connect the shopping list page that applies to this meal by entering the name of the page in the field provided.'),
134 134
 			'id'         => $this->slug . '_shopping_list',
135 135
 			'type'       => 'post_search_ajax',
136 136
 			// Optional :
137
-			'limit'      => 1,  // Limit selection to X items only (default 1)
137
+			'limit'      => 1, // Limit selection to X items only (default 1)
138 138
 			'sortable'   => true, // Allow selected items to be sortable (default false)
139 139
 			'query_args' => array(
140
-				'post_type'      => array( 'page' ),
141
-				'post_status'    => array( 'publish' ),
140
+				'post_type'      => array('page'),
141
+				'post_status'    => array('publish'),
142 142
 				'posts_per_page' => -1,
143 143
 			),
144
-		) );
145
-		$cmb = new_cmb2_box( array(
144
+		));
145
+		$cmb = new_cmb2_box(array(
146 146
 			'id'           => $this->slug . '_details_metabox',
147
-			'title'        => __( 'Meal Details', 'lsx-health-plan' ),
148
-			'object_types' => array( $this->slug ), // Post type
147
+			'title'        => __('Meal Details', 'lsx-health-plan'),
148
+			'object_types' => array($this->slug), // Post type
149 149
 			'context'      => 'normal',
150 150
 			'priority'     => 'high',
151 151
 			'show_names'   => true,
152
-		) );
153
-		$cmb->add_field( array(
154
-			'name'       => __( 'Pre Breakfast Snack', 'lsx-health-plan' ),
152
+		));
153
+		$cmb->add_field(array(
154
+			'name'       => __('Pre Breakfast Snack', 'lsx-health-plan'),
155 155
 			'id'         => $this->slug . '_pre_breakfast_snack',
156 156
 			'type'       => 'wysiwyg',
157 157
 			'show_on_cb' => 'cmb2_hide_if_no_cats',
158 158
 			'options'    => array(
159 159
 				'textarea_rows' => 5,
160 160
 			),
161
-		) );
162
-		$cmb->add_field( array(
163
-			'name'       => __( 'Breakfast', 'lsx-health-plan' ),
161
+		));
162
+		$cmb->add_field(array(
163
+			'name'       => __('Breakfast', 'lsx-health-plan'),
164 164
 			'id'         => $this->slug . '_breakfast',
165 165
 			'type'       => 'wysiwyg',
166 166
 			'show_on_cb' => 'cmb2_hide_if_no_cats',
167 167
 			'options'    => array(
168 168
 				'textarea_rows' => 5,
169 169
 			),
170
-		) );
171
-		$cmb->add_field( array(
172
-			'name'       => __( 'Post Breakfast Snack', 'lsx-health-plan' ),
170
+		));
171
+		$cmb->add_field(array(
172
+			'name'       => __('Post Breakfast Snack', 'lsx-health-plan'),
173 173
 			'id'         => $this->slug . '_breakfast_snack',
174 174
 			'type'       => 'wysiwyg',
175 175
 			'show_on_cb' => 'cmb2_hide_if_no_cats',
176 176
 			'options'    => array(
177 177
 				'textarea_rows' => 5,
178 178
 			),
179
-		) );
180
-		$cmb->add_field( array(
181
-			'name'       => __( 'Pre Lunch Snack', 'lsx-health-plan' ),
179
+		));
180
+		$cmb->add_field(array(
181
+			'name'       => __('Pre Lunch Snack', 'lsx-health-plan'),
182 182
 			'id'         => $this->slug . '_pre_lunch_snack',
183 183
 			'type'       => 'wysiwyg',
184 184
 			'show_on_cb' => 'cmb2_hide_if_no_cats',
185 185
 			'options'    => array(
186 186
 				'textarea_rows' => 5,
187 187
 			),
188
-		) );
189
-		$cmb->add_field( array(
190
-			'name'       => __( 'Lunch', 'lsx-health-plan' ),
188
+		));
189
+		$cmb->add_field(array(
190
+			'name'       => __('Lunch', 'lsx-health-plan'),
191 191
 			'id'         => $this->slug . '_lunch',
192 192
 			'type'       => 'wysiwyg',
193 193
 			'show_on_cb' => 'cmb2_hide_if_no_cats',
194 194
 			'options'    => array(
195 195
 				'textarea_rows' => 5,
196 196
 			),
197
-		) );
198
-		$cmb->add_field( array(
199
-			'name'       => __( 'Post Lunch Snack', 'lsx-health-plan' ),
197
+		));
198
+		$cmb->add_field(array(
199
+			'name'       => __('Post Lunch Snack', 'lsx-health-plan'),
200 200
 			'id'         => $this->slug . '_lunch_snack',
201 201
 			'type'       => 'wysiwyg',
202 202
 			'show_on_cb' => 'cmb2_hide_if_no_cats',
203 203
 			'options'    => array(
204 204
 				'textarea_rows' => 5,
205 205
 			),
206
-		) );
207
-		$cmb->add_field( array(
208
-			'name'       => __( 'Pre Dinner Snack', 'lsx-health-plan' ),
206
+		));
207
+		$cmb->add_field(array(
208
+			'name'       => __('Pre Dinner Snack', 'lsx-health-plan'),
209 209
 			'id'         => $this->slug . '_pre_dinner_snack',
210 210
 			'type'       => 'wysiwyg',
211 211
 			'show_on_cb' => 'cmb2_hide_if_no_cats',
212 212
 			'options'    => array(
213 213
 				'textarea_rows' => 5,
214 214
 			),
215
-		) );
216
-		$cmb->add_field( array(
217
-			'name'       => __( 'Dinner', 'lsx-health-plan' ),
215
+		));
216
+		$cmb->add_field(array(
217
+			'name'       => __('Dinner', 'lsx-health-plan'),
218 218
 			'id'         => $this->slug . '_dinner',
219 219
 			'type'       => 'wysiwyg',
220 220
 			'show_on_cb' => 'cmb2_hide_if_no_cats',
221 221
 			'options'    => array(
222 222
 				'textarea_rows' => 5,
223 223
 			),
224
-		) );
225
-		$cmb->add_field( array(
226
-			'name'       => __( 'Post Dinner Snack', 'lsx-health-plan' ),
224
+		));
225
+		$cmb->add_field(array(
226
+			'name'       => __('Post Dinner Snack', 'lsx-health-plan'),
227 227
 			'id'         => $this->slug . '_dinner_snack',
228 228
 			'type'       => 'wysiwyg',
229 229
 			'show_on_cb' => 'cmb2_hide_if_no_cats',
230 230
 			'options'    => array(
231 231
 				'textarea_rows' => 5,
232 232
 			),
233
-		) );
233
+		));
234 234
 	}
235 235
 
236 236
 	/**
@@ -239,14 +239,14 @@  discard block
 block discarded – undo
239 239
 	 * @return void
240 240
 	 */
241 241
 	public function meal_connections() {
242
-		$cmb = new_cmb2_box( array(
242
+		$cmb = new_cmb2_box(array(
243 243
 			'id'           => $this->slug . '_meals_connections_metabox',
244
-			'title'        => __( 'Meal Plan', 'lsx-health-plan' ),
245
-			'object_types' => array( 'plan' ), // Post type
244
+			'title'        => __('Meal Plan', 'lsx-health-plan'),
245
+			'object_types' => array('plan'), // Post type
246 246
 			'context'      => 'normal',
247 247
 			'priority'     => 'high',
248 248
 			'show_names'   => true,
249
-		) );
249
+		));
250 250
 		/*$cmb->add_field( array(
251 251
 			'name'       => __( 'Box Description', 'lsx-health-plan' ),
252 252
 			'id'         => $this->slug . '_box_description',
@@ -254,19 +254,19 @@  discard block
 block discarded – undo
254 254
 			'type'       => 'textarea_small',
255 255
 			'show_on_cb' => 'cmb2_hide_if_no_cats',
256 256
 		) );*/
257
-		$cmb->add_field( array(
258
-			'name'       => __( 'Meals', 'lsx-health-plan' ),
259
-			'desc'       => __( 'Connect the meal that applies to this day plan using the field provided.', 'lsx-health-plan' ),
257
+		$cmb->add_field(array(
258
+			'name'       => __('Meals', 'lsx-health-plan'),
259
+			'desc'       => __('Connect the meal that applies to this day plan using the field provided.', 'lsx-health-plan'),
260 260
 			'id'         => 'connected_meals',
261 261
 			'type'       => 'post_search_ajax',
262 262
 			// Optional :
263 263
 			'limit'      => 15, // Limit selection to X items only (default 1)
264 264
 			'sortable'   => true, // Allow selected items to be sortable (default false)
265 265
 			'query_args' => array(
266
-				'post_type'      => array( $this->slug ),
267
-				'post_status'    => array( 'publish' ),
266
+				'post_type'      => array($this->slug),
267
+				'post_status'    => array('publish'),
268 268
 				'posts_per_page' => -1,
269 269
 			),
270
-		) );
270
+		));
271 271
 	}
272 272
 }
Please login to merge, or discard this patch.
classes/post-types/class-exercise.php 1 patch
Spacing   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -30,26 +30,26 @@  discard block
 block discarded – undo
30 30
 	 * Contructor
31 31
 	 */
32 32
 	public function __construct() {
33
-		if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) {
33
+		if (false !== \lsx_health_plan\functions\get_option('exercise_enabled', false)) {
34 34
 			// Post Type and Taxonomies.
35
-			add_action( 'init', array( $this, 'register_post_type' ) );
36
-			add_action( 'init', array( $this, 'exercise_type_taxonomy_setup' ) );
37
-			add_action( 'init', array( $this, 'equipment_taxonomy_setup' ) );
38
-			add_action( 'init', array( $this, 'muscle_group_taxonomy_setup' ) );
39
-			add_action( 'admin_menu', array( $this, 'register_menus' ) );
35
+			add_action('init', array($this, 'register_post_type'));
36
+			add_action('init', array($this, 'exercise_type_taxonomy_setup'));
37
+			add_action('init', array($this, 'equipment_taxonomy_setup'));
38
+			add_action('init', array($this, 'muscle_group_taxonomy_setup'));
39
+			add_action('admin_menu', array($this, 'register_menus'));
40 40
 
41 41
 			// Settings.
42
-			add_action( 'lsx_hp_settings_page', array( $this, 'register_settings' ), 10, 1 );
42
+			add_action('lsx_hp_settings_page', array($this, 'register_settings'), 10, 1);
43 43
 
44 44
 			// Custom Fields.
45
-			add_action( 'cmb2_admin_init', array( $this, 'exercise_details' ), 8 );
46
-			add_action( 'cmb2_admin_init', array( $this, 'gallery_metabox' ), 9 );
47
-			add_action( 'cmb2_admin_init', array( $this, 'tips_metabox' ) );
48
-			add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 );
45
+			add_action('cmb2_admin_init', array($this, 'exercise_details'), 8);
46
+			add_action('cmb2_admin_init', array($this, 'gallery_metabox'), 9);
47
+			add_action('cmb2_admin_init', array($this, 'tips_metabox'));
48
+			add_filter('lsx_health_plan_connections', array($this, 'enable_connections'), 10, 1);
49 49
 
50 50
 			// Template Redirects.
51
-			add_filter( 'lsx_health_plan_archive_template', array( $this, 'enable_post_type' ), 10, 1 );
52
-			add_filter( 'lsx_health_plan_single_template', array( $this, 'enable_post_type' ), 10, 1 );
51
+			add_filter('lsx_health_plan_archive_template', array($this, 'enable_post_type'), 10, 1);
52
+			add_filter('lsx_health_plan_single_template', array($this, 'enable_post_type'), 10, 1);
53 53
 		}
54 54
 	}
55 55
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public static function get_instance() {
64 64
 		// If the single instance hasn't been set, set it now.
65
-		if ( null === self::$instance ) {
65
+		if (null === self::$instance) {
66 66
 			self::$instance = new self();
67 67
 		}
68 68
 		return self::$instance;
@@ -72,21 +72,21 @@  discard block
 block discarded – undo
72 72
 	 */
73 73
 	public function register_post_type() {
74 74
 		$labels = array(
75
-			'name'               => esc_html__( 'Exercise', 'lsx-health-plan' ),
76
-			'singular_name'      => esc_html__( 'Exercises', 'lsx-health-plan' ),
77
-			'add_new'            => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ),
78
-			'add_new_item'       => esc_html__( 'Add New', 'lsx-health-plan' ),
79
-			'edit_item'          => esc_html__( 'Edit', 'lsx-health-plan' ),
80
-			'new_item'           => esc_html__( 'New', 'lsx-health-plan' ),
81
-			'all_items'          => esc_html__( 'All', 'lsx-health-plan' ),
82
-			'view_item'          => esc_html__( 'View', 'lsx-health-plan' ),
83
-			'search_items'       => esc_html__( 'Search', 'lsx-health-plan' ),
84
-			'not_found'          => esc_html__( 'None found', 'lsx-health-plan' ),
85
-			'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ),
75
+			'name'               => esc_html__('Exercise', 'lsx-health-plan'),
76
+			'singular_name'      => esc_html__('Exercises', 'lsx-health-plan'),
77
+			'add_new'            => esc_html_x('Add New', 'post type general name', 'lsx-health-plan'),
78
+			'add_new_item'       => esc_html__('Add New', 'lsx-health-plan'),
79
+			'edit_item'          => esc_html__('Edit', 'lsx-health-plan'),
80
+			'new_item'           => esc_html__('New', 'lsx-health-plan'),
81
+			'all_items'          => esc_html__('All', 'lsx-health-plan'),
82
+			'view_item'          => esc_html__('View', 'lsx-health-plan'),
83
+			'search_items'       => esc_html__('Search', 'lsx-health-plan'),
84
+			'not_found'          => esc_html__('None found', 'lsx-health-plan'),
85
+			'not_found_in_trash' => esc_html__('None found in Trash', 'lsx-health-plan'),
86 86
 			'parent_item_colon'  => '',
87
-			'menu_name'          => esc_html__( 'Exercises', 'lsx-health-plan' ),
87
+			'menu_name'          => esc_html__('Exercises', 'lsx-health-plan'),
88 88
 		);
89
-		$args   = array(
89
+		$args = array(
90 90
 			'labels'             => $labels,
91 91
 			'public'             => true,
92 92
 			'publicly_queryable' => true,
@@ -96,10 +96,10 @@  discard block
 block discarded – undo
96 96
 			'menu_icon'          => 'dashicons-universal-access',
97 97
 			'query_var'          => true,
98 98
 			'rewrite'            => array(
99
-				'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ),
99
+				'slug' => \lsx_health_plan\functions\get_option('endpoint_exercise_single', 'exercise'),
100 100
 			),
101 101
 			'capability_type'    => 'page',
102
-			'has_archive'        => \lsx_health_plan\functions\get_option( 'endpoint_exercise_archive', 'exercises' ),
102
+			'has_archive'        => \lsx_health_plan\functions\get_option('endpoint_exercise_archive', 'exercises'),
103 103
 			'hierarchical'       => false,
104 104
 			'menu_position'      => null,
105 105
 			'supports'           => array(
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 				'excerpt',
110 110
 			),
111 111
 		);
112
-		register_post_type( 'exercise', $args );
112
+		register_post_type('exercise', $args);
113 113
 	}
114 114
 
115 115
 	/**
@@ -119,17 +119,17 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	public function exercise_type_taxonomy_setup() {
121 121
 		$labels = array(
122
-			'name'              => esc_html_x( 'Exercise Type', 'taxonomy general name', 'lsx-health-plan' ),
123
-			'singular_name'     => esc_html_x( 'Exercise Type', 'taxonomy singular name', 'lsx-health-plan' ),
124
-			'search_items'      => esc_html__( 'Search', 'lsx-health-plan' ),
125
-			'all_items'         => esc_html__( 'All', 'lsx-health-plan' ),
126
-			'parent_item'       => esc_html__( 'Parent', 'lsx-health-plan' ),
127
-			'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ),
128
-			'edit_item'         => esc_html__( 'Edit', 'lsx-health-plan' ),
129
-			'update_item'       => esc_html__( 'Update', 'lsx-health-plan' ),
130
-			'add_new_item'      => esc_html__( 'Add New', 'lsx-health-plan' ),
131
-			'new_item_name'     => esc_html__( 'New Name', 'lsx-health-plan' ),
132
-			'menu_name'         => esc_html__( 'Exercise Types', 'lsx-health-plan' ),
122
+			'name'              => esc_html_x('Exercise Type', 'taxonomy general name', 'lsx-health-plan'),
123
+			'singular_name'     => esc_html_x('Exercise Type', 'taxonomy singular name', 'lsx-health-plan'),
124
+			'search_items'      => esc_html__('Search', 'lsx-health-plan'),
125
+			'all_items'         => esc_html__('All', 'lsx-health-plan'),
126
+			'parent_item'       => esc_html__('Parent', 'lsx-health-plan'),
127
+			'parent_item_colon' => esc_html__('Parent:', 'lsx-health-plan'),
128
+			'edit_item'         => esc_html__('Edit', 'lsx-health-plan'),
129
+			'update_item'       => esc_html__('Update', 'lsx-health-plan'),
130
+			'add_new_item'      => esc_html__('Add New', 'lsx-health-plan'),
131
+			'new_item_name'     => esc_html__('New Name', 'lsx-health-plan'),
132
+			'menu_name'         => esc_html__('Exercise Types', 'lsx-health-plan'),
133 133
 		);
134 134
 
135 135
 		$args = array(
@@ -139,12 +139,12 @@  discard block
 block discarded – undo
139 139
 			'show_admin_column' => true,
140 140
 			'query_var'         => true,
141 141
 			'rewrite'           => array(
142
-				'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_type', 'exercise-type' ),
142
+				'slug' => \lsx_health_plan\functions\get_option('endpoint_exercise_type', 'exercise-type'),
143 143
 			),
144 144
 			'show_in_rest'      => true,
145 145
 		);
146 146
 
147
-		register_taxonomy( 'exercise-type', array( 'exercise' ), $args );
147
+		register_taxonomy('exercise-type', array('exercise'), $args);
148 148
 	}
149 149
 
150 150
 	/**
@@ -154,17 +154,17 @@  discard block
 block discarded – undo
154 154
 	 */
155 155
 	public function equipment_taxonomy_setup() {
156 156
 		$labels = array(
157
-			'name'              => esc_html_x( 'Equipment', 'taxonomy general name', 'lsx-health-plan' ),
158
-			'singular_name'     => esc_html_x( 'Equipment', 'taxonomy singular name', 'lsx-health-plan' ),
159
-			'search_items'      => esc_html__( 'Search', 'lsx-health-plan' ),
160
-			'all_items'         => esc_html__( 'All', 'lsx-health-plan' ),
161
-			'parent_item'       => esc_html__( 'Parent', 'lsx-health-plan' ),
162
-			'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ),
163
-			'edit_item'         => esc_html__( 'Edit', 'lsx-health-plan' ),
164
-			'update_item'       => esc_html__( 'Update', 'lsx-health-plan' ),
165
-			'add_new_item'      => esc_html__( 'Add New', 'lsx-health-plan' ),
166
-			'new_item_name'     => esc_html__( 'New Name', 'lsx-health-plan' ),
167
-			'menu_name'         => esc_html__( 'Equipment', 'lsx-health-plan' ),
157
+			'name'              => esc_html_x('Equipment', 'taxonomy general name', 'lsx-health-plan'),
158
+			'singular_name'     => esc_html_x('Equipment', 'taxonomy singular name', 'lsx-health-plan'),
159
+			'search_items'      => esc_html__('Search', 'lsx-health-plan'),
160
+			'all_items'         => esc_html__('All', 'lsx-health-plan'),
161
+			'parent_item'       => esc_html__('Parent', 'lsx-health-plan'),
162
+			'parent_item_colon' => esc_html__('Parent:', 'lsx-health-plan'),
163
+			'edit_item'         => esc_html__('Edit', 'lsx-health-plan'),
164
+			'update_item'       => esc_html__('Update', 'lsx-health-plan'),
165
+			'add_new_item'      => esc_html__('Add New', 'lsx-health-plan'),
166
+			'new_item_name'     => esc_html__('New Name', 'lsx-health-plan'),
167
+			'menu_name'         => esc_html__('Equipment', 'lsx-health-plan'),
168 168
 		);
169 169
 
170 170
 		$args = array(
@@ -174,12 +174,12 @@  discard block
 block discarded – undo
174 174
 			'show_admin_column' => true,
175 175
 			'query_var'         => true,
176 176
 			'rewrite'           => array(
177
-				'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_equipment', 'equipment' ),
177
+				'slug' => \lsx_health_plan\functions\get_option('endpoint_exercise_equipment', 'equipment'),
178 178
 			),
179 179
 			'show_in_rest'      => true,
180 180
 		);
181 181
 
182
-		register_taxonomy( 'equipment', array( 'exercise' ), $args );
182
+		register_taxonomy('equipment', array('exercise'), $args);
183 183
 	}
184 184
 
185 185
 	/**
@@ -189,17 +189,17 @@  discard block
 block discarded – undo
189 189
 	 */
190 190
 	public function muscle_group_taxonomy_setup() {
191 191
 		$labels = array(
192
-			'name'              => esc_html_x( 'Muscle Groups', 'taxonomy general name', 'lsx-health-plan' ),
193
-			'singular_name'     => esc_html_x( 'Muscle Group', 'taxonomy singular name', 'lsx-health-plan' ),
194
-			'search_items'      => esc_html__( 'Search', 'lsx-health-plan' ),
195
-			'all_items'         => esc_html__( 'All', 'lsx-health-plan' ),
196
-			'parent_item'       => esc_html__( 'Parent', 'lsx-health-plan' ),
197
-			'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ),
198
-			'edit_item'         => esc_html__( 'Edit', 'lsx-health-plan' ),
199
-			'update_item'       => esc_html__( 'Update', 'lsx-health-plan' ),
200
-			'add_new_item'      => esc_html__( 'Add New', 'lsx-health-plan' ),
201
-			'new_item_name'     => esc_html__( 'New Name', 'lsx-health-plan' ),
202
-			'menu_name'         => esc_html__( 'Muscle Groups', 'lsx-health-plan' ),
192
+			'name'              => esc_html_x('Muscle Groups', 'taxonomy general name', 'lsx-health-plan'),
193
+			'singular_name'     => esc_html_x('Muscle Group', 'taxonomy singular name', 'lsx-health-plan'),
194
+			'search_items'      => esc_html__('Search', 'lsx-health-plan'),
195
+			'all_items'         => esc_html__('All', 'lsx-health-plan'),
196
+			'parent_item'       => esc_html__('Parent', 'lsx-health-plan'),
197
+			'parent_item_colon' => esc_html__('Parent:', 'lsx-health-plan'),
198
+			'edit_item'         => esc_html__('Edit', 'lsx-health-plan'),
199
+			'update_item'       => esc_html__('Update', 'lsx-health-plan'),
200
+			'add_new_item'      => esc_html__('Add New', 'lsx-health-plan'),
201
+			'new_item_name'     => esc_html__('New Name', 'lsx-health-plan'),
202
+			'menu_name'         => esc_html__('Muscle Groups', 'lsx-health-plan'),
203 203
 		);
204 204
 
205 205
 		$args = array(
@@ -209,12 +209,12 @@  discard block
 block discarded – undo
209 209
 			'show_admin_column' => true,
210 210
 			'query_var'         => true,
211 211
 			'rewrite'           => array(
212
-				'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_muscle_group', 'muscle-group' ),
212
+				'slug' => \lsx_health_plan\functions\get_option('endpoint_exercise_muscle_group', 'muscle-group'),
213 213
 			),
214 214
 			'show_in_rest'      => true,
215 215
 		);
216 216
 
217
-		register_taxonomy( 'muscle-group', array( 'exercise' ), $args );
217
+		register_taxonomy('muscle-group', array('exercise'), $args);
218 218
 	}
219 219
 
220 220
 	/**
@@ -223,10 +223,10 @@  discard block
 block discarded – undo
223 223
 	 * @return void
224 224
 	 */
225 225
 	public function register_menus() {
226
-		add_submenu_page( 'edit.php?post_type=workout', esc_html__( 'Exercises', 'lsx-health-plan' ), esc_html__( 'Exercises', 'lsx-health-plan' ), 'edit_posts', 'edit.php?post_type=exercise' );
227
-		add_submenu_page( 'edit.php?post_type=workout', esc_html__( 'Exercise Types', 'lsx-health-plan' ), esc_html__( 'Exercise Types', 'lsx-health-plan' ), 'edit_posts', 'edit-tags.php?taxonomy=exercise-type&post_type=exercise' );
228
-		add_submenu_page( 'edit.php?post_type=workout', esc_html__( 'Equipment', 'lsx-health-plan' ), esc_html__( 'Equipment', 'lsx-health-plan' ), 'edit_posts', 'edit-tags.php?taxonomy=equipment&post_type=exercise' );
229
-		add_submenu_page( 'edit.php?post_type=workout', esc_html__( 'Muscle Groups', 'lsx-health-plan' ), esc_html__( 'Muscle Groups', 'lsx-health-plan' ), 'edit_posts', 'edit-tags.php?taxonomy=muscle-group&post_type=exercise' );
226
+		add_submenu_page('edit.php?post_type=workout', esc_html__('Exercises', 'lsx-health-plan'), esc_html__('Exercises', 'lsx-health-plan'), 'edit_posts', 'edit.php?post_type=exercise');
227
+		add_submenu_page('edit.php?post_type=workout', esc_html__('Exercise Types', 'lsx-health-plan'), esc_html__('Exercise Types', 'lsx-health-plan'), 'edit_posts', 'edit-tags.php?taxonomy=exercise-type&post_type=exercise');
228
+		add_submenu_page('edit.php?post_type=workout', esc_html__('Equipment', 'lsx-health-plan'), esc_html__('Equipment', 'lsx-health-plan'), 'edit_posts', 'edit-tags.php?taxonomy=equipment&post_type=exercise');
229
+		add_submenu_page('edit.php?post_type=workout', esc_html__('Muscle Groups', 'lsx-health-plan'), esc_html__('Muscle Groups', 'lsx-health-plan'), 'edit_posts', 'edit-tags.php?taxonomy=muscle-group&post_type=exercise');
230 230
 	}
231 231
 
232 232
 	/**
@@ -236,8 +236,8 @@  discard block
 block discarded – undo
236 236
 		$cmb = new_cmb2_box(
237 237
 			array(
238 238
 				'id'           => $this->slug . '_tips_details_metabox',
239
-				'title'        => __( 'Exercise Tips', 'lsx-health-plan' ),
240
-				'object_types' => array( $this->slug ), // Post type
239
+				'title'        => __('Exercise Tips', 'lsx-health-plan'),
240
+				'object_types' => array($this->slug), // Post type
241 241
 				'context'      => 'normal',
242 242
 				'priority'     => 'low',
243 243
 				'show_names'   => true,
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
 				'id'      => $this->slug . '_tips',
251 251
 				'type'    => 'group',
252 252
 				'options' => array(
253
-					'group_title'   => __( 'Tip', 'your-text-domain' ) . ' {#}', // {#} gets replaced by row number
254
-					'add_button'    => __( 'Add another tip', 'your-text-domain' ),
255
-					'remove_button' => __( 'Remove tip', 'your-text-domain' ),
253
+					'group_title'   => __('Tip', 'your-text-domain') . ' {#}', // {#} gets replaced by row number
254
+					'add_button'    => __('Add another tip', 'your-text-domain'),
255
+					'remove_button' => __('Remove tip', 'your-text-domain'),
256 256
 					'sortable'      => true,
257 257
 				),
258 258
 				'classes' => 'lsx-admin-row',
@@ -263,13 +263,13 @@  discard block
 block discarded – undo
263 263
 		$cmb->add_group_field(
264 264
 			$tip_group,
265 265
 			array(
266
-				'name' => __( 'Thumbnail', 'your-text-domain' ),
266
+				'name' => __('Thumbnail', 'your-text-domain'),
267 267
 				'id'   => $this->slug . '_tip_thumbnail',
268 268
 				'type' => 'file',
269 269
 				'text'        => array(
270
-					'add_upload_file_text' => __( 'Add File', 'lsx-health-plan' ),
270
+					'add_upload_file_text' => __('Add File', 'lsx-health-plan'),
271 271
 				),
272
-				'desc'        => __( 'Upload an image 300px x 300px in size.', 'lsx-health-plan' ),
272
+				'desc'        => __('Upload an image 300px x 300px in size.', 'lsx-health-plan'),
273 273
 				'query_args' => array(
274 274
 					'type' => array(
275 275
 						'image/gif',
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 		$cmb->add_group_field(
286 286
 			$tip_group,
287 287
 			array(
288
-				'name'    => __( 'Description', 'your-text-domain' ),
288
+				'name'    => __('Description', 'your-text-domain'),
289 289
 				'id'      => $this->slug . '_tip_content',
290 290
 				'type'    => 'textarea',
291 291
 				'classes' => 'lsx-field-col lsx-field-connect-field lsx-field-col-75',
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 	 * @param array $post_types
300 300
 	 * @return array
301 301
 	 */
302
-	public function enable_post_type( $post_types = array() ) {
302
+	public function enable_post_type($post_types = array()) {
303 303
 		$post_types[] = $this->slug;
304 304
 		return $post_types;
305 305
 	}
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 	 * @param array $connections
311 311
 	 * @return void
312 312
 	 */
313
-	public function enable_connections( $connections = array() ) {
313
+	public function enable_connections($connections = array()) {
314 314
 		$connections['exercise']['connected_workouts'] = 'connected_exercises';
315 315
 		$connections['workout']['connected_exercises'] = 'connected_workouts';
316 316
 		return $connections;
@@ -322,24 +322,24 @@  discard block
 block discarded – undo
322 322
 	 * @param object $cmb new_cmb2_box().
323 323
 	 * @return void
324 324
 	 */
325
-	public function register_settings( $cmb ) {
325
+	public function register_settings($cmb) {
326 326
 		$cmb->add_field(
327 327
 			array(
328 328
 				'id'          => 'exercise_archive_settings_title',
329 329
 				'type'        => 'title',
330
-				'name'        => __( 'Exercises Archive', 'lsx-health-plan' ),
331
-				'description' => __( 'All of the settings relating to the exercises post type archive.', 'lsx-health-plan' ),
330
+				'name'        => __('Exercises Archive', 'lsx-health-plan'),
331
+				'description' => __('All of the settings relating to the exercises post type archive.', 'lsx-health-plan'),
332 332
 			)
333 333
 		);
334 334
 		$cmb->add_field(
335 335
 			array(
336 336
 				'id'          => 'exercise_archive_description',
337 337
 				'type'        => 'wysiwyg',
338
-				'name'        => __( 'Archive Description', 'lsx-health-plan' ),
339
-				'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ),
338
+				'name'        => __('Archive Description', 'lsx-health-plan'),
339
+				'description' => __('This will show up on the post type archive.', 'lsx-health-plan'),
340 340
 			)
341 341
 		);
342
-		do_action( 'lsx_hp_exercise_settings_page', $cmb );
342
+		do_action('lsx_hp_exercise_settings_page', $cmb);
343 343
 		$cmb->add_field(
344 344
 			array(
345 345
 				'id'   => 'settings_exercise_archive_closing',
@@ -355,8 +355,8 @@  discard block
 block discarded – undo
355 355
 		$cmb = new_cmb2_box(
356 356
 			array(
357 357
 				'id'           => $this->slug . '_gallery_details_metabox',
358
-				'title'        => __( 'Exercise Gallery', 'lsx-health-plan' ),
359
-				'object_types' => array( $this->slug ),
358
+				'title'        => __('Exercise Gallery', 'lsx-health-plan'),
359
+				'object_types' => array($this->slug),
360 360
 				'context'      => 'normal',
361 361
 				'priority'     => 'low',
362 362
 				'show_names'   => true,
@@ -365,19 +365,19 @@  discard block
 block discarded – undo
365 365
 
366 366
 		$cmb->add_field(
367 367
 			array(
368
-				'name'    => __( 'Layout', 'lsx-health-plan' ),
368
+				'name'    => __('Layout', 'lsx-health-plan'),
369 369
 				'id'      => $this->slug . '_gallery_layout',
370 370
 				'type'    => 'radio',
371 371
 				'options' => array(
372
-					'slider' => __( 'Slider', 'your-text-domain' ) . ' {#}', // {#} gets replaced by row number
373
-					'grid'   => __( 'Grid', 'your-text-domain' ),
372
+					'slider' => __('Slider', 'your-text-domain') . ' {#}', // {#} gets replaced by row number
373
+					'grid'   => __('Grid', 'your-text-domain'),
374 374
 				),
375 375
 			)
376 376
 		);
377 377
 
378 378
 		$cmb->add_field(
379 379
 			array(
380
-				'name'    => __( 'Grid Columns', 'lsx-health-plan' ),
380
+				'name'    => __('Grid Columns', 'lsx-health-plan'),
381 381
 				'id'      => $this->slug . '_gallery_columns',
382 382
 				'type'    => 'text',
383 383
 				'default' => '3',
@@ -390,9 +390,9 @@  discard block
 block discarded – undo
390 390
 				'id'      => $this->slug . '_gallery',
391 391
 				'type'    => 'group',
392 392
 				'options' => array(
393
-					'group_title'   => __( 'Gallery', 'your-text-domain' ) . ' {#}', // {#} gets replaced by row number
394
-					'add_button'    => __( 'Add Item', 'your-text-domain' ),
395
-					'remove_button' => __( 'Remove Item', 'your-text-domain' ),
393
+					'group_title'   => __('Gallery', 'your-text-domain') . ' {#}', // {#} gets replaced by row number
394
+					'add_button'    => __('Add Item', 'your-text-domain'),
395
+					'remove_button' => __('Remove Item', 'your-text-domain'),
396 396
 					'sortable'      => true,
397 397
 				),
398 398
 				'classes' => 'lsx-admin-row',
@@ -403,13 +403,13 @@  discard block
 block discarded – undo
403 403
 		$cmb->add_group_field(
404 404
 			$gallery_group,
405 405
 			array(
406
-				'name'       => __( 'Image', 'your-text-domain' ),
406
+				'name'       => __('Image', 'your-text-domain'),
407 407
 				'id'         => $this->slug . '_gallery_image',
408 408
 				'type'       => 'file',
409 409
 				'text'       => array(
410
-					'add_upload_file_text' => __( 'Add File', 'lsx-health-plan' ),
410
+					'add_upload_file_text' => __('Add File', 'lsx-health-plan'),
411 411
 				),
412
-				'desc'       => __( 'Upload an image a minimum of 800px x 600px in size.', 'lsx-health-plan' ),
412
+				'desc'       => __('Upload an image a minimum of 800px x 600px in size.', 'lsx-health-plan'),
413 413
 				'query_args' => array(
414 414
 					'type' => array(
415 415
 						'image/gif',
@@ -426,10 +426,10 @@  discard block
 block discarded – undo
426 426
 		$cmb->add_group_field(
427 427
 			$gallery_group,
428 428
 			array(
429
-				'name'         => __( 'oEmbed', 'your-text-domain' ),
429
+				'name'         => __('oEmbed', 'your-text-domain'),
430 430
 				'id'           => $this->slug . '_gallery_embed',
431 431
 				'type'         => 'text',
432
-				'desc'         => __( 'Drop in the embed url for your video from YouTube, Vimeo or DailyMotion, e.g: "https://www.youtube.com/watch?v=9xwazD5SyVg". A full list of supports formats can be found at <a href="https://make.wordpress.org/support/user-manual/content/media/adding-media-to-your-pages-and-posts/embedding-media-from-other-sites/">WordPress</a>', 'lsx-health-plan' ),
432
+				'desc'         => __('Drop in the embed url for your video from YouTube, Vimeo or DailyMotion, e.g: "https://www.youtube.com/watch?v=9xwazD5SyVg". A full list of supports formats can be found at <a href="https://make.wordpress.org/support/user-manual/content/media/adding-media-to-your-pages-and-posts/embedding-media-from-other-sites/">WordPress</a>', 'lsx-health-plan'),
433 433
 				'classes'      => 'lsx-field-col lsx-field-connect-field  lsx-field-col-33',
434 434
 			)
435 435
 		);
@@ -437,10 +437,10 @@  discard block
 block discarded – undo
437 437
 		$cmb->add_group_field(
438 438
 			$gallery_group,
439 439
 			array(
440
-				'name'         => __( 'External Media', 'your-text-domain' ),
440
+				'name'         => __('External Media', 'your-text-domain'),
441 441
 				'id'           => $this->slug . '_gallery_external',
442 442
 				'type'         => 'textarea_code',
443
-				'desc'         => __( 'Drop in the iFrame embed code from Giphy in this field, i.e: &lt;iframe src="https://giphy.com/embed/3o7527Rn1HxXWqgxuo" width="480" height="270" frameborder="0" class="giphy-embed" allowfullscreen&gt;&lt;/iframe&gt;', 'lsx-health-plan' ),
443
+				'desc'         => __('Drop in the iFrame embed code from Giphy in this field, i.e: &lt;iframe src="https://giphy.com/embed/3o7527Rn1HxXWqgxuo" width="480" height="270" frameborder="0" class="giphy-embed" allowfullscreen&gt;&lt;/iframe&gt;', 'lsx-health-plan'),
444 444
 				'classes'      => 'lsx-field-col lsx-field-connect-field  lsx-field-col-33',
445 445
 			)
446 446
 		);
@@ -455,8 +455,8 @@  discard block
 block discarded – undo
455 455
 		$cmb = new_cmb2_box(
456 456
 			array(
457 457
 				'id'           => $this->slug . '_general_details_metabox',
458
-				'title'        => __( 'Details', 'lsx-health-plan' ),
459
-				'object_types' => array( $this->slug ),
458
+				'title'        => __('Details', 'lsx-health-plan'),
459
+				'object_types' => array($this->slug),
460 460
 				'context'      => 'normal',
461 461
 				'priority'     => 'high',
462 462
 				'show_names'   => true,
@@ -465,15 +465,15 @@  discard block
 block discarded – undo
465 465
 
466 466
 		$cmb->add_field(
467 467
 			array(
468
-				'name'    => __( 'Side', 'lsx-health-plan' ),
468
+				'name'    => __('Side', 'lsx-health-plan'),
469 469
 				'id'      => $this->slug . '_side',
470 470
 				'type'    => 'select',
471 471
 				'options' => array(
472
-					''      => __( 'Select', 'your-text-domain' ),
473
-					'left'  => __( 'Left', 'your-text-domain' ),
474
-					'right' => __( 'Right', 'your-text-domain' ),
472
+					''      => __('Select', 'your-text-domain'),
473
+					'left'  => __('Left', 'your-text-domain'),
474
+					'right' => __('Right', 'your-text-domain'),
475 475
 				),
476
-				'desc'    => __( 'Select which side this exercise uses. ', 'lsx-health-plan' ),
476
+				'desc'    => __('Select which side this exercise uses. ', 'lsx-health-plan'),
477 477
 			)
478 478
 		);
479 479
 	}
Please login to merge, or discard this patch.