Passed
Push — master ( 62b89f...cc2aaf )
by Warwick
05:05
created
classes/class-post-type.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -37,20 +37,20 @@  discard block
 block discarded – undo
37 37
 	 */
38 38
 	public function __construct() {
39 39
 		$this->enable_post_types();
40
-		add_filter( 'lsx_health_plan_post_types', array( $this, 'enable_post_types' ) );
41
-		foreach ( $this->post_types as $index => $post_type ) {
42
-			$is_disabled = \lsx_health_plan\functions\get_option( $post_type . '_disabled', false );
40
+		add_filter('lsx_health_plan_post_types', array($this, 'enable_post_types'));
41
+		foreach ($this->post_types as $index => $post_type) {
42
+			$is_disabled = \lsx_health_plan\functions\get_option($post_type . '_disabled', false);
43 43
 			// Check if exercises is enabled, if so disable the videos.
44
-			if ( 'video' === $post_type && false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) {
44
+			if ('video' === $post_type && false !== \lsx_health_plan\functions\get_option('exercise_enabled', false)) {
45 45
 				$is_disabled = true;
46 46
 			}
47 47
 
48
-			if ( true === $is_disabled || 1 === $is_disabled || 'on' === $is_disabled ) {
49
-				unset( $this->post_types[ $index ] );
48
+			if (true === $is_disabled || 1 === $is_disabled || 'on' === $is_disabled) {
49
+				unset($this->post_types[$index]);
50 50
 			} else {
51 51
 				require_once LSX_HEALTH_PLAN_PATH . 'classes/post-types/class-' . $post_type . '.php';
52
-				$classname        = ucwords( $post_type );
53
-				$this->$post_type = call_user_func_array( '\\lsx_health_plan\classes\\' . $classname . '::get_instance', array() );
52
+				$classname        = ucwords($post_type);
53
+				$this->$post_type = call_user_func_array('\\lsx_health_plan\classes\\' . $classname . '::get_instance', array());
54 54
 			}
55 55
 		}
56 56
 	}
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	public static function get_instance() {
66 66
 		// If the single instance hasn't been set, set it now.
67
-		if ( null === self::$instance ) {
67
+		if (null === self::$instance) {
68 68
 			self::$instance = new self();
69 69
 		}
70 70
 		return self::$instance;
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 	 *
76 76
 	 * @return void
77 77
 	 */
78
-	public function enable_post_types( $post_types = array() ) {
79
-		$post_types       = array(
78
+	public function enable_post_types($post_types = array()) {
79
+		$post_types = array(
80 80
 			'plan',
81 81
 			'workout',
82 82
 			'meal',
Please login to merge, or discard this patch.
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -9,83 +9,83 @@
 block discarded – undo
9 9
  */
10 10
 class Post_Type {
11 11
 
12
-	/**
13
-	 * Holds class instance
14
-	 *
15
-	 * @since 1.0.0
16
-	 *
17
-	 * @var      object \lsx_health_plan\classes\Post_Type()
18
-	 */
19
-	protected static $instance = null;
12
+     /**
13
+      * Holds class instance
14
+      *
15
+      * @since 1.0.0
16
+      *
17
+      * @var      object \lsx_health_plan\classes\Post_Type()
18
+      */
19
+     protected static $instance = null;
20 20
 
21
-	/**
22
-	 * The post types available
23
-	 *
24
-	 * @var array
25
-	 */
26
-	public $post_types = array();
21
+     /**
22
+      * The post types available
23
+      *
24
+      * @var array
25
+      */
26
+     public $post_types = array();
27 27
 
28
-	/**
29
-	 * The related post type connections
30
-	 *
31
-	 * @var array
32
-	 */
33
-	public $connections = array();
28
+     /**
29
+      * The related post type connections
30
+      *
31
+      * @var array
32
+      */
33
+     public $connections = array();
34 34
 
35
-	/**
36
-	 * Constructor
37
-	 */
38
-	public function __construct() {
39
-		$this->enable_post_types();
40
-		add_filter( 'lsx_health_plan_post_types', array( $this, 'enable_post_types' ) );
41
-		foreach ( $this->post_types as $index => $post_type ) {
42
-			$is_disabled = \lsx_health_plan\functions\get_option( $post_type . '_disabled', false );
43
-			// Check if exercises is enabled, if so disable the videos.
44
-			if ( 'video' === $post_type && false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) {
45
-				$is_disabled = true;
46
-			}
35
+     /**
36
+      * Constructor
37
+      */
38
+     public function __construct() {
39
+          $this->enable_post_types();
40
+          add_filter( 'lsx_health_plan_post_types', array( $this, 'enable_post_types' ) );
41
+          foreach ( $this->post_types as $index => $post_type ) {
42
+               $is_disabled = \lsx_health_plan\functions\get_option( $post_type . '_disabled', false );
43
+               // Check if exercises is enabled, if so disable the videos.
44
+               if ( 'video' === $post_type && false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) {
45
+                    $is_disabled = true;
46
+               }
47 47
 
48
-			if ( true === $is_disabled || 1 === $is_disabled || 'on' === $is_disabled ) {
49
-				unset( $this->post_types[ $index ] );
50
-			} else {
51
-				require_once LSX_HEALTH_PLAN_PATH . 'classes/post-types/class-' . $post_type . '.php';
52
-				$classname        = ucwords( $post_type );
53
-				$this->$post_type = call_user_func_array( '\\lsx_health_plan\classes\\' . $classname . '::get_instance', array() );
54
-			}
55
-		}
56
-	}
48
+               if ( true === $is_disabled || 1 === $is_disabled || 'on' === $is_disabled ) {
49
+                    unset( $this->post_types[ $index ] );
50
+               } else {
51
+                    require_once LSX_HEALTH_PLAN_PATH . 'classes/post-types/class-' . $post_type . '.php';
52
+                    $classname        = ucwords( $post_type );
53
+                    $this->$post_type = call_user_func_array( '\\lsx_health_plan\classes\\' . $classname . '::get_instance', array() );
54
+               }
55
+          }
56
+     }
57 57
 
58
-	/**
59
-	 * Return an instance of this class.
60
-	 *
61
-	 * @since 1.0.0
62
-	 *
63
-	 * @return    object \lsx_health_plan\classes\Post_Type()    A single instance of this class.
64
-	 */
65
-	public static function get_instance() {
66
-		// If the single instance hasn't been set, set it now.
67
-		if ( null === self::$instance ) {
68
-			self::$instance = new self();
69
-		}
70
-		return self::$instance;
71
-	}
58
+     /**
59
+      * Return an instance of this class.
60
+      *
61
+      * @since 1.0.0
62
+      *
63
+      * @return    object \lsx_health_plan\classes\Post_Type()    A single instance of this class.
64
+      */
65
+     public static function get_instance() {
66
+          // If the single instance hasn't been set, set it now.
67
+          if ( null === self::$instance ) {
68
+               self::$instance = new self();
69
+          }
70
+          return self::$instance;
71
+     }
72 72
 
73
-	/**
74
-	 * Enable our post types
75
-	 *
76
-	 * @return void
77
-	 */
78
-	public function enable_post_types( $post_types = array() ) {
79
-		$post_types       = array(
80
-			'plan',
81
-			'workout',
82
-			'meal',
83
-			'recipe',
84
-			'tip',
85
-			'video',
86
-			'exercise',
87
-		);
88
-		$this->post_types = $post_types;
89
-		return $post_types;
90
-	}
73
+     /**
74
+      * Enable our post types
75
+      *
76
+      * @return void
77
+      */
78
+     public function enable_post_types( $post_types = array() ) {
79
+          $post_types       = array(
80
+               'plan',
81
+               'workout',
82
+               'meal',
83
+               'recipe',
84
+               'tip',
85
+               'video',
86
+               'exercise',
87
+          );
88
+          $this->post_types = $post_types;
89
+          return $post_types;
90
+     }
91 91
 }
Please login to merge, or discard this patch.
templates/taxonomy-muscle-group.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
 	$redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id;
15 15
 ?>
16 16
 
17
-	<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>">
17
+	<div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>">
18 18
 
19 19
 		<?php lsx_content_before(); ?>
20 20
 
21 21
 		<!-- Begining restricted content -->
22 22
 		<?php
23
-		if ( current_user_can( 'wc_memberships_view_restricted_post_content', $post_id ) ) {
23
+		if (current_user_can('wc_memberships_view_restricted_post_content', $post_id)) {
24 24
 			?>
25 25
 			<main id="main" role="main">
26 26
 
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 
29 29
 				<div class="post-wrapper exercise-archive-plan archive-plan">
30 30
 					<div class="row">
31
-						<?php if ( have_posts() ) : ?>
31
+						<?php if (have_posts()) : ?>
32 32
 							<?php
33
-							while ( have_posts() ) :
33
+							while (have_posts()) :
34 34
 								the_post();
35 35
 								?>
36 36
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
 						<?php else : ?>
42 42
 
43
-							<?php get_template_part( 'partials/content', 'none' ); ?>
43
+							<?php get_template_part('partials/content', 'none'); ?>
44 44
 
45 45
 						<?php endif; ?>
46 46
 					</div>
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 			<?php
54 54
 		} else {
55
-			wp_redirect( $redirect );
55
+			wp_redirect($redirect);
56 56
 			exit;
57 57
 		}
58 58
 		?>
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 <?php lsx_content_wrap_before(); ?>
11 11
 
12 12
 <?php
13
-	$page_id  = get_the_ID();
14
-	$redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id;
13
+     $page_id  = get_the_ID();
14
+     $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id;
15 15
 ?>
16 16
 
17 17
 	<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>">
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 
21 21
 		<!-- Begining restricted content -->
22 22
 		<?php
23
-		if ( current_user_can( 'wc_memberships_view_restricted_post_content', $post_id ) ) {
24
-			?>
23
+          if ( current_user_can( 'wc_memberships_view_restricted_post_content', $post_id ) ) {
24
+               ?>
25 25
 			<main id="main" role="main">
26 26
 
27 27
 				<?php lsx_content_top(); ?>
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 					<div class="row">
31 31
 						<?php if ( have_posts() ) : ?>
32 32
 							<?php
33
-							while ( have_posts() ) :
34
-								the_post();
35
-								?>
33
+                                   while ( have_posts() ) :
34
+                                        the_post();
35
+                                        ?>
36 36
 
37 37
 								<?php include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-exercise.php'; ?>
38 38
 
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
 			</main><!-- #main -->
52 52
 
53 53
 			<?php
54
-		} else {
55
-			wp_redirect( $redirect );
56
-			exit;
57
-		}
58
-		?>
54
+          } else {
55
+               wp_redirect( $redirect );
56
+               exit;
57
+          }
58
+          ?>
59 59
 
60 60
 <?php lsx_content_after(); ?>
61 61
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,9 +38,12 @@
 block discarded – undo
38 38
 
39 39
 							<?php endwhile; ?>
40 40
 
41
-						<?php else : ?>
41
+						<?php else {
42
+     : ?>
42 43
 
43
-							<?php get_template_part( 'partials/content', 'none' ); ?>
44
+							<?php get_template_part( 'partials/content', 'none' );
45
+}
46
+?>
44 47
 
45 48
 						<?php endif; ?>
46 49
 					</div>
Please login to merge, or discard this patch.
templates/taxonomy-exercise-type.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
 	$redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id;
15 15
 ?>
16 16
 
17
-	<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>">
17
+	<div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>">
18 18
 
19 19
 		<?php lsx_content_before(); ?>
20 20
 
21 21
 		<!-- Begining restricted content -->
22 22
 		<?php
23
-		if ( current_user_can( 'wc_memberships_view_restricted_post_content', $post_id ) ) {
23
+		if (current_user_can('wc_memberships_view_restricted_post_content', $post_id)) {
24 24
 			?>
25 25
 			<main id="main" role="main">
26 26
 
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 
29 29
 				<div class="post-wrapper exercise-archive-plan archive-plan">
30 30
 					<div class="row">
31
-						<?php if ( have_posts() ) : ?>
31
+						<?php if (have_posts()) : ?>
32 32
 							<?php
33
-							while ( have_posts() ) :
33
+							while (have_posts()) :
34 34
 								the_post();
35 35
 								?>
36 36
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
 						<?php else : ?>
42 42
 
43
-							<?php get_template_part( 'partials/content', 'none' ); ?>
43
+							<?php get_template_part('partials/content', 'none'); ?>
44 44
 
45 45
 						<?php endif; ?>
46 46
 					</div>
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 			<?php
54 54
 		} else {
55
-			wp_redirect( $redirect );
55
+			wp_redirect($redirect);
56 56
 			exit;
57 57
 		}
58 58
 		?>
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 <?php lsx_content_wrap_before(); ?>
11 11
 
12 12
 <?php
13
-	$page_id  = get_the_ID();
14
-	$redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id;
13
+     $page_id  = get_the_ID();
14
+     $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id;
15 15
 ?>
16 16
 
17 17
 	<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>">
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 
21 21
 		<!-- Begining restricted content -->
22 22
 		<?php
23
-		if ( current_user_can( 'wc_memberships_view_restricted_post_content', $post_id ) ) {
24
-			?>
23
+          if ( current_user_can( 'wc_memberships_view_restricted_post_content', $post_id ) ) {
24
+               ?>
25 25
 			<main id="main" role="main">
26 26
 
27 27
 				<?php lsx_content_top(); ?>
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 					<div class="row">
31 31
 						<?php if ( have_posts() ) : ?>
32 32
 							<?php
33
-							while ( have_posts() ) :
34
-								the_post();
35
-								?>
33
+                                   while ( have_posts() ) :
34
+                                        the_post();
35
+                                        ?>
36 36
 
37 37
 								<?php include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-exercise.php'; ?>
38 38
 
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
 			</main><!-- #main -->
52 52
 
53 53
 			<?php
54
-		} else {
55
-			wp_redirect( $redirect );
56
-			exit;
57
-		}
58
-		?>
54
+          } else {
55
+               wp_redirect( $redirect );
56
+               exit;
57
+          }
58
+          ?>
59 59
 
60 60
 <?php lsx_content_after(); ?>
61 61
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,9 +38,12 @@
 block discarded – undo
38 38
 
39 39
 							<?php endwhile; ?>
40 40
 
41
-						<?php else : ?>
41
+						<?php else {
42
+     : ?>
42 43
 
43
-							<?php get_template_part( 'partials/content', 'none' ); ?>
44
+							<?php get_template_part( 'partials/content', 'none' );
45
+}
46
+?>
44 47
 
45 48
 						<?php endif; ?>
46 49
 					</div>
Please login to merge, or discard this patch.
templates/single-recipe.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 <?php lsx_content_wrap_before(); ?>
11 11
 
12
-<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>">
12
+<div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>">
13 13
 
14 14
 	<?php lsx_content_before(); ?>
15 15
 
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
 
18 18
 		<?php lsx_content_top(); ?>
19 19
 
20
-		<?php if ( have_posts() ) : ?>
20
+		<?php if (have_posts()) : ?>
21 21
 
22 22
 			<?php
23
-			while ( have_posts() ) :
23
+			while (have_posts()) :
24 24
 				the_post();
25 25
 				?>
26 26
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	<?php lsx_content_after(); ?>
38 38
 
39 39
 	<?php
40
-	if ( is_singular( 'post' ) ) {
40
+	if (is_singular('post')) {
41 41
 		lsx_post_nav();
42 42
 	}
43 43
 	?>
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
 		<?php if ( have_posts() ) : ?>
21 21
 
22 22
 			<?php
23
-			while ( have_posts() ) :
24
-				the_post();
25
-				?>
23
+               while ( have_posts() ) :
24
+                    the_post();
25
+                    ?>
26 26
 
27 27
 				<?php include LSX_HEALTH_PLAN_PATH . '/templates/content-recipe.php'; ?>
28 28
 
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
 	<?php lsx_content_after(); ?>
38 38
 
39 39
 	<?php
40
-	if ( is_singular( 'post' ) ) {
41
-		lsx_post_nav();
42
-	}
43
-	?>
40
+     if ( is_singular( 'post' ) ) {
41
+          lsx_post_nav();
42
+     }
43
+     ?>
44 44
 
45 45
 </div><!-- #primary -->
46 46
 
Please login to merge, or discard this patch.
includes/shortcodes.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@  discard block
 block discarded – undo
14 14
  */
15 15
 function restricted_content() {
16 16
 	$content = '';
17
-	if ( ! is_user_logged_in() ) {
17
+	if ( ! is_user_logged_in()) {
18 18
 		ob_start();
19
-		echo do_shortcode( '[woocommerce_my_account]' );
19
+		echo do_shortcode('[woocommerce_my_account]');
20 20
 		$content = ob_get_clean();
21 21
 	}
22 22
 	return $content;
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
  *
52 52
  * @return void
53 53
  */
54
-function all_plans_box( $args = array() ) {
54
+function all_plans_box($args = array()) {
55 55
 
56 56
 	ob_start();
57 57
 	echo lsx_health_plan_all_plans_block(); // WPCS: XSS OK.
@@ -64,18 +64,18 @@  discard block
 block discarded – undo
64 64
  *
65 65
  * @return void
66 66
  */
67
-function day_plan_box( $args = array() ) {
67
+function day_plan_box($args = array()) {
68 68
 	$defaults = array(
69 69
 		'week_view'      => false,
70 70
 		'show_downloads' => false,
71 71
 		'plan'           => '',
72 72
 	);
73
-	$args     = wp_parse_args( $args, $defaults );
73
+	$args = wp_parse_args($args, $defaults);
74 74
 	ob_start();
75
-	if ( false === $args['week_view'] ) {
76
-		echo lsx_health_plan_day_plan_block( $args ); // WPCS: XSS OK.
75
+	if (false === $args['week_view']) {
76
+		echo lsx_health_plan_day_plan_block($args); // WPCS: XSS OK.
77 77
 	} else {
78
-		echo lsx_health_plan_week_plan_block( $args ); // WPCS: XSS OK.
78
+		echo lsx_health_plan_week_plan_block($args); // WPCS: XSS OK.
79 79
 	}
80 80
 	$content = ob_get_clean();
81 81
 	return $content;
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
  * @param array $args
88 88
  * @return void
89 89
  */
90
-function exercise_box( $args = array() ) {
90
+function exercise_box($args = array()) {
91 91
 	$defaults = array(
92 92
 		'include'       => '',
93 93
 		'term'          => '',
@@ -106,9 +106,9 @@  discard block
 block discarded – undo
106 106
 		'parent'        => false,
107 107
 		'modal_content' => 'excerpt',
108 108
 	);
109
-	$args     = wp_parse_args( $args, $defaults );
109
+	$args = wp_parse_args($args, $defaults);
110 110
 	ob_start();
111
-	echo lsx_health_plan_items( $args ); // WPCS: XSS OK.
111
+	echo lsx_health_plan_items($args); // WPCS: XSS OK.
112 112
 	$content = ob_get_clean();
113 113
 	return $content;
114 114
 }
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
 	echo lsx_health_plan_featured_video_block(); // WPCS: XSS OK.
124 124
 	$content = ob_get_clean();
125 125
 
126
-	wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
127
-	wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true );
126
+	wp_enqueue_script('slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array('jquery'), LSX_HEALTH_PLAN_VER, true);
127
+	wp_enqueue_script('lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array('slick'), LSX_HEALTH_PLAN_VER, true);
128 128
 	return $content;
129 129
 }
130 130
 
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
 	ob_start();
138 138
 	echo lsx_health_plan_featured_recipes_block(); // WPCS: XSS OK.
139 139
 	$content = ob_get_clean();
140
-	wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
141
-	wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true );
140
+	wp_enqueue_script('slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array('jquery'), LSX_HEALTH_PLAN_VER, true);
141
+	wp_enqueue_script('lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array('slick'), LSX_HEALTH_PLAN_VER, true);
142 142
 	return $content;
143 143
 }
144 144
 
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
 	ob_start();
152 152
 	echo lsx_health_plan_featured_tips_block(); // WPCS: XSS OK.
153 153
 	$content = ob_get_clean();
154
-	wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
155
-	wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true );
154
+	wp_enqueue_script('slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array('jquery'), LSX_HEALTH_PLAN_VER, true);
155
+	wp_enqueue_script('lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array('slick'), LSX_HEALTH_PLAN_VER, true);
156 156
 	return $content;
157 157
 }
158 158
 
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
  */
164 164
 function account_notices() {
165 165
 	$content = '';
166
-	if ( function_exists( 'wc_print_notices' ) ) {
167
-		$content = wc_print_notices( true );
166
+	if (function_exists('wc_print_notices')) {
167
+		$content = wc_print_notices(true);
168 168
 	}
169 169
 	return $content;
170 170
 }
Please login to merge, or discard this patch.
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
13 13
  * @return string
14 14
  */
15 15
 function restricted_content() {
16
-	$content = '';
17
-	if ( ! is_user_logged_in() ) {
18
-		ob_start();
19
-		echo do_shortcode( '[woocommerce_my_account]' );
20
-		$content = ob_get_clean();
21
-	}
22
-	return $content;
16
+     $content = '';
17
+     if ( ! is_user_logged_in() ) {
18
+          ob_start();
19
+          echo do_shortcode( '[woocommerce_my_account]' );
20
+          $content = ob_get_clean();
21
+     }
22
+     return $content;
23 23
 }
24 24
 
25 25
 /**
@@ -28,10 +28,10 @@  discard block
 block discarded – undo
28 28
  * @return void
29 29
  */
30 30
 function my_profile_tabs() {
31
-	ob_start();
32
-	echo lsx_health_plan_my_profile_tabs(); // WPCS: XSS OK.
33
-	$content = ob_get_clean();
34
-	return $content;
31
+     ob_start();
32
+     echo lsx_health_plan_my_profile_tabs(); // WPCS: XSS OK.
33
+     $content = ob_get_clean();
34
+     return $content;
35 35
 }
36 36
 
37 37
 /**
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
  * @return void
41 41
  */
42 42
 function my_profile_box() {
43
-	ob_start();
44
-	echo lsx_health_plan_my_profile_box(); // WPCS: XSS OK.
45
-	$content = ob_get_clean();
46
-	return $content;
43
+     ob_start();
44
+     echo lsx_health_plan_my_profile_box(); // WPCS: XSS OK.
45
+     $content = ob_get_clean();
46
+     return $content;
47 47
 }
48 48
 
49 49
 /**
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
  */
54 54
 function all_plans_box( $args = array() ) {
55 55
 
56
-	ob_start();
57
-	echo lsx_health_plan_all_plans_block(); // WPCS: XSS OK.
58
-	$content = ob_get_clean();
59
-	return $content;
56
+     ob_start();
57
+     echo lsx_health_plan_all_plans_block(); // WPCS: XSS OK.
58
+     $content = ob_get_clean();
59
+     return $content;
60 60
 }
61 61
 
62 62
 /**
@@ -65,20 +65,20 @@  discard block
 block discarded – undo
65 65
  * @return void
66 66
  */
67 67
 function day_plan_box( $args = array() ) {
68
-	$defaults = array(
69
-		'week_view'      => false,
70
-		'show_downloads' => false,
71
-		'plan'           => '',
72
-	);
73
-	$args     = wp_parse_args( $args, $defaults );
74
-	ob_start();
75
-	if ( false === $args['week_view'] ) {
76
-		echo lsx_health_plan_day_plan_block( $args ); // WPCS: XSS OK.
77
-	} else {
78
-		echo lsx_health_plan_week_plan_block( $args ); // WPCS: XSS OK.
79
-	}
80
-	$content = ob_get_clean();
81
-	return $content;
68
+     $defaults = array(
69
+          'week_view'      => false,
70
+          'show_downloads' => false,
71
+          'plan'           => '',
72
+     );
73
+     $args     = wp_parse_args( $args, $defaults );
74
+     ob_start();
75
+     if ( false === $args['week_view'] ) {
76
+          echo lsx_health_plan_day_plan_block( $args ); // WPCS: XSS OK.
77
+     } else {
78
+          echo lsx_health_plan_week_plan_block( $args ); // WPCS: XSS OK.
79
+     }
80
+     $content = ob_get_clean();
81
+     return $content;
82 82
 }
83 83
 
84 84
 /**
@@ -88,29 +88,29 @@  discard block
 block discarded – undo
88 88
  * @return void
89 89
  */
90 90
 function exercise_box( $args = array() ) {
91
-	$defaults = array(
92
-		'include'       => '',
93
-		'term'          => '',
94
-		'taxonomy'      => '',
95
-		'view_more'     => false,
96
-		'columns'       => 3,
97
-		'limit'         => 4,
98
-		'post_type'     => 'exercise',
99
-		'orderby'       => 'date',
100
-		'order'         => 'DESC',
101
-		'description'   => 'none',
102
-		'link'          => 'item',
103
-		'link_class'    => 'btn border-btn',
104
-		'layout'        => 'grid',
105
-		'image_size'    => 'lsx-thumbnail-square',
106
-		'parent'        => false,
107
-		'modal_content' => 'excerpt',
108
-	);
109
-	$args     = wp_parse_args( $args, $defaults );
110
-	ob_start();
111
-	echo lsx_health_plan_items( $args ); // WPCS: XSS OK.
112
-	$content = ob_get_clean();
113
-	return $content;
91
+     $defaults = array(
92
+          'include'       => '',
93
+          'term'          => '',
94
+          'taxonomy'      => '',
95
+          'view_more'     => false,
96
+          'columns'       => 3,
97
+          'limit'         => 4,
98
+          'post_type'     => 'exercise',
99
+          'orderby'       => 'date',
100
+          'order'         => 'DESC',
101
+          'description'   => 'none',
102
+          'link'          => 'item',
103
+          'link_class'    => 'btn border-btn',
104
+          'layout'        => 'grid',
105
+          'image_size'    => 'lsx-thumbnail-square',
106
+          'parent'        => false,
107
+          'modal_content' => 'excerpt',
108
+     );
109
+     $args     = wp_parse_args( $args, $defaults );
110
+     ob_start();
111
+     echo lsx_health_plan_items( $args ); // WPCS: XSS OK.
112
+     $content = ob_get_clean();
113
+     return $content;
114 114
 }
115 115
 
116 116
 /**
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
  * @return void
120 120
  */
121 121
 function feature_video_box() {
122
-	ob_start();
123
-	echo lsx_health_plan_featured_video_block(); // WPCS: XSS OK.
124
-	$content = ob_get_clean();
122
+     ob_start();
123
+     echo lsx_health_plan_featured_video_block(); // WPCS: XSS OK.
124
+     $content = ob_get_clean();
125 125
 
126
-	wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
127
-	wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true );
128
-	return $content;
126
+     wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
127
+     wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true );
128
+     return $content;
129 129
 }
130 130
 
131 131
 /**
@@ -134,12 +134,12 @@  discard block
 block discarded – undo
134 134
  * @return void
135 135
  */
136 136
 function feature_recipes_box() {
137
-	ob_start();
138
-	echo lsx_health_plan_featured_recipes_block(); // WPCS: XSS OK.
139
-	$content = ob_get_clean();
140
-	wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
141
-	wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true );
142
-	return $content;
137
+     ob_start();
138
+     echo lsx_health_plan_featured_recipes_block(); // WPCS: XSS OK.
139
+     $content = ob_get_clean();
140
+     wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
141
+     wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true );
142
+     return $content;
143 143
 }
144 144
 
145 145
 /**
@@ -148,12 +148,12 @@  discard block
 block discarded – undo
148 148
  * @return void
149 149
  */
150 150
 function feature_tips_box() {
151
-	ob_start();
152
-	echo lsx_health_plan_featured_tips_block(); // WPCS: XSS OK.
153
-	$content = ob_get_clean();
154
-	wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
155
-	wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true );
156
-	return $content;
151
+     ob_start();
152
+     echo lsx_health_plan_featured_tips_block(); // WPCS: XSS OK.
153
+     $content = ob_get_clean();
154
+     wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true );
155
+     wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true );
156
+     return $content;
157 157
 }
158 158
 
159 159
 /**
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
  * @return string
163 163
  */
164 164
 function account_notices() {
165
-	$content = '';
166
-	if ( function_exists( 'wc_print_notices' ) ) {
167
-		$content = wc_print_notices( true );
168
-	}
169
-	return $content;
165
+     $content = '';
166
+     if ( function_exists( 'wc_print_notices' ) ) {
167
+          $content = wc_print_notices( true );
168
+     }
169
+     return $content;
170 170
 }
Please login to merge, or discard this patch.
includes/template-tags/woocommerce.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
 	global $product;
11 11
 
12 12
 	$restricted = false;
13
-	if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) {
14
-		$restricted = wc_memberships_is_post_content_restricted() && ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
13
+	if (function_exists('wc_memberships_is_post_content_restricted')) {
14
+		$restricted = wc_memberships_is_post_content_restricted() && ! current_user_can('wc_memberships_view_restricted_post_content', get_the_ID());
15 15
 	}
16
-	if ( true === $restricted && \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
16
+	if (true === $restricted && \lsx_health_plan\functions\woocommerce\plan_has_products()) {
17 17
 		$products      = \lsx_health_plan\functions\woocommerce\get_plan_products();
18
-		$product_count = count( $products );
19
-		if ( 1 === (int) $product_count ) {
18
+		$product_count = count($products);
19
+		if (1 === (int) $product_count) {
20 20
 			$class = 'col-md-12';
21 21
 		} else {
22 22
 			$class = 'col-md-6';
@@ -24,25 +24,25 @@  discard block
 block discarded – undo
24 24
 		?>
25 25
 			<div class="plans-products-wrapper row">
26 26
 				<?php
27
-				foreach ( $products as $product ) {
28
-					$product = wc_get_product( $product );
27
+				foreach ($products as $product) {
28
+					$product = wc_get_product($product);
29 29
 					?>
30
-						<div class="plan-product <?php echo esc_attr( $class ); ?>">
31
-							<h3 class="title"><a href="<?php echo esc_html( $product->get_permalink() ); ?>"><?php echo esc_html( $product->get_title() ); ?></a></h3>
30
+						<div class="plan-product <?php echo esc_attr($class); ?>">
31
+							<h3 class="title"><a href="<?php echo esc_html($product->get_permalink()); ?>"><?php echo esc_html($product->get_title()); ?></a></h3>
32 32
 							<?php
33
-							$description = $product->is_type( 'variation' ) ? $product->get_description() : $product->get_short_description();
34
-							if ( '' !== $description ) {
33
+							$description = $product->is_type('variation') ? $product->get_description() : $product->get_short_description();
34
+							if ('' !== $description) {
35 35
 								?>
36 36
 									<div class="description">
37
-										<?php echo esc_html( $description ); ?>
37
+										<?php echo esc_html($description); ?>
38 38
 									</div>
39 39
 								<?php
40 40
 							}
41 41
 							?>
42
-							<?php echo wp_kses_post( $product->get_price_html() ); ?>
42
+							<?php echo wp_kses_post($product->get_price_html()); ?>
43 43
 
44 44
 							<div class="add-to-cart">
45
-								<a class="btn cta-btn" href="<?php echo esc_attr( $product->add_to_cart_url() ); ?>"><?php echo esc_attr( $product->add_to_cart_text() ); ?></a>
45
+								<a class="btn cta-btn" href="<?php echo esc_attr($product->add_to_cart_url()); ?>"><?php echo esc_attr($product->add_to_cart_text()); ?></a>
46 46
 							</div>
47 47
 						</div>
48 48
 					<?php
Please login to merge, or discard this patch.
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -7,38 +7,38 @@  discard block
 block discarded – undo
7 7
 
8 8
 
9 9
 function lsx_hp_single_plan_products() {
10
-	global $product;
10
+     global $product;
11 11
 
12
-	$restricted = false;
13
-	if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) {
14
-		$restricted = wc_memberships_is_post_content_restricted() && ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
15
-	}
16
-	if ( true === $restricted && \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
17
-		$products      = \lsx_health_plan\functions\woocommerce\get_plan_products();
18
-		$product_count = count( $products );
19
-		if ( 1 === (int) $product_count ) {
20
-			$class = 'col-md-12';
21
-		} else {
22
-			$class = 'col-md-6';
23
-		}
24
-		?>
12
+     $restricted = false;
13
+     if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) {
14
+          $restricted = wc_memberships_is_post_content_restricted() && ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
15
+     }
16
+     if ( true === $restricted && \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
17
+          $products      = \lsx_health_plan\functions\woocommerce\get_plan_products();
18
+          $product_count = count( $products );
19
+          if ( 1 === (int) $product_count ) {
20
+               $class = 'col-md-12';
21
+          } else {
22
+               $class = 'col-md-6';
23
+          }
24
+          ?>
25 25
 			<div class="plans-products-wrapper row">
26 26
 				<?php
27
-				foreach ( $products as $product ) {
28
-					$product = wc_get_product( $product );
29
-					?>
27
+                    foreach ( $products as $product ) {
28
+                         $product = wc_get_product( $product );
29
+                         ?>
30 30
 						<div class="plan-product <?php echo esc_attr( $class ); ?>">
31 31
 							<h3 class="title"><a href="<?php echo esc_html( $product->get_permalink() ); ?>"><?php echo esc_html( $product->get_title() ); ?></a></h3>
32 32
 							<?php
33
-							$description = $product->is_type( 'variation' ) ? $product->get_description() : $product->get_short_description();
34
-							if ( '' !== $description ) {
35
-								?>
33
+                                   $description = $product->is_type( 'variation' ) ? $product->get_description() : $product->get_short_description();
34
+                                   if ( '' !== $description ) {
35
+                                        ?>
36 36
 									<div class="description">
37 37
 										<?php echo esc_html( $description ); ?>
38 38
 									</div>
39 39
 								<?php
40
-							}
41
-							?>
40
+                                   }
41
+                                   ?>
42 42
 							<?php echo wp_kses_post( $product->get_price_html() ); ?>
43 43
 
44 44
 							<div class="add-to-cart">
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
 							</div>
47 47
 						</div>
48 48
 					<?php
49
-				}
50
-				?>
49
+                    }
50
+                    ?>
51 51
 			</div>
52 52
 		<?php
53
-	}
53
+     }
54 54
 }
Please login to merge, or discard this patch.
includes/functions/woocommerce.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 function plan_has_products() {
16 16
 	$lsx_hp       = lsx_health_plan();
17 17
 	$has_products = false;
18
-	if ( ! empty( $lsx_hp->integrations->woocommerce->plans->product_ids ) ) {
18
+	if ( ! empty($lsx_hp->integrations->woocommerce->plans->product_ids)) {
19 19
 		$has_products = true;
20 20
 	}
21 21
 	return $has_products;
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 function get_plan_products() {
30 30
 	$lsx_hp       = lsx_health_plan();
31 31
 	$has_products = array();
32
-	if ( ! empty( $lsx_hp->integrations->woocommerce->plans->product_ids ) ) {
32
+	if ( ! empty($lsx_hp->integrations->woocommerce->plans->product_ids)) {
33 33
 		$has_products = $lsx_hp->integrations->woocommerce->plans->product_ids;
34 34
 	}
35 35
 	return $has_products;
@@ -42,20 +42,20 @@  discard block
 block discarded – undo
42 42
  */
43 43
 function get_membership_products() {
44 44
 	$product_ids = array();
45
-	if ( function_exists( 'wc_memberships_get_user_memberships' ) ) {
45
+	if (function_exists('wc_memberships_get_user_memberships')) {
46 46
 		$user_memberships = wc_memberships_get_user_memberships();
47 47
 
48
-		if ( ! empty( $user_memberships ) ) {
49
-			foreach ( $user_memberships as $membership ) {
48
+		if ( ! empty($user_memberships)) {
49
+			foreach ($user_memberships as $membership) {
50 50
 				$current_products = $membership->plan->get_product_ids();
51
-				if ( ! empty( $current_products ) ) {
52
-					$product_ids = array_merge( $product_ids, $current_products );
51
+				if ( ! empty($current_products)) {
52
+					$product_ids = array_merge($product_ids, $current_products);
53 53
 				}
54 54
 			}
55 55
 		}
56 56
 	}
57
-	if ( ! empty( $product_ids ) ) {
58
-		$product_ids = array_unique( $product_ids );
57
+	if ( ! empty($product_ids)) {
58
+		$product_ids = array_unique($product_ids);
59 59
 	}
60 60
 	return $product_ids;
61 61
 }
Please login to merge, or discard this patch.
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -13,12 +13,12 @@  discard block
 block discarded – undo
13 13
  * @return boolean
14 14
  */
15 15
 function plan_has_products() {
16
-	$lsx_hp       = lsx_health_plan();
17
-	$has_products = false;
18
-	if ( ! empty( $lsx_hp->integrations->woocommerce->plans->product_ids ) ) {
19
-		$has_products = true;
20
-	}
21
-	return $has_products;
16
+     $lsx_hp       = lsx_health_plan();
17
+     $has_products = false;
18
+     if ( ! empty( $lsx_hp->integrations->woocommerce->plans->product_ids ) ) {
19
+          $has_products = true;
20
+     }
21
+     return $has_products;
22 22
 }
23 23
 
24 24
 /**
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
  * @return array
28 28
  */
29 29
 function get_plan_products() {
30
-	$lsx_hp       = lsx_health_plan();
31
-	$has_products = array();
32
-	if ( ! empty( $lsx_hp->integrations->woocommerce->plans->product_ids ) ) {
33
-		$has_products = $lsx_hp->integrations->woocommerce->plans->product_ids;
34
-	}
35
-	return $has_products;
30
+     $lsx_hp       = lsx_health_plan();
31
+     $has_products = array();
32
+     if ( ! empty( $lsx_hp->integrations->woocommerce->plans->product_ids ) ) {
33
+          $has_products = $lsx_hp->integrations->woocommerce->plans->product_ids;
34
+     }
35
+     return $has_products;
36 36
 }
37 37
 
38 38
 /**
@@ -41,21 +41,21 @@  discard block
 block discarded – undo
41 41
  * @return array
42 42
  */
43 43
 function get_membership_products() {
44
-	$product_ids = array();
45
-	if ( function_exists( 'wc_memberships_get_user_memberships' ) ) {
46
-		$user_memberships = wc_memberships_get_user_memberships();
44
+     $product_ids = array();
45
+     if ( function_exists( 'wc_memberships_get_user_memberships' ) ) {
46
+          $user_memberships = wc_memberships_get_user_memberships();
47 47
 
48
-		if ( ! empty( $user_memberships ) ) {
49
-			foreach ( $user_memberships as $membership ) {
50
-				$current_products = $membership->plan->get_product_ids();
51
-				if ( ! empty( $current_products ) ) {
52
-					$product_ids = array_merge( $product_ids, $current_products );
53
-				}
54
-			}
55
-		}
56
-	}
57
-	if ( ! empty( $product_ids ) ) {
58
-		$product_ids = array_unique( $product_ids );
59
-	}
60
-	return $product_ids;
48
+          if ( ! empty( $user_memberships ) ) {
49
+               foreach ( $user_memberships as $membership ) {
50
+                    $current_products = $membership->plan->get_product_ids();
51
+                    if ( ! empty( $current_products ) ) {
52
+                         $product_ids = array_merge( $product_ids, $current_products );
53
+                    }
54
+               }
55
+          }
56
+     }
57
+     if ( ! empty( $product_ids ) ) {
58
+          $product_ids = array_unique( $product_ids );
59
+     }
60
+     return $product_ids;
61 61
 }
Please login to merge, or discard this patch.
includes/functions/recipes.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@
 block discarded – undo
14 14
  * @return boolean
15 15
  */
16 16
 function register_recipe_modal() {
17
-	remove_action( 'lsx_content_sharing', 'lsx_sharing_output', 20 );
17
+	remove_action('lsx_content_sharing', 'lsx_sharing_output', 20);
18 18
 	ob_start();
19 19
 	include LSX_HEALTH_PLAN_PATH . '/templates/content-recipe.php';
20 20
 	$modal_body = ob_get_clean();
21
-	add_action( 'lsx_content_sharing', 'lsx_sharing_output', 20 );
22
-	\lsx_health_plan\functions\register_modal( 'recipe-modal-' . get_the_ID(), '', $modal_body );
21
+	add_action('lsx_content_sharing', 'lsx_sharing_output', 20);
22
+	\lsx_health_plan\functions\register_modal('recipe-modal-' . get_the_ID(), '', $modal_body);
23 23
 }
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@
 block discarded – undo
14 14
  * @return boolean
15 15
  */
16 16
 function register_recipe_modal() {
17
-	remove_action( 'lsx_content_sharing', 'lsx_sharing_output', 20 );
18
-	ob_start();
19
-	include LSX_HEALTH_PLAN_PATH . '/templates/content-recipe.php';
20
-	$modal_body = ob_get_clean();
21
-	add_action( 'lsx_content_sharing', 'lsx_sharing_output', 20 );
22
-	\lsx_health_plan\functions\register_modal( 'recipe-modal-' . get_the_ID(), '', $modal_body );
17
+     remove_action( 'lsx_content_sharing', 'lsx_sharing_output', 20 );
18
+     ob_start();
19
+     include LSX_HEALTH_PLAN_PATH . '/templates/content-recipe.php';
20
+     $modal_body = ob_get_clean();
21
+     add_action( 'lsx_content_sharing', 'lsx_sharing_output', 20 );
22
+     \lsx_health_plan\functions\register_modal( 'recipe-modal-' . get_the_ID(), '', $modal_body );
23 23
 }
Please login to merge, or discard this patch.
templates/page-template-my-plan.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 <?php lsx_content_wrap_before(); ?>
14 14
 
15
-<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>">
15
+<div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>">
16 16
 
17 17
 	<?php lsx_content_before(); ?>
18 18
 
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
 
21 21
 		<?php lsx_content_top(); ?>
22 22
 
23
-		<?php if ( have_posts() ) : ?>
23
+		<?php if (have_posts()) : ?>
24 24
 
25
-			<?php while ( have_posts() ) : the_post(); ?>
25
+			<?php while (have_posts()) : the_post(); ?>
26 26
 
27 27
 				<?php lsx_entry_before(); ?>
28 28
 
@@ -32,33 +32,33 @@  discard block
 block discarded – undo
32 32
 
33 33
 					<div class="entry-content">
34 34
 						<?php
35
-						if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'edit-account' ) ) {
35
+						if (function_exists('is_wc_endpoint_url') && is_wc_endpoint_url('edit-account')) {
36 36
 							$classes = get_body_class();
37
-							if ( in_array( 'has-block-banner', $classes ) ) {
38
-								$blocks = parse_blocks( get_the_content() );
39
-								foreach ( $blocks as $block ) {
40
-									if ( 'lsx-blocks/lsx-banner-box' === $block['blockName'] ) {
41
-										echo wp_kses_post( $block['innerHTML'] );
37
+							if (in_array('has-block-banner', $classes)) {
38
+								$blocks = parse_blocks(get_the_content());
39
+								foreach ($blocks as $block) {
40
+									if ('lsx-blocks/lsx-banner-box' === $block['blockName']) {
41
+										echo wp_kses_post($block['innerHTML']);
42 42
 									}
43 43
 								}
44
-							} elseif ( in_array( 'has-block-cover', $classes ) ) {
45
-								$blocks = parse_blocks( get_the_content() );
46
-								foreach ( $blocks as $block ) {
44
+							} elseif (in_array('has-block-cover', $classes)) {
45
+								$blocks = parse_blocks(get_the_content());
46
+								foreach ($blocks as $block) {
47 47
 									//print( '<pre>' . print_r( $block, true ) . '</pre>' );
48
-									if ( 'core/cover' === $block['blockName'] ) {
49
-										echo wp_kses_post( render_block( $block ) );
48
+									if ('core/cover' === $block['blockName']) {
49
+										echo wp_kses_post(render_block($block));
50 50
 									}
51 51
 								}
52 52
 							} else {
53
-								$my_plan_string = esc_html__( 'My Plan', 'lsx-health-plan' );
54
-								echo wp_kses_post( '<div class="lsx-health-plan my-profile-block wp-block-cover alignfull"><div class="wp-block-cover__inner-container"><h2>' . $my_plan_string . '</h2></div></div>' );
53
+								$my_plan_string = esc_html__('My Plan', 'lsx-health-plan');
54
+								echo wp_kses_post('<div class="lsx-health-plan my-profile-block wp-block-cover alignfull"><div class="wp-block-cover__inner-container"><h2>' . $my_plan_string . '</h2></div></div>');
55 55
 							}
56 56
 
57
-							$my_profile_string  = esc_html__( 'My Profile', 'lsx-health-plan' );
58
-							$my_profile_tagline = esc_html__( 'Update your details below', 'lsx-health-plan' );
59
-							echo do_shortcode( '<div id="edit-account-tab">[lsx_health_plan_my_profile_tabs]<div class="edit-account-section"><h2 class="title-lined">' . $my_profile_string . '</h2><p>' . $my_profile_tagline . '</p>[woocommerce_my_account]</div></div>' );
60
-						} else if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'lost-password' ) ) {
61
-							echo do_shortcode( '[woocommerce_my_account]' );
57
+							$my_profile_string  = esc_html__('My Profile', 'lsx-health-plan');
58
+							$my_profile_tagline = esc_html__('Update your details below', 'lsx-health-plan');
59
+							echo do_shortcode('<div id="edit-account-tab">[lsx_health_plan_my_profile_tabs]<div class="edit-account-section"><h2 class="title-lined">' . $my_profile_string . '</h2><p>' . $my_profile_tagline . '</p>[woocommerce_my_account]</div></div>');
60
+						} else if (function_exists('is_wc_endpoint_url') && is_wc_endpoint_url('lost-password')) {
61
+							echo do_shortcode('[woocommerce_my_account]');
62 62
 						} else {
63 63
 							the_content();
64 64
 						}
Please login to merge, or discard this patch.
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -32,37 +32,37 @@
 block discarded – undo
32 32
 
33 33
 					<div class="entry-content">
34 34
 						<?php
35
-						if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'edit-account' ) ) {
36
-							$classes = get_body_class();
37
-							if ( in_array( 'has-block-banner', $classes ) ) {
38
-								$blocks = parse_blocks( get_the_content() );
39
-								foreach ( $blocks as $block ) {
40
-									if ( 'lsx-blocks/lsx-banner-box' === $block['blockName'] ) {
41
-										echo wp_kses_post( $block['innerHTML'] );
42
-									}
43
-								}
44
-							} elseif ( in_array( 'has-block-cover', $classes ) ) {
45
-								$blocks = parse_blocks( get_the_content() );
46
-								foreach ( $blocks as $block ) {
47
-									//print( '<pre>' . print_r( $block, true ) . '</pre>' );
48
-									if ( 'core/cover' === $block['blockName'] ) {
49
-										echo wp_kses_post( render_block( $block ) );
50
-									}
51
-								}
52
-							} else {
53
-								$my_plan_string = esc_html__( 'My Plan', 'lsx-health-plan' );
54
-								echo wp_kses_post( '<div class="lsx-health-plan my-profile-block wp-block-cover alignfull"><div class="wp-block-cover__inner-container"><h2>' . $my_plan_string . '</h2></div></div>' );
55
-							}
56
-
57
-							$my_profile_string  = esc_html__( 'My Profile', 'lsx-health-plan' );
58
-							$my_profile_tagline = esc_html__( 'Update your details below', 'lsx-health-plan' );
59
-							echo do_shortcode( '<div id="edit-account-tab">[lsx_health_plan_my_profile_tabs]<div class="edit-account-section"><h2 class="title-lined">' . $my_profile_string . '</h2><p>' . $my_profile_tagline . '</p>[woocommerce_my_account]</div></div>' );
60
-						} else if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'lost-password' ) ) {
61
-							echo do_shortcode( '[woocommerce_my_account]' );
62
-						} else {
63
-							the_content();
64
-						}
65
-						?>
35
+                              if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'edit-account' ) ) {
36
+                                   $classes = get_body_class();
37
+                                   if ( in_array( 'has-block-banner', $classes ) ) {
38
+                                        $blocks = parse_blocks( get_the_content() );
39
+                                        foreach ( $blocks as $block ) {
40
+                                             if ( 'lsx-blocks/lsx-banner-box' === $block['blockName'] ) {
41
+                                                  echo wp_kses_post( $block['innerHTML'] );
42
+                                             }
43
+                                        }
44
+                                   } elseif ( in_array( 'has-block-cover', $classes ) ) {
45
+                                        $blocks = parse_blocks( get_the_content() );
46
+                                        foreach ( $blocks as $block ) {
47
+                                             //print( '<pre>' . print_r( $block, true ) . '</pre>' );
48
+                                             if ( 'core/cover' === $block['blockName'] ) {
49
+                                                  echo wp_kses_post( render_block( $block ) );
50
+                                             }
51
+                                        }
52
+                                   } else {
53
+                                        $my_plan_string = esc_html__( 'My Plan', 'lsx-health-plan' );
54
+                                        echo wp_kses_post( '<div class="lsx-health-plan my-profile-block wp-block-cover alignfull"><div class="wp-block-cover__inner-container"><h2>' . $my_plan_string . '</h2></div></div>' );
55
+                                   }
56
+
57
+                                   $my_profile_string  = esc_html__( 'My Profile', 'lsx-health-plan' );
58
+                                   $my_profile_tagline = esc_html__( 'Update your details below', 'lsx-health-plan' );
59
+                                   echo do_shortcode( '<div id="edit-account-tab">[lsx_health_plan_my_profile_tabs]<div class="edit-account-section"><h2 class="title-lined">' . $my_profile_string . '</h2><p>' . $my_profile_tagline . '</p>[woocommerce_my_account]</div></div>' );
60
+                              } else if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'lost-password' ) ) {
61
+                                   echo do_shortcode( '[woocommerce_my_account]' );
62
+                              } else {
63
+                                   the_content();
64
+                              }
65
+                              ?>
66 66
 					</div><!-- .entry-content -->
67 67
 
68 68
 					<?php lsx_entry_bottom(); ?>
Please login to merge, or discard this patch.