Passed
Push — add/multiplan ( 80880c...7ffec7 )
by Virginia
04:38
created
includes/template-tags/plan.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
  * @return void
12 12
  */
13 13
 function lsx_hp_plan_archive_filters() {
14
-	if ( is_post_type_archive( 'plan' ) && function_exists( 'wc_get_page_id' ) && false === apply_filters( 'lsx_hp_disable_plan_archive_filters', false ) ) {
15
-		?>
14
+     if ( is_post_type_archive( 'plan' ) && function_exists( 'wc_get_page_id' ) && false === apply_filters( 'lsx_hp_disable_plan_archive_filters', false ) ) {
15
+          ?>
16 16
 		<div id="type-nav">
17 17
 			<ul class="nav nav-pills lsx-type-nav-filter">
18 18
 				<li class="active"><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter="*"><?php esc_html_e( 'All', 'lsx-health-plan' ); ?></a></li>
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 			</ul>
23 23
 		</div>
24 24
 		<?php
25
-	}
25
+     }
26 26
 }
27 27
 
28 28
 /**
@@ -31,27 +31,27 @@  discard block
 block discarded – undo
31 31
  * @return string
32 32
  */
33 33
 function lsx_hp_plan_get_classes() {
34
-	$classes = 'filter-free';
35
-	if ( \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
36
-		$products       = \lsx_health_plan\functions\woocommerce\get_plan_products();
37
-		$linked_product = wc_get_product( $products[0] );
38
-		$price          = $linked_product->get_price( 'raw' );
39
-		if ( empty( $price ) ) {
40
-			$classes = 'filter-free';
41
-		} else {
42
-			$classes = 'filter-paid';
43
-		}
34
+     $classes = 'filter-free';
35
+     if ( \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
36
+          $products       = \lsx_health_plan\functions\woocommerce\get_plan_products();
37
+          $linked_product = wc_get_product( $products[0] );
38
+          $price          = $linked_product->get_price( 'raw' );
39
+          if ( empty( $price ) ) {
40
+               $classes = 'filter-free';
41
+          } else {
42
+               $classes = 'filter-paid';
43
+          }
44 44
 
45
-		$featured = get_post_meta( get_the_ID(), 'plan_featured_plan', true );
46
-		if ( false !== $featured && '' !== $featured ) {
47
-			$classes .= ' filter-featured';
48
-		}
49
-	}
50
-	return $classes;
45
+          $featured = get_post_meta( get_the_ID(), 'plan_featured_plan', true );
46
+          if ( false !== $featured && '' !== $featured ) {
47
+               $classes .= ' filter-featured';
48
+          }
49
+     }
50
+     return $classes;
51 51
 }
52 52
 
53 53
 function lsx_health_plan_back_to_plan_button() {
54
-	?>
54
+     ?>
55 55
 	<div  class="back-plan-btn">
56 56
 		<a class="btn" href="<?php the_permalink(); ?>"><?php esc_html_e( 'Back To Plan', 'lsx-health-plan' ); ?></a>
57 57
 	</div>
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -11,14 +11,14 @@  discard block
 block discarded – undo
11 11
  * @return void
12 12
  */
13 13
 function lsx_hp_plan_archive_filters() {
14
-	if ( is_post_type_archive( 'plan' ) && function_exists( 'wc_get_page_id' ) && false === apply_filters( 'lsx_hp_disable_plan_archive_filters', false ) ) {
14
+	if (is_post_type_archive('plan') && function_exists('wc_get_page_id') && false === apply_filters('lsx_hp_disable_plan_archive_filters', false)) {
15 15
 		?>
16 16
 		<div id="type-nav">
17 17
 			<ul class="nav nav-pills lsx-type-nav-filter">
18
-				<li class="active"><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter="*"><?php esc_html_e( 'All', 'lsx-health-plan' ); ?></a></li>
19
-				<li><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter=".filter-free"><?php esc_html_e( 'Free', 'lsx-health-plan' ); ?></a></li>
20
-				<li><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter=".filter-paid"><?php esc_html_e( 'Paid', 'lsx-health-plan' ); ?></a></li>
21
-				<li><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter=".filter-featured"><?php esc_html_e( 'Featured', 'lsx-health-plan' ); ?></a></li>
18
+				<li class="active"><a href="<?php echo empty($group_selected) ? '#' : esc_url(get_post_type_archive_link('plan')); ?>" data-filter="*"><?php esc_html_e('All', 'lsx-health-plan'); ?></a></li>
19
+				<li><a href="<?php echo empty($group_selected) ? '#' : esc_url(get_post_type_archive_link('plan')); ?>" data-filter=".filter-free"><?php esc_html_e('Free', 'lsx-health-plan'); ?></a></li>
20
+				<li><a href="<?php echo empty($group_selected) ? '#' : esc_url(get_post_type_archive_link('plan')); ?>" data-filter=".filter-paid"><?php esc_html_e('Paid', 'lsx-health-plan'); ?></a></li>
21
+				<li><a href="<?php echo empty($group_selected) ? '#' : esc_url(get_post_type_archive_link('plan')); ?>" data-filter=".filter-featured"><?php esc_html_e('Featured', 'lsx-health-plan'); ?></a></li>
22 22
 			</ul>
23 23
 		</div>
24 24
 		<?php
@@ -32,18 +32,18 @@  discard block
 block discarded – undo
32 32
  */
33 33
 function lsx_hp_plan_get_classes() {
34 34
 	$classes = 'filter-free';
35
-	if ( \lsx_health_plan\functions\woocommerce\plan_has_products() ) {
35
+	if (\lsx_health_plan\functions\woocommerce\plan_has_products()) {
36 36
 		$products       = \lsx_health_plan\functions\woocommerce\get_plan_products();
37
-		$linked_product = wc_get_product( $products[0] );
38
-		$price          = $linked_product->get_price( 'raw' );
39
-		if ( empty( $price ) ) {
37
+		$linked_product = wc_get_product($products[0]);
38
+		$price          = $linked_product->get_price('raw');
39
+		if (empty($price)) {
40 40
 			$classes = 'filter-free';
41 41
 		} else {
42 42
 			$classes = 'filter-paid';
43 43
 		}
44 44
 
45
-		$featured = get_post_meta( get_the_ID(), 'plan_featured_plan', true );
46
-		if ( false !== $featured && '' !== $featured ) {
45
+		$featured = get_post_meta(get_the_ID(), 'plan_featured_plan', true);
46
+		if (false !== $featured && '' !== $featured) {
47 47
 			$classes .= ' filter-featured';
48 48
 		}
49 49
 	}
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 function lsx_health_plan_back_to_plan_button() {
54 54
 	?>
55 55
 	<div  class="back-plan-btn">
56
-		<a class="btn" href="<?php the_permalink(); ?>"><?php esc_html_e( 'Back To Plan', 'lsx-health-plan' ); ?></a>
56
+		<a class="btn" href="<?php the_permalink(); ?>"><?php esc_html_e('Back To Plan', 'lsx-health-plan'); ?></a>
57 57
 	</div>
58 58
 	<?php
59 59
 }
Please login to merge, or discard this patch.
includes/template-tags/team.php 3 patches
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,13 +114,19 @@
 block discarded – undo
114 114
 	<div class="entry-tabs hp-entry-tabs">
115 115
 		<ul class="nav nav-tabs">
116 116
 			<?php foreach ( $tabs as $i => $tab ) : ?>
117
-				<li<?php if ( 0 === $i ) echo ' class="active"'; ?>><a data-toggle="tab" href="#<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>"><?php echo esc_html( $tab['title'] ); ?></a></li>
117
+				<li<?php if ( 0 === $i ) {
118
+     echo ' class="active"';
119
+}
120
+?>><a data-toggle="tab" href="#<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>"><?php echo esc_html( $tab['title'] ); ?></a></li>
118 121
 			<?php endforeach; ?>
119 122
 		</ul>
120 123
 
121 124
 		<div class="tab-content">
122 125
 			<?php foreach ( $tabs as $i => $tab ) : ?>
123
-				<div id="<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>" class="tab-pane fade<?php if ( 0 === $i ) echo ' in active'; ?>">
126
+				<div id="<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>" class="tab-pane fade<?php if ( 0 === $i ) {
127
+     echo ' in active';
128
+}
129
+?>">
124 130
 					<?php echo do_shortcode( $tab['shortcode'] ); ?>
125 131
 					<?php echo wp_kses_post( $tab['content'] ); ?>
126 132
 				</div>
Please login to merge, or discard this patch.
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 $tab_experience['content']   = get_post_meta( get_the_ID(), 'team_member_experience', true );
9 9
 $tab_experience['shortcode'] = '';
10 10
 if ( ! empty( $tab_experience['content'] ) ) {
11
-	$tabs[] = $tab_experience;
11
+     $tabs[] = $tab_experience;
12 12
 }
13 13
 
14 14
 // Tab Featured plan
@@ -19,36 +19,36 @@  discard block
 block discarded – undo
19 19
 
20 20
 if ( ! empty( $tab_plans['posts'] ) ) {
21 21
 
22
-	$plan_content = '';
22
+     $plan_content = '';
23 23
 
24
-	$include = implode( ',', $tab_plans['posts'] );
25
-	$args = array(
26
-		'orderby'        => 'menu_order',
27
-		'order'          => 'ASC',
28
-		'post_type'      => 'plan',
29
-		'post__in'       => $tab_plans['posts'],
30
-	);
31
-	$plan_query = new WP_Query( $args );
24
+     $include = implode( ',', $tab_plans['posts'] );
25
+     $args = array(
26
+          'orderby'        => 'menu_order',
27
+          'order'          => 'ASC',
28
+          'post_type'      => 'plan',
29
+          'post__in'       => $tab_plans['posts'],
30
+     );
31
+     $plan_query = new WP_Query( $args );
32 32
 
33
-	$plan_content = '<div class="all-plans-block plan-grid block-all-plans-block team-member-plans"><div class="row">';
33
+     $plan_content = '<div class="all-plans-block plan-grid block-all-plans-block team-member-plans"><div class="row">';
34 34
 
35
-	if ( $plan_query->have_posts() ) {
36
-		add_action( 'lsx_sharing_is_disabled', '\lsx_health_plan\functions\triggers\disable_sharing', 10 );
37
-		while ( $plan_query->have_posts() ) {
38
-			$plan_query->the_post();
39
-			ob_start();
40
-			include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-plan.php';
41
-			$plan_content .= ob_get_clean();
42
-		}
43
-		wp_reset_postdata();
44
-		remove_action( 'lsx_sharing_is_disabled', '\lsx_health_plan\functions\triggers\disable_sharing', 10 );
45
-	}
46
-	$plan_content .= '</div></div>';
35
+     if ( $plan_query->have_posts() ) {
36
+          add_action( 'lsx_sharing_is_disabled', '\lsx_health_plan\functions\triggers\disable_sharing', 10 );
37
+          while ( $plan_query->have_posts() ) {
38
+               $plan_query->the_post();
39
+               ob_start();
40
+               include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-plan.php';
41
+               $plan_content .= ob_get_clean();
42
+          }
43
+          wp_reset_postdata();
44
+          remove_action( 'lsx_sharing_is_disabled', '\lsx_health_plan\functions\triggers\disable_sharing', 10 );
45
+     }
46
+     $plan_content .= '</div></div>';
47 47
 
48
-	$tab_plans['content'] = $plan_content;
48
+     $tab_plans['content'] = $plan_content;
49 49
 }
50 50
 if ( ! empty( $tab_plans['content'] ) ) {
51
-	$tabs[] = $tab_plans;
51
+     $tabs[] = $tab_plans;
52 52
 }
53 53
 
54 54
 
@@ -59,15 +59,15 @@  discard block
 block discarded – undo
59 59
 $tab_testimonial['content']   = '';
60 60
 
61 61
 if ( is_plugin_active( 'lsx-testimonials/lsx-testimonials.php' ) && ( ! empty( $tab_testimonial['posts'] ) ) ) {
62
-	if ( count( $tab_testimonial['posts'] ) <= 2 ) {
63
-		$columns = count( $tab_testimonial['posts'] );
64
-	} else {
65
-		$columns = 3;
66
-	}
62
+     if ( count( $tab_testimonial['posts'] ) <= 2 ) {
63
+          $columns = count( $tab_testimonial['posts'] );
64
+     } else {
65
+          $columns = 3;
66
+     }
67 67
 
68
-	$post_ids = join( ',', $tab_testimonial['posts'] );
69
-	$tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]';
70
-	$tabs[] = $tab_testimonial;
68
+     $post_ids = join( ',', $tab_testimonial['posts'] );
69
+     $tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]';
70
+     $tabs[] = $tab_testimonial;
71 71
 }
72 72
 
73 73
 if ( count( $tabs ) > 0 ) : ?>
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -4,85 +4,85 @@
 block discarded – undo
4 4
 $tabs = array();
5 5
 
6 6
 // Tab Experience
7
-$tab_experience['title']     = esc_html__( 'Experience', 'lsx-team' );
8
-$tab_experience['content']   = get_post_meta( get_the_ID(), 'team_member_experience', true );
7
+$tab_experience['title']     = esc_html__('Experience', 'lsx-team');
8
+$tab_experience['content']   = get_post_meta(get_the_ID(), 'team_member_experience', true);
9 9
 $tab_experience['shortcode'] = '';
10
-if ( ! empty( $tab_experience['content'] ) ) {
10
+if ( ! empty($tab_experience['content'])) {
11 11
 	$tabs[] = $tab_experience;
12 12
 }
13 13
 
14 14
 // Tab Featured plan
15
-$tab_plans['title']     = esc_html__( 'Featured Plans', 'lsx-team' );
16
-$tab_plans['posts']     = get_post_meta( get_the_ID(), 'connected_team_member_plan', true );
15
+$tab_plans['title']     = esc_html__('Featured Plans', 'lsx-team');
16
+$tab_plans['posts']     = get_post_meta(get_the_ID(), 'connected_team_member_plan', true);
17 17
 $tab_plans['content']   = '';
18 18
 $tab_plans['shortcode'] = '';
19 19
 
20
-if ( ! empty( $tab_plans['posts'] ) ) {
20
+if ( ! empty($tab_plans['posts'])) {
21 21
 
22 22
 	$plan_content = '';
23 23
 
24
-	$include = implode( ',', $tab_plans['posts'] );
24
+	$include = implode(',', $tab_plans['posts']);
25 25
 	$args = array(
26 26
 		'orderby'        => 'menu_order',
27 27
 		'order'          => 'ASC',
28 28
 		'post_type'      => 'plan',
29 29
 		'post__in'       => $tab_plans['posts'],
30 30
 	);
31
-	$plan_query = new WP_Query( $args );
31
+	$plan_query = new WP_Query($args);
32 32
 
33 33
 	$plan_content = '<div class="all-plans-block plan-grid block-all-plans-block team-member-plans"><div class="row">';
34 34
 
35
-	if ( $plan_query->have_posts() ) {
36
-		add_action( 'lsx_sharing_is_disabled', '\lsx_health_plan\functions\triggers\disable_sharing', 10 );
37
-		while ( $plan_query->have_posts() ) {
35
+	if ($plan_query->have_posts()) {
36
+		add_action('lsx_sharing_is_disabled', '\lsx_health_plan\functions\triggers\disable_sharing', 10);
37
+		while ($plan_query->have_posts()) {
38 38
 			$plan_query->the_post();
39 39
 			ob_start();
40 40
 			include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-plan.php';
41 41
 			$plan_content .= ob_get_clean();
42 42
 		}
43 43
 		wp_reset_postdata();
44
-		remove_action( 'lsx_sharing_is_disabled', '\lsx_health_plan\functions\triggers\disable_sharing', 10 );
44
+		remove_action('lsx_sharing_is_disabled', '\lsx_health_plan\functions\triggers\disable_sharing', 10);
45 45
 	}
46 46
 	$plan_content .= '</div></div>';
47 47
 
48 48
 	$tab_plans['content'] = $plan_content;
49 49
 }
50
-if ( ! empty( $tab_plans['content'] ) ) {
50
+if ( ! empty($tab_plans['content'])) {
51 51
 	$tabs[] = $tab_plans;
52 52
 }
53 53
 
54 54
 
55 55
 // Tab Testimonials
56 56
 $tab_testimonial['post_type'] = 'testimonial';
57
-$tab_testimonial['title']     = esc_html__( 'Testimonials', 'lsx-team' );
58
-$tab_testimonial['posts']     = get_post_meta( get_the_ID(), 'testimonial_to_team', true );
57
+$tab_testimonial['title']     = esc_html__('Testimonials', 'lsx-team');
58
+$tab_testimonial['posts']     = get_post_meta(get_the_ID(), 'testimonial_to_team', true);
59 59
 $tab_testimonial['content']   = '';
60 60
 
61
-if ( is_plugin_active( 'lsx-testimonials/lsx-testimonials.php' ) && ( ! empty( $tab_testimonial['posts'] ) ) ) {
62
-	if ( count( $tab_testimonial['posts'] ) <= 2 ) {
63
-		$columns = count( $tab_testimonial['posts'] );
61
+if (is_plugin_active('lsx-testimonials/lsx-testimonials.php') && ( ! empty($tab_testimonial['posts']))) {
62
+	if (count($tab_testimonial['posts']) <= 2) {
63
+		$columns = count($tab_testimonial['posts']);
64 64
 	} else {
65 65
 		$columns = 3;
66 66
 	}
67 67
 
68
-	$post_ids = join( ',', $tab_testimonial['posts'] );
68
+	$post_ids = join(',', $tab_testimonial['posts']);
69 69
 	$tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]';
70 70
 	$tabs[] = $tab_testimonial;
71 71
 }
72 72
 
73
-if ( count( $tabs ) > 0 ) : ?>
73
+if (count($tabs) > 0) : ?>
74 74
 	<div class="entry-tabs hp-entry-tabs">
75 75
 		<ul class="nav nav-tabs">
76
-			<?php foreach ( $tabs as $i => $tab ) : ?>
77
-				<li<?php if ( 0 === $i ) echo ' class="active"'; ?>><a data-toggle="tab" href="#<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>"><?php echo esc_html( $tab['title'] ); ?></a></li>
76
+			<?php foreach ($tabs as $i => $tab) : ?>
77
+				<li<?php if (0 === $i) echo ' class="active"'; ?>><a data-toggle="tab" href="#<?php echo esc_attr(sanitize_title($tab['title'])); ?>"><?php echo esc_html($tab['title']); ?></a></li>
78 78
 			<?php endforeach; ?>
79 79
 		</ul>
80 80
 
81 81
 		<div class="tab-content">
82
-			<?php foreach ( $tabs as $i => $tab ) : ?>
83
-				<div id="<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>" class="tab-pane fade<?php if ( 0 === $i ) echo ' in active'; ?>">
84
-					<?php echo do_shortcode( $tab['shortcode'] ); ?>
85
-					<?php echo wp_kses_post( $tab['content'] ); ?>
82
+			<?php foreach ($tabs as $i => $tab) : ?>
83
+				<div id="<?php echo esc_attr(sanitize_title($tab['title'])); ?>" class="tab-pane fade<?php if (0 === $i) echo ' in active'; ?>">
84
+					<?php echo do_shortcode($tab['shortcode']); ?>
85
+					<?php echo wp_kses_post($tab['content']); ?>
86 86
 				</div>
87 87
 			<?php endforeach; ?>
88 88
 		</div>
Please login to merge, or discard this patch.
classes/integrations/class-articles.php 2 patches
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -8,82 +8,82 @@
 block discarded – undo
8 8
  */
9 9
 class Articles {
10 10
 
11
-	/**
12
-	 * Holds class instance
13
-	 *
14
-	 * @var      object \lsx_health_plan\classes\Articles()
15
-	 */
16
-	protected static $instance = null;
11
+     /**
12
+      * Holds class instance
13
+      *
14
+      * @var      object \lsx_health_plan\classes\Articles()
15
+      */
16
+     protected static $instance = null;
17 17
 
18
-	/**
19
-	 * An array of the post types for the Global Defaults field.
20
-	 *
21
-	 * @var array
22
-	 */
23
-	//public $default_types = array( 'exercise', 'recipe', 'meal', 'workout', 'plan' );
18
+     /**
19
+      * An array of the post types for the Global Defaults field.
20
+      *
21
+      * @var array
22
+      */
23
+     //public $default_types = array( 'exercise', 'recipe', 'meal', 'workout', 'plan' );
24 24
 
25
-	/**
26
-	 * Constructor.
27
-	 */
28
-	public function __construct() {
29
-		$this->default_types = array(
30
-			\lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' ),
31
-			\lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ),
32
-			\lsx_health_plan\functions\get_option( 'endpoint_recipe_single', 'recipe' ),
33
-			\lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ),
34
-			\lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' ),
35
-		);
36
-		add_action( 'cmb2_admin_init', array( $this, 'related_articles_metabox' ) );
37
-	}
25
+     /**
26
+      * Constructor.
27
+      */
28
+     public function __construct() {
29
+          $this->default_types = array(
30
+               \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' ),
31
+               \lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ),
32
+               \lsx_health_plan\functions\get_option( 'endpoint_recipe_single', 'recipe' ),
33
+               \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ),
34
+               \lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' ),
35
+          );
36
+          add_action( 'cmb2_admin_init', array( $this, 'related_articles_metabox' ) );
37
+     }
38 38
 
39
-	/**
40
-	 * Return an instance of this class.
41
-	 *
42
-	 * @since 1.0.0
43
-	 *
44
-	 * @return    object \lsx_health_plan\classes\Articles()    A single instance of this class.
45
-	 */
46
-	public static function get_instance() {
47
-		// If the single instance hasn't been set, set it now.
48
-		if ( null === self::$instance ) {
49
-			self::$instance = new self();
50
-		}
51
-		return self::$instance;
52
-	}
39
+     /**
40
+      * Return an instance of this class.
41
+      *
42
+      * @since 1.0.0
43
+      *
44
+      * @return    object \lsx_health_plan\classes\Articles()    A single instance of this class.
45
+      */
46
+     public static function get_instance() {
47
+          // If the single instance hasn't been set, set it now.
48
+          if ( null === self::$instance ) {
49
+               self::$instance = new self();
50
+          }
51
+          return self::$instance;
52
+     }
53 53
 
54
-	/**
55
-	 * Define the related articles member metabox and field configurations.
56
-	 */
57
-	public function related_articles_metabox() {
58
-		foreach ( $this->default_types as $type => $default_type ) {
59
-			$cmb = new_cmb2_box(
60
-				array(
61
-					'id'           => $default_type . '_related_articles_metabox',
62
-					'title'        => __( 'Related Articles', 'lsx-health-plan' ),
63
-					'object_types' => array( $default_type ), // Post type.
64
-					'context'      => 'normal',
65
-					'priority'     => 'low',
66
-					'show_names'   => true,
67
-				)
68
-			);
54
+     /**
55
+      * Define the related articles member metabox and field configurations.
56
+      */
57
+     public function related_articles_metabox() {
58
+          foreach ( $this->default_types as $type => $default_type ) {
59
+               $cmb = new_cmb2_box(
60
+                    array(
61
+                         'id'           => $default_type . '_related_articles_metabox',
62
+                         'title'        => __( 'Related Articles', 'lsx-health-plan' ),
63
+                         'object_types' => array( $default_type ), // Post type.
64
+                         'context'      => 'normal',
65
+                         'priority'     => 'low',
66
+                         'show_names'   => true,
67
+                    )
68
+               );
69 69
 
70
-			$cmb->add_field(
71
-				array(
72
-					'name'       => __( 'Related Articles', 'lsx-health-plan' ),
73
-					'desc'       => __( 'Connect the related articles that applies to this ', 'lsx-health-plan' ) . $default_type,
74
-					'id'         => $default_type . '_connected_articles',
75
-					'type'       => 'post_search_ajax',
76
-					'limit'      => 3,  // Limit selection to X items only (default 1).
77
-					'sortable'   => true, // Allow selected items to be sortable (default false).
78
-					'query_args' => array(
79
-						'post_type'      => array( 'post' ),
80
-						'post_status'    => array( 'publish' ),
81
-						'posts_per_page' => -1,
82
-					),
83
-				)
84
-			);
85
-		}
70
+               $cmb->add_field(
71
+                    array(
72
+                         'name'       => __( 'Related Articles', 'lsx-health-plan' ),
73
+                         'desc'       => __( 'Connect the related articles that applies to this ', 'lsx-health-plan' ) . $default_type,
74
+                         'id'         => $default_type . '_connected_articles',
75
+                         'type'       => 'post_search_ajax',
76
+                         'limit'      => 3,  // Limit selection to X items only (default 1).
77
+                         'sortable'   => true, // Allow selected items to be sortable (default false).
78
+                         'query_args' => array(
79
+                              'post_type'      => array( 'post' ),
80
+                              'post_status'    => array( 'publish' ),
81
+                              'posts_per_page' => -1,
82
+                         ),
83
+                    )
84
+               );
85
+          }
86 86
 
87
-	}
87
+     }
88 88
 
89 89
 }
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 	 */
28 28
 	public function __construct() {
29 29
 		$this->default_types = array(
30
-			\lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' ),
31
-			\lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ),
32
-			\lsx_health_plan\functions\get_option( 'endpoint_recipe_single', 'recipe' ),
33
-			\lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ),
34
-			\lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' ),
30
+			\lsx_health_plan\functions\get_option('endpoint_meal', 'meal'),
31
+			\lsx_health_plan\functions\get_option('endpoint_exercise_single', 'exercise'),
32
+			\lsx_health_plan\functions\get_option('endpoint_recipe_single', 'recipe'),
33
+			\lsx_health_plan\functions\get_option('endpoint_workout', 'workout'),
34
+			\lsx_health_plan\functions\get_option('endpoint_plan', 'plan'),
35 35
 		);
36
-		add_action( 'cmb2_admin_init', array( $this, 'related_articles_metabox' ) );
36
+		add_action('cmb2_admin_init', array($this, 'related_articles_metabox'));
37 37
 	}
38 38
 
39 39
 	/**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 */
46 46
 	public static function get_instance() {
47 47
 		// If the single instance hasn't been set, set it now.
48
-		if ( null === self::$instance ) {
48
+		if (null === self::$instance) {
49 49
 			self::$instance = new self();
50 50
 		}
51 51
 		return self::$instance;
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
 	 * Define the related articles member metabox and field configurations.
56 56
 	 */
57 57
 	public function related_articles_metabox() {
58
-		foreach ( $this->default_types as $type => $default_type ) {
58
+		foreach ($this->default_types as $type => $default_type) {
59 59
 			$cmb = new_cmb2_box(
60 60
 				array(
61 61
 					'id'           => $default_type . '_related_articles_metabox',
62
-					'title'        => __( 'Related Articles', 'lsx-health-plan' ),
63
-					'object_types' => array( $default_type ), // Post type.
62
+					'title'        => __('Related Articles', 'lsx-health-plan'),
63
+					'object_types' => array($default_type), // Post type.
64 64
 					'context'      => 'normal',
65 65
 					'priority'     => 'low',
66 66
 					'show_names'   => true,
@@ -69,15 +69,15 @@  discard block
 block discarded – undo
69 69
 
70 70
 			$cmb->add_field(
71 71
 				array(
72
-					'name'       => __( 'Related Articles', 'lsx-health-plan' ),
73
-					'desc'       => __( 'Connect the related articles that applies to this ', 'lsx-health-plan' ) . $default_type,
72
+					'name'       => __('Related Articles', 'lsx-health-plan'),
73
+					'desc'       => __('Connect the related articles that applies to this ', 'lsx-health-plan') . $default_type,
74 74
 					'id'         => $default_type . '_connected_articles',
75 75
 					'type'       => 'post_search_ajax',
76
-					'limit'      => 3,  // Limit selection to X items only (default 1).
76
+					'limit'      => 3, // Limit selection to X items only (default 1).
77 77
 					'sortable'   => true, // Allow selected items to be sortable (default false).
78 78
 					'query_args' => array(
79
-						'post_type'      => array( 'post' ),
80
-						'post_status'    => array( 'publish' ),
79
+						'post_type'      => array('post'),
80
+						'post_status'    => array('publish'),
81 81
 						'posts_per_page' => -1,
82 82
 					),
83 83
 				)
Please login to merge, or discard this patch.
classes/integrations/class-lsx-team.php 2 patches
Indentation   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -8,141 +8,141 @@
 block discarded – undo
8 8
  */
9 9
 class LSX_Team {
10 10
 
11
-	/**
12
-	 * Holds class instance
13
-	 *
14
-	 * @var      object \lsx_health_plan\classes\LSX_Team()
15
-	 */
16
-	protected static $instance = null;
11
+     /**
12
+      * Holds class instance
13
+      *
14
+      * @var      object \lsx_health_plan\classes\LSX_Team()
15
+      */
16
+     protected static $instance = null;
17 17
 
18
-	/**
19
-	 * Constructor.
20
-	 */
21
-	public function __construct() {
22
-		$this->default_types = array(
23
-			\lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' ),
24
-			\lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ),
25
-			\lsx_health_plan\functions\get_option( 'endpoint_recipe_single', 'recipe' ),
26
-			\lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ),
27
-			\lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' ),
28
-		);
29
-		add_action( 'wp_enqueue_scripts', array( $this, 'assets' ), 5 );
30
-		add_action( 'cmb2_admin_init', array( $this, 'related_team_metabox' ) );
31
-		add_action( 'cmb2_admin_init', array( $this, 'additional_single_team_metabox' ) );
32
-		add_action( 'lsx_entry_bottom', array( $this, 'hp_team_member_tabs' ) );
33
-	}
18
+     /**
19
+      * Constructor.
20
+      */
21
+     public function __construct() {
22
+          $this->default_types = array(
23
+               \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' ),
24
+               \lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ),
25
+               \lsx_health_plan\functions\get_option( 'endpoint_recipe_single', 'recipe' ),
26
+               \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ),
27
+               \lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' ),
28
+          );
29
+          add_action( 'wp_enqueue_scripts', array( $this, 'assets' ), 5 );
30
+          add_action( 'cmb2_admin_init', array( $this, 'related_team_metabox' ) );
31
+          add_action( 'cmb2_admin_init', array( $this, 'additional_single_team_metabox' ) );
32
+          add_action( 'lsx_entry_bottom', array( $this, 'hp_team_member_tabs' ) );
33
+     }
34 34
 
35
-	/**
36
-	 * Return an instance of this class.
37
-	 *
38
-	 * @since 1.0.0
39
-	 *
40
-	 * @return    object \lsx_health_plan\classes\LSX_Team()    A single instance of this class.
41
-	 */
42
-	public static function get_instance() {
43
-		// If the single instance hasn't been set, set it now.
44
-		if ( null === self::$instance ) {
45
-			self::$instance = new self();
46
-		}
47
-		return self::$instance;
48
-	}
35
+     /**
36
+      * Return an instance of this class.
37
+      *
38
+      * @since 1.0.0
39
+      *
40
+      * @return    object \lsx_health_plan\classes\LSX_Team()    A single instance of this class.
41
+      */
42
+     public static function get_instance() {
43
+          // If the single instance hasn't been set, set it now.
44
+          if ( null === self::$instance ) {
45
+               self::$instance = new self();
46
+          }
47
+          return self::$instance;
48
+     }
49 49
 
50
-	/**
51
-	 * Load lsx team related css.
52
-	 *
53
-	 * @package    lsx
54
-	 * @subpackage lsx-health-plan
55
-	 *
56
-	 */
57
-	public function assets() {
58
-		wp_enqueue_style( 'lsx-health-plan-team', LSX_HEALTH_PLAN_URL . 'assets/css/lsx-health-plan-team.css', array(), LSX_HEALTH_PLAN_VER );
59
-	}
50
+     /**
51
+      * Load lsx team related css.
52
+      *
53
+      * @package    lsx
54
+      * @subpackage lsx-health-plan
55
+      *
56
+      */
57
+     public function assets() {
58
+          wp_enqueue_style( 'lsx-health-plan-team', LSX_HEALTH_PLAN_URL . 'assets/css/lsx-health-plan-team.css', array(), LSX_HEALTH_PLAN_VER );
59
+     }
60 60
 
61
-	/**
62
-	 * Define the related team member metabox and field configurations.
63
-	 */
64
-	public function related_team_metabox() {
65
-		foreach ( $this->default_types as $type => $default_type ) {
66
-			$cmb = new_cmb2_box(
67
-				array(
68
-					'id'           => $default_type . '_related_team_member__metabox',
69
-					'title'        => __( 'Related Team Member', 'lsx-health-plan' ),
70
-					'object_types' => array( $default_type ), // Post type.
71
-					'context'      => 'normal',
72
-					'priority'     => 'low',
73
-					'show_names'   => true,
74
-				)
75
-			);
61
+     /**
62
+      * Define the related team member metabox and field configurations.
63
+      */
64
+     public function related_team_metabox() {
65
+          foreach ( $this->default_types as $type => $default_type ) {
66
+               $cmb = new_cmb2_box(
67
+                    array(
68
+                         'id'           => $default_type . '_related_team_member__metabox',
69
+                         'title'        => __( 'Related Team Member', 'lsx-health-plan' ),
70
+                         'object_types' => array( $default_type ), // Post type.
71
+                         'context'      => 'normal',
72
+                         'priority'     => 'low',
73
+                         'show_names'   => true,
74
+                    )
75
+               );
76 76
 
77
-			$cmb->add_field(
78
-				array(
79
-					'name'       => __( 'Related Team Member', 'lsx-health-plan' ),
80
-					'desc'       => __( 'Connect the related team member that applies to this ', 'lsx-health-plan' ) . $default_type,
81
-					'id'         => $default_type . '_connected_team_member',
82
-					'type'       => 'post_search_ajax',
83
-					'limit'      => 4,  // Limit selection to X items only (default 1).
84
-					'sortable'   => true, // Allow selected items to be sortable (default false).
85
-					'query_args' => array(
86
-						'post_type'      => array( 'team' ),
87
-						'post_status'    => array( 'publish' ),
88
-						'posts_per_page' => -1,
89
-					),
90
-				)
91
-			);
92
-		}
77
+               $cmb->add_field(
78
+                    array(
79
+                         'name'       => __( 'Related Team Member', 'lsx-health-plan' ),
80
+                         'desc'       => __( 'Connect the related team member that applies to this ', 'lsx-health-plan' ) . $default_type,
81
+                         'id'         => $default_type . '_connected_team_member',
82
+                         'type'       => 'post_search_ajax',
83
+                         'limit'      => 4,  // Limit selection to X items only (default 1).
84
+                         'sortable'   => true, // Allow selected items to be sortable (default false).
85
+                         'query_args' => array(
86
+                              'post_type'      => array( 'team' ),
87
+                              'post_status'    => array( 'publish' ),
88
+                              'posts_per_page' => -1,
89
+                         ),
90
+                    )
91
+               );
92
+          }
93 93
 
94
-	}
94
+     }
95 95
 
96
-	/**
97
-	 * Adding additional custom fields to the single members, related with Health Plan.
98
-	 */
99
-	public function additional_single_team_metabox() {
100
-		$cmb = new_cmb2_box(
101
-			array(
102
-				'id'           => 'lsx__team',
103
-				'title'        => '',
104
-				'object_types' => array( 'team' ), // Post type.
105
-				'context'      => 'normal',
106
-				'priority'     => 'high',
107
-				'show_names'   => true,
108
-			)
109
-		);
96
+     /**
97
+      * Adding additional custom fields to the single members, related with Health Plan.
98
+      */
99
+     public function additional_single_team_metabox() {
100
+          $cmb = new_cmb2_box(
101
+               array(
102
+                    'id'           => 'lsx__team',
103
+                    'title'        => '',
104
+                    'object_types' => array( 'team' ), // Post type.
105
+                    'context'      => 'normal',
106
+                    'priority'     => 'high',
107
+                    'show_names'   => true,
108
+               )
109
+          );
110 110
 
111
-		$cmb->add_field(
112
-			array(
113
-				'name'       => __( 'Team Member Experience', 'lsx-health-plan' ),
114
-				'desc'       => __( 'Add additional experience to this team member', 'lsx-health-plan' ),
115
-				'id'         => 'team_member_experience',
116
-				'type'       => 'wysiwyg',
117
-			)
118
-		);
111
+          $cmb->add_field(
112
+               array(
113
+                    'name'       => __( 'Team Member Experience', 'lsx-health-plan' ),
114
+                    'desc'       => __( 'Add additional experience to this team member', 'lsx-health-plan' ),
115
+                    'id'         => 'team_member_experience',
116
+                    'type'       => 'wysiwyg',
117
+               )
118
+          );
119 119
 
120
-		$cmb->add_field(
121
-			array(
122
-				'name'       => __( 'Featured Plans', 'lsx-health-plan' ),
123
-				'desc'       => __( 'Connect the related plans to this team member', 'lsx-health-plan' ),
124
-				'id'         => 'connected_team_member_plan',
125
-				'type'       => 'post_search_ajax',
126
-				'limit'      => 3,
127
-				'sortable'   => true,
128
-				'query_args' => array(
129
-					'post_type'      => array( 'plan' ),
130
-					'post_status'    => array( 'publish' ),
131
-					'posts_per_page' => -1,
132
-				),
133
-			)
134
-		);
120
+          $cmb->add_field(
121
+               array(
122
+                    'name'       => __( 'Featured Plans', 'lsx-health-plan' ),
123
+                    'desc'       => __( 'Connect the related plans to this team member', 'lsx-health-plan' ),
124
+                    'id'         => 'connected_team_member_plan',
125
+                    'type'       => 'post_search_ajax',
126
+                    'limit'      => 3,
127
+                    'sortable'   => true,
128
+                    'query_args' => array(
129
+                         'post_type'      => array( 'plan' ),
130
+                         'post_status'    => array( 'publish' ),
131
+                         'posts_per_page' => -1,
132
+                    ),
133
+               )
134
+          );
135 135
 
136
-	}
136
+     }
137 137
 
138
-	/**
139
-	 * Adds custom tabs to the team member single pages.
140
-	 *
141
-	 * @return void
142
-	 */
143
-	public function hp_team_member_tabs() {
144
-		if ( is_single() && is_singular( 'team' ) ) {
145
-			require_once LSX_HEALTH_PLAN_PATH . '/includes/template-tags/team.php';
146
-		}
147
-	}
138
+     /**
139
+      * Adds custom tabs to the team member single pages.
140
+      *
141
+      * @return void
142
+      */
143
+     public function hp_team_member_tabs() {
144
+          if ( is_single() && is_singular( 'team' ) ) {
145
+               require_once LSX_HEALTH_PLAN_PATH . '/includes/template-tags/team.php';
146
+          }
147
+     }
148 148
 }
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -20,16 +20,16 @@  discard block
 block discarded – undo
20 20
 	 */
21 21
 	public function __construct() {
22 22
 		$this->default_types = array(
23
-			\lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' ),
24
-			\lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ),
25
-			\lsx_health_plan\functions\get_option( 'endpoint_recipe_single', 'recipe' ),
26
-			\lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ),
27
-			\lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' ),
23
+			\lsx_health_plan\functions\get_option('endpoint_meal', 'meal'),
24
+			\lsx_health_plan\functions\get_option('endpoint_exercise_single', 'exercise'),
25
+			\lsx_health_plan\functions\get_option('endpoint_recipe_single', 'recipe'),
26
+			\lsx_health_plan\functions\get_option('endpoint_workout', 'workout'),
27
+			\lsx_health_plan\functions\get_option('endpoint_plan', 'plan'),
28 28
 		);
29
-		add_action( 'wp_enqueue_scripts', array( $this, 'assets' ), 5 );
30
-		add_action( 'cmb2_admin_init', array( $this, 'related_team_metabox' ) );
31
-		add_action( 'cmb2_admin_init', array( $this, 'additional_single_team_metabox' ) );
32
-		add_action( 'lsx_entry_bottom', array( $this, 'hp_team_member_tabs' ) );
29
+		add_action('wp_enqueue_scripts', array($this, 'assets'), 5);
30
+		add_action('cmb2_admin_init', array($this, 'related_team_metabox'));
31
+		add_action('cmb2_admin_init', array($this, 'additional_single_team_metabox'));
32
+		add_action('lsx_entry_bottom', array($this, 'hp_team_member_tabs'));
33 33
 	}
34 34
 
35 35
 	/**
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 */
42 42
 	public static function get_instance() {
43 43
 		// If the single instance hasn't been set, set it now.
44
-		if ( null === self::$instance ) {
44
+		if (null === self::$instance) {
45 45
 			self::$instance = new self();
46 46
 		}
47 47
 		return self::$instance;
@@ -55,19 +55,19 @@  discard block
 block discarded – undo
55 55
 	 *
56 56
 	 */
57 57
 	public function assets() {
58
-		wp_enqueue_style( 'lsx-health-plan-team', LSX_HEALTH_PLAN_URL . 'assets/css/lsx-health-plan-team.css', array(), LSX_HEALTH_PLAN_VER );
58
+		wp_enqueue_style('lsx-health-plan-team', LSX_HEALTH_PLAN_URL . 'assets/css/lsx-health-plan-team.css', array(), LSX_HEALTH_PLAN_VER);
59 59
 	}
60 60
 
61 61
 	/**
62 62
 	 * Define the related team member metabox and field configurations.
63 63
 	 */
64 64
 	public function related_team_metabox() {
65
-		foreach ( $this->default_types as $type => $default_type ) {
65
+		foreach ($this->default_types as $type => $default_type) {
66 66
 			$cmb = new_cmb2_box(
67 67
 				array(
68 68
 					'id'           => $default_type . '_related_team_member__metabox',
69
-					'title'        => __( 'Related Team Member', 'lsx-health-plan' ),
70
-					'object_types' => array( $default_type ), // Post type.
69
+					'title'        => __('Related Team Member', 'lsx-health-plan'),
70
+					'object_types' => array($default_type), // Post type.
71 71
 					'context'      => 'normal',
72 72
 					'priority'     => 'low',
73 73
 					'show_names'   => true,
@@ -76,15 +76,15 @@  discard block
 block discarded – undo
76 76
 
77 77
 			$cmb->add_field(
78 78
 				array(
79
-					'name'       => __( 'Related Team Member', 'lsx-health-plan' ),
80
-					'desc'       => __( 'Connect the related team member that applies to this ', 'lsx-health-plan' ) . $default_type,
79
+					'name'       => __('Related Team Member', 'lsx-health-plan'),
80
+					'desc'       => __('Connect the related team member that applies to this ', 'lsx-health-plan') . $default_type,
81 81
 					'id'         => $default_type . '_connected_team_member',
82 82
 					'type'       => 'post_search_ajax',
83
-					'limit'      => 4,  // Limit selection to X items only (default 1).
83
+					'limit'      => 4, // Limit selection to X items only (default 1).
84 84
 					'sortable'   => true, // Allow selected items to be sortable (default false).
85 85
 					'query_args' => array(
86
-						'post_type'      => array( 'team' ),
87
-						'post_status'    => array( 'publish' ),
86
+						'post_type'      => array('team'),
87
+						'post_status'    => array('publish'),
88 88
 						'posts_per_page' => -1,
89 89
 					),
90 90
 				)
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 			array(
102 102
 				'id'           => 'lsx__team',
103 103
 				'title'        => '',
104
-				'object_types' => array( 'team' ), // Post type.
104
+				'object_types' => array('team'), // Post type.
105 105
 				'context'      => 'normal',
106 106
 				'priority'     => 'high',
107 107
 				'show_names'   => true,
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
 
111 111
 		$cmb->add_field(
112 112
 			array(
113
-				'name'       => __( 'Team Member Experience', 'lsx-health-plan' ),
114
-				'desc'       => __( 'Add additional experience to this team member', 'lsx-health-plan' ),
113
+				'name'       => __('Team Member Experience', 'lsx-health-plan'),
114
+				'desc'       => __('Add additional experience to this team member', 'lsx-health-plan'),
115 115
 				'id'         => 'team_member_experience',
116 116
 				'type'       => 'wysiwyg',
117 117
 			)
@@ -119,15 +119,15 @@  discard block
 block discarded – undo
119 119
 
120 120
 		$cmb->add_field(
121 121
 			array(
122
-				'name'       => __( 'Featured Plans', 'lsx-health-plan' ),
123
-				'desc'       => __( 'Connect the related plans to this team member', 'lsx-health-plan' ),
122
+				'name'       => __('Featured Plans', 'lsx-health-plan'),
123
+				'desc'       => __('Connect the related plans to this team member', 'lsx-health-plan'),
124 124
 				'id'         => 'connected_team_member_plan',
125 125
 				'type'       => 'post_search_ajax',
126 126
 				'limit'      => 3,
127 127
 				'sortable'   => true,
128 128
 				'query_args' => array(
129
-					'post_type'      => array( 'plan' ),
130
-					'post_status'    => array( 'publish' ),
129
+					'post_type'      => array('plan'),
130
+					'post_status'    => array('publish'),
131 131
 					'posts_per_page' => -1,
132 132
 				),
133 133
 			)
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	 * @return void
142 142
 	 */
143 143
 	public function hp_team_member_tabs() {
144
-		if ( is_single() && is_singular( 'team' ) ) {
144
+		if (is_single() && is_singular('team')) {
145 145
 			require_once LSX_HEALTH_PLAN_PATH . '/includes/template-tags/team.php';
146 146
 		}
147 147
 	}
Please login to merge, or discard this patch.
classes/class-integrations.php 2 patches
Indentation   +165 added lines, -165 removed lines patch added patch discarded remove patch
@@ -8,169 +8,169 @@
 block discarded – undo
8 8
  */
9 9
 class Integrations {
10 10
 
11
-	/**
12
-	 * Holds class instance
13
-	 *
14
-	 * @since 1.0.0
15
-	 *
16
-	 * @var      object \lsx_health_plan\classes\Integrations()
17
-	 */
18
-	protected static $instance = null;
19
-
20
-	/**
21
-	 * Holds class instance
22
-	 *
23
-	 * @since 1.0.0
24
-	 *
25
-	 * @var      object \MAG_CMB2_Field_Post_Search_Ajax()
26
-	 */
27
-	public $cmb2_post_search_ajax = false;
28
-
29
-	/**
30
-	 * Holds class instance
31
-	 *
32
-	 * @since 1.0.0
33
-	 *
34
-	 * @var      object \lsx_health_plan\classes\Download_Monitor()
35
-	 */
36
-	public $download_monitor = false;
37
-
38
-	/**
39
-	 * Holds class instance
40
-	 *
41
-	 * @since 1.0.0
42
-	 *
43
-	 * @var      object \lsx_health_plan\classes\Woocommerce()
44
-	 */
45
-	public $woocommerce = false;
46
-
47
-	/**
48
-	 * Holds class instance
49
-	 *
50
-	 * @since 1.0.0
51
-	 *
52
-	 * @var      object \lsx_health_plan\classes\WP_User_Avatar()
53
-	 */
54
-	public $wp_user_avatar = false;
55
-
56
-	/**
57
-	 * Holds class instance
58
-	 *
59
-	 * @since 1.0.0
60
-	 *
61
-	 * @var      object \lsx_health_plan\classes\FacetWP()
62
-	 */
63
-	public $facetwp = false;
64
-
65
-	/**
66
-	 * Constructor
67
-	 */
68
-	public function __construct() {
69
-		add_action( 'init', array( $this, 'cmb2_post_search_ajax' ) );
70
-		add_action( 'init', array( $this, 'download_monitor_init' ) );
71
-		add_action( 'init', array( $this, 'woocommerce_init' ) );
72
-		add_action( 'init', array( $this, 'wp_user_avatar_init' ) );
73
-		add_action( 'init', array( $this, 'facetwp_init' ) );
74
-		add_action( 'init', array( $this, 'lsx_team_init' ) );
75
-		add_action( 'init', array( $this, 'lsx_article_init' ) );
76
-	}
77
-
78
-	/**
79
-	 * Return an instance of this class.
80
-	 *
81
-	 * @since 1.0.0
82
-	 *
83
-	 * @return    object \lsx_health_plan\classes\Integrations()    A single instance of this class.
84
-	 */
85
-	public static function get_instance() {
86
-		// If the single instance hasn't been set, set it now.
87
-		if ( null === self::$instance ) {
88
-			self::$instance = new self();
89
-		}
90
-		return self::$instance;
91
-	}
92
-
93
-	/**
94
-	 * Includes the Post Search Ajax if it is there.
95
-	 *
96
-	 * @return void
97
-	 */
98
-	public function cmb2_post_search_ajax() {
99
-		require_once LSX_HEALTH_PLAN_PATH . 'vendor/lsx-field-post-search-ajax/cmb-field-post-search-ajax.php';
100
-		if ( method_exists( 'MAG_CMB2_Field_Post_Search_Ajax', 'get_instance' ) ) {
101
-			$this->cmb2_post_search_ajax = \MAG_CMB2_Field_Post_Search_Ajax::get_instance();
102
-		}
103
-	}
104
-
105
-	/**
106
-	 * Includes the Post Search Ajax if it is there.
107
-	 *
108
-	 * @return void
109
-	 */
110
-	public function download_monitor_init() {
111
-		if ( function_exists( 'download_monitor' ) ) {
112
-			require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-download-monitor.php';
113
-			$this->download_monitor = Download_Monitor::get_instance();
114
-		}
115
-	}
116
-
117
-	/**
118
-	 * Includes the Woocommerce functions.
119
-	 *
120
-	 * @return void
121
-	 */
122
-	public function woocommerce_init() {
123
-		if ( function_exists( 'WC' ) ) {
124
-			require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-woocommerce.php';
125
-			$this->woocommerce = Woocommerce::get_instance();
126
-		}
127
-	}
128
-
129
-	/**
130
-	 * Includes the Woocommerce functions.
131
-	 *
132
-	 * @return void
133
-	 */
134
-	public function wp_user_avatar_init() {
135
-		if ( class_exists( 'WP_User_Avatar_Setup' ) ) {
136
-			require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-wp-user-avatar.php';
137
-			$this->wp_user_avatar = WP_User_Avatar::get_instance();
138
-		}
139
-	}
140
-
141
-	/**
142
-	 * Includes the FacetWP Indexer Filters.
143
-	 *
144
-	 * @return void
145
-	 */
146
-	public function facetwp_init() {
147
-		if ( class_exists( 'FacetWP' ) ) {
148
-			require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-facetwp.php';
149
-			$this->facetwp = FacetWP::get_instance();
150
-		}
151
-	}
152
-
153
-	/**
154
-	 * Includes the LSX Team Integration.
155
-	 *
156
-	 * @return void
157
-	 */
158
-	public function lsx_team_init() {
159
-		if ( class_exists( 'LSX_Team' ) ) {
160
-			require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-lsx-team.php';
161
-			$this->team = LSX_Team::get_instance();
162
-		}
163
-	}
164
-
165
-	/**
166
-	 * Includes the Blog Integration.
167
-	 *
168
-	 * @return void
169
-	 */
170
-	public function lsx_article_init() {
171
-		if ( wp_count_posts()->publish > 0 ) {
172
-			require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-articles.php';
173
-			$this->article = Articles::get_instance();
174
-		}
175
-	}
11
+     /**
12
+      * Holds class instance
13
+      *
14
+      * @since 1.0.0
15
+      *
16
+      * @var      object \lsx_health_plan\classes\Integrations()
17
+      */
18
+     protected static $instance = null;
19
+
20
+     /**
21
+      * Holds class instance
22
+      *
23
+      * @since 1.0.0
24
+      *
25
+      * @var      object \MAG_CMB2_Field_Post_Search_Ajax()
26
+      */
27
+     public $cmb2_post_search_ajax = false;
28
+
29
+     /**
30
+      * Holds class instance
31
+      *
32
+      * @since 1.0.0
33
+      *
34
+      * @var      object \lsx_health_plan\classes\Download_Monitor()
35
+      */
36
+     public $download_monitor = false;
37
+
38
+     /**
39
+      * Holds class instance
40
+      *
41
+      * @since 1.0.0
42
+      *
43
+      * @var      object \lsx_health_plan\classes\Woocommerce()
44
+      */
45
+     public $woocommerce = false;
46
+
47
+     /**
48
+      * Holds class instance
49
+      *
50
+      * @since 1.0.0
51
+      *
52
+      * @var      object \lsx_health_plan\classes\WP_User_Avatar()
53
+      */
54
+     public $wp_user_avatar = false;
55
+
56
+     /**
57
+      * Holds class instance
58
+      *
59
+      * @since 1.0.0
60
+      *
61
+      * @var      object \lsx_health_plan\classes\FacetWP()
62
+      */
63
+     public $facetwp = false;
64
+
65
+     /**
66
+      * Constructor
67
+      */
68
+     public function __construct() {
69
+          add_action( 'init', array( $this, 'cmb2_post_search_ajax' ) );
70
+          add_action( 'init', array( $this, 'download_monitor_init' ) );
71
+          add_action( 'init', array( $this, 'woocommerce_init' ) );
72
+          add_action( 'init', array( $this, 'wp_user_avatar_init' ) );
73
+          add_action( 'init', array( $this, 'facetwp_init' ) );
74
+          add_action( 'init', array( $this, 'lsx_team_init' ) );
75
+          add_action( 'init', array( $this, 'lsx_article_init' ) );
76
+     }
77
+
78
+     /**
79
+      * Return an instance of this class.
80
+      *
81
+      * @since 1.0.0
82
+      *
83
+      * @return    object \lsx_health_plan\classes\Integrations()    A single instance of this class.
84
+      */
85
+     public static function get_instance() {
86
+          // If the single instance hasn't been set, set it now.
87
+          if ( null === self::$instance ) {
88
+               self::$instance = new self();
89
+          }
90
+          return self::$instance;
91
+     }
92
+
93
+     /**
94
+      * Includes the Post Search Ajax if it is there.
95
+      *
96
+      * @return void
97
+      */
98
+     public function cmb2_post_search_ajax() {
99
+          require_once LSX_HEALTH_PLAN_PATH . 'vendor/lsx-field-post-search-ajax/cmb-field-post-search-ajax.php';
100
+          if ( method_exists( 'MAG_CMB2_Field_Post_Search_Ajax', 'get_instance' ) ) {
101
+               $this->cmb2_post_search_ajax = \MAG_CMB2_Field_Post_Search_Ajax::get_instance();
102
+          }
103
+     }
104
+
105
+     /**
106
+      * Includes the Post Search Ajax if it is there.
107
+      *
108
+      * @return void
109
+      */
110
+     public function download_monitor_init() {
111
+          if ( function_exists( 'download_monitor' ) ) {
112
+               require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-download-monitor.php';
113
+               $this->download_monitor = Download_Monitor::get_instance();
114
+          }
115
+     }
116
+
117
+     /**
118
+      * Includes the Woocommerce functions.
119
+      *
120
+      * @return void
121
+      */
122
+     public function woocommerce_init() {
123
+          if ( function_exists( 'WC' ) ) {
124
+               require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-woocommerce.php';
125
+               $this->woocommerce = Woocommerce::get_instance();
126
+          }
127
+     }
128
+
129
+     /**
130
+      * Includes the Woocommerce functions.
131
+      *
132
+      * @return void
133
+      */
134
+     public function wp_user_avatar_init() {
135
+          if ( class_exists( 'WP_User_Avatar_Setup' ) ) {
136
+               require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-wp-user-avatar.php';
137
+               $this->wp_user_avatar = WP_User_Avatar::get_instance();
138
+          }
139
+     }
140
+
141
+     /**
142
+      * Includes the FacetWP Indexer Filters.
143
+      *
144
+      * @return void
145
+      */
146
+     public function facetwp_init() {
147
+          if ( class_exists( 'FacetWP' ) ) {
148
+               require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-facetwp.php';
149
+               $this->facetwp = FacetWP::get_instance();
150
+          }
151
+     }
152
+
153
+     /**
154
+      * Includes the LSX Team Integration.
155
+      *
156
+      * @return void
157
+      */
158
+     public function lsx_team_init() {
159
+          if ( class_exists( 'LSX_Team' ) ) {
160
+               require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-lsx-team.php';
161
+               $this->team = LSX_Team::get_instance();
162
+          }
163
+     }
164
+
165
+     /**
166
+      * Includes the Blog Integration.
167
+      *
168
+      * @return void
169
+      */
170
+     public function lsx_article_init() {
171
+          if ( wp_count_posts()->publish > 0 ) {
172
+               require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-articles.php';
173
+               $this->article = Articles::get_instance();
174
+          }
175
+     }
176 176
 }
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
 	 * Constructor
67 67
 	 */
68 68
 	public function __construct() {
69
-		add_action( 'init', array( $this, 'cmb2_post_search_ajax' ) );
70
-		add_action( 'init', array( $this, 'download_monitor_init' ) );
71
-		add_action( 'init', array( $this, 'woocommerce_init' ) );
72
-		add_action( 'init', array( $this, 'wp_user_avatar_init' ) );
73
-		add_action( 'init', array( $this, 'facetwp_init' ) );
74
-		add_action( 'init', array( $this, 'lsx_team_init' ) );
75
-		add_action( 'init', array( $this, 'lsx_article_init' ) );
69
+		add_action('init', array($this, 'cmb2_post_search_ajax'));
70
+		add_action('init', array($this, 'download_monitor_init'));
71
+		add_action('init', array($this, 'woocommerce_init'));
72
+		add_action('init', array($this, 'wp_user_avatar_init'));
73
+		add_action('init', array($this, 'facetwp_init'));
74
+		add_action('init', array($this, 'lsx_team_init'));
75
+		add_action('init', array($this, 'lsx_article_init'));
76 76
 	}
77 77
 
78 78
 	/**
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	 */
85 85
 	public static function get_instance() {
86 86
 		// If the single instance hasn't been set, set it now.
87
-		if ( null === self::$instance ) {
87
+		if (null === self::$instance) {
88 88
 			self::$instance = new self();
89 89
 		}
90 90
 		return self::$instance;
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	public function cmb2_post_search_ajax() {
99 99
 		require_once LSX_HEALTH_PLAN_PATH . 'vendor/lsx-field-post-search-ajax/cmb-field-post-search-ajax.php';
100
-		if ( method_exists( 'MAG_CMB2_Field_Post_Search_Ajax', 'get_instance' ) ) {
100
+		if (method_exists('MAG_CMB2_Field_Post_Search_Ajax', 'get_instance')) {
101 101
 			$this->cmb2_post_search_ajax = \MAG_CMB2_Field_Post_Search_Ajax::get_instance();
102 102
 		}
103 103
 	}
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 * @return void
109 109
 	 */
110 110
 	public function download_monitor_init() {
111
-		if ( function_exists( 'download_monitor' ) ) {
111
+		if (function_exists('download_monitor')) {
112 112
 			require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-download-monitor.php';
113 113
 			$this->download_monitor = Download_Monitor::get_instance();
114 114
 		}
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	 * @return void
121 121
 	 */
122 122
 	public function woocommerce_init() {
123
-		if ( function_exists( 'WC' ) ) {
123
+		if (function_exists('WC')) {
124 124
 			require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-woocommerce.php';
125 125
 			$this->woocommerce = Woocommerce::get_instance();
126 126
 		}
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 	 * @return void
133 133
 	 */
134 134
 	public function wp_user_avatar_init() {
135
-		if ( class_exists( 'WP_User_Avatar_Setup' ) ) {
135
+		if (class_exists('WP_User_Avatar_Setup')) {
136 136
 			require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-wp-user-avatar.php';
137 137
 			$this->wp_user_avatar = WP_User_Avatar::get_instance();
138 138
 		}
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 	 * @return void
145 145
 	 */
146 146
 	public function facetwp_init() {
147
-		if ( class_exists( 'FacetWP' ) ) {
147
+		if (class_exists('FacetWP')) {
148 148
 			require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-facetwp.php';
149 149
 			$this->facetwp = FacetWP::get_instance();
150 150
 		}
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 	 * @return void
157 157
 	 */
158 158
 	public function lsx_team_init() {
159
-		if ( class_exists( 'LSX_Team' ) ) {
159
+		if (class_exists('LSX_Team')) {
160 160
 			require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-lsx-team.php';
161 161
 			$this->team = LSX_Team::get_instance();
162 162
 		}
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	 * @return void
169 169
 	 */
170 170
 	public function lsx_article_init() {
171
-		if ( wp_count_posts()->publish > 0 ) {
171
+		if (wp_count_posts()->publish > 0) {
172 172
 			require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-articles.php';
173 173
 			$this->article = Articles::get_instance();
174 174
 		}
Please login to merge, or discard this patch.
lsx-health-plan.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 // If this file is called directly, abort.
15 15
 if ( ! defined( 'WPINC' ) ) {
16
-	die;
16
+     die;
17 17
 }
18 18
 define( 'LSX_HEALTH_PLAN_PATH', plugin_dir_path( __FILE__ ) );
19 19
 define( 'LSX_HEALTH_PLAN_CORE', __FILE__ );
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
  * @return void
31 31
  */
32 32
 function lsx_remove_extra_meta_box() {
33
-	global $wp_meta_boxes;
34
-	$all_post_types = [ 'plan', 'video', 'workout', 'tip', 'recipe', 'meal' ];
35
-	//remove_meta_box( 'wpseo_meta', $all_post_types, 'normal' );
36
-	remove_meta_box( 'commentsdiv', $all_post_types, 'normal' );
37
-	remove_meta_box( 'commentstatusdiv', $all_post_types, 'normal' );
38
-	remove_meta_box( 'lsx_blocks_title_meta', $all_post_types, 'side' );
33
+     global $wp_meta_boxes;
34
+     $all_post_types = [ 'plan', 'video', 'workout', 'tip', 'recipe', 'meal' ];
35
+     //remove_meta_box( 'wpseo_meta', $all_post_types, 'normal' );
36
+     remove_meta_box( 'commentsdiv', $all_post_types, 'normal' );
37
+     remove_meta_box( 'commentstatusdiv', $all_post_types, 'normal' );
38
+     remove_meta_box( 'lsx_blocks_title_meta', $all_post_types, 'side' );
39 39
 }
40 40
 add_action( 'add_meta_boxes', 'lsx_remove_extra_meta_box', 100 );
41 41
 
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
  * @return void
46 46
  */
47 47
 function lsx_login_redirect() {
48
-	$plan_slug = \lsx_health_plan\functions\get_option( 'my_plan_slug', false );
49
-	if ( false === $plan_slug ) {
50
-		$plan_slug = 'my-plan';
51
-	}
52
-	return home_url( $plan_slug );
48
+     $plan_slug = \lsx_health_plan\functions\get_option( 'my_plan_slug', false );
49
+     if ( false === $plan_slug ) {
50
+          $plan_slug = 'my-plan';
51
+     }
52
+     return home_url( $plan_slug );
53 53
 }
54 54
 add_filter( 'woocommerce_login_redirect', 'lsx_login_redirect' );
55 55
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
  * @return object lsx_health_plan\classes\Core::get_instance();
60 60
  */
61 61
 function lsx_health_plan() {
62
-	return \lsx_health_plan\classes\Core::get_instance();
62
+     return \lsx_health_plan\classes\Core::get_instance();
63 63
 }
64 64
 lsx_health_plan();
65 65
 
@@ -69,13 +69,13 @@  discard block
 block discarded – undo
69 69
  * @return void
70 70
  */
71 71
 function lsx_get_svg_icon( $icon ) {
72
-	$path = '/assets/images/';
72
+     $path = '/assets/images/';
73 73
 
74
-	if ( file_exists( LSX_HEALTH_PLAN_PATH . $path . $icon ) ) {
75
-		// Load and return the contents of the file.
76
-		return include LSX_HEALTH_PLAN_PATH . $path . $icon;
77
-	}
74
+     if ( file_exists( LSX_HEALTH_PLAN_PATH . $path . $icon ) ) {
75
+          // Load and return the contents of the file.
76
+          return include LSX_HEALTH_PLAN_PATH . $path . $icon;
77
+     }
78 78
 
79
-	// Return a blank string if we can't find the file.
80
-	return '';
79
+     // Return a blank string if we can't find the file.
80
+     return '';
81 81
 }
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -12,13 +12,13 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // If this file is called directly, abort.
15
-if ( ! defined( 'WPINC' ) ) {
15
+if ( ! defined('WPINC')) {
16 16
 	die;
17 17
 }
18
-define( 'LSX_HEALTH_PLAN_PATH', plugin_dir_path( __FILE__ ) );
19
-define( 'LSX_HEALTH_PLAN_CORE', __FILE__ );
20
-define( 'LSX_HEALTH_PLAN_URL', plugin_dir_url( __FILE__ ) );
21
-define( 'LSX_HEALTH_PLAN_VER', '1.4.0' );
18
+define('LSX_HEALTH_PLAN_PATH', plugin_dir_path(__FILE__));
19
+define('LSX_HEALTH_PLAN_CORE', __FILE__);
20
+define('LSX_HEALTH_PLAN_URL', plugin_dir_url(__FILE__));
21
+define('LSX_HEALTH_PLAN_VER', '1.4.0');
22 22
 
23 23
 /* ======================= Below is the Plugin Class init ========================= */
24 24
 
@@ -31,13 +31,13 @@  discard block
 block discarded – undo
31 31
  */
32 32
 function lsx_remove_extra_meta_box() {
33 33
 	global $wp_meta_boxes;
34
-	$all_post_types = [ 'plan', 'video', 'workout', 'tip', 'recipe', 'meal' ];
34
+	$all_post_types = ['plan', 'video', 'workout', 'tip', 'recipe', 'meal'];
35 35
 	//remove_meta_box( 'wpseo_meta', $all_post_types, 'normal' );
36
-	remove_meta_box( 'commentsdiv', $all_post_types, 'normal' );
37
-	remove_meta_box( 'commentstatusdiv', $all_post_types, 'normal' );
38
-	remove_meta_box( 'lsx_blocks_title_meta', $all_post_types, 'side' );
36
+	remove_meta_box('commentsdiv', $all_post_types, 'normal');
37
+	remove_meta_box('commentstatusdiv', $all_post_types, 'normal');
38
+	remove_meta_box('lsx_blocks_title_meta', $all_post_types, 'side');
39 39
 }
40
-add_action( 'add_meta_boxes', 'lsx_remove_extra_meta_box', 100 );
40
+add_action('add_meta_boxes', 'lsx_remove_extra_meta_box', 100);
41 41
 
42 42
 /**
43 43
  * Redirect user after login or redirect
@@ -45,13 +45,13 @@  discard block
 block discarded – undo
45 45
  * @return void
46 46
  */
47 47
 function lsx_login_redirect() {
48
-	$plan_slug = \lsx_health_plan\functions\get_option( 'my_plan_slug', false );
49
-	if ( false === $plan_slug ) {
48
+	$plan_slug = \lsx_health_plan\functions\get_option('my_plan_slug', false);
49
+	if (false === $plan_slug) {
50 50
 		$plan_slug = 'my-plan';
51 51
 	}
52
-	return home_url( $plan_slug );
52
+	return home_url($plan_slug);
53 53
 }
54
-add_filter( 'woocommerce_login_redirect', 'lsx_login_redirect' );
54
+add_filter('woocommerce_login_redirect', 'lsx_login_redirect');
55 55
 
56 56
 /**
57 57
  * Undocumented function
@@ -68,10 +68,10 @@  discard block
 block discarded – undo
68 68
  *
69 69
  * @return void
70 70
  */
71
-function lsx_get_svg_icon( $icon ) {
71
+function lsx_get_svg_icon($icon) {
72 72
 	$path = '/assets/images/';
73 73
 
74
-	if ( file_exists( LSX_HEALTH_PLAN_PATH . $path . $icon ) ) {
74
+	if (file_exists(LSX_HEALTH_PLAN_PATH . $path . $icon)) {
75 75
 		// Load and return the contents of the file.
76 76
 		return include LSX_HEALTH_PLAN_PATH . $path . $icon;
77 77
 	}
Please login to merge, or discard this patch.
includes/functions/triggers.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,5 +13,5 @@
 block discarded – undo
13 13
  * @return boolean
14 14
  */
15 15
 function disable_sharing( $disabled ) {
16
-	return true;
16
+     return true;
17 17
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,6 +12,6 @@
 block discarded – undo
12 12
  *
13 13
  * @return boolean
14 14
  */
15
-function disable_sharing( $disabled ) {
15
+function disable_sharing($disabled) {
16 16
 	return true;
17 17
 }
Please login to merge, or discard this patch.
templates/single-plan.php 2 patches
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 
12 12
 <?php
13 13
 $args = array(
14
-	'post_parent' => get_the_ID(),
15
-	'post_type'   => 'plan',
14
+     'post_parent' => get_the_ID(),
15
+     'post_type'   => 'plan',
16 16
 );
17 17
 
18 18
 $plan_id      = get_the_ID();
@@ -29,23 +29,23 @@  discard block
 block discarded – undo
29 29
 $small_description = get_post_meta( get_the_ID(), ( $plan . '_short_description' ), true );
30 30
 
31 31
 if ( ! empty( $has_sections ) ) {
32
-	$plan_type_class = 'parent-plan';
33
-	if ( 0 !== $has_parent ) {
34
-		$plan_type_class = 'parent-sub-plan';
35
-	}
32
+     $plan_type_class = 'parent-plan';
33
+     if ( 0 !== $has_parent ) {
34
+          $plan_type_class = 'parent-sub-plan';
35
+     }
36 36
 } else {
37
-	$plan_type_class = 'unique-plan';
38
-	if ( 0 !== $has_parent ) {
39
-		$plan_type_class = 'child-plan-' . $has_parent;
40
-	}
37
+     $plan_type_class = 'unique-plan';
38
+     if ( 0 !== $has_parent ) {
39
+          $plan_type_class = 'child-plan-' . $has_parent;
40
+     }
41 41
 }
42 42
 
43 43
 // Get the plan restrictions.
44 44
 if ( function_exists( 'wc_memberships_is_post_content_restricted' ) && wc_memberships_is_post_content_restricted( get_the_ID() ) ) {
45
-	$restricted = ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
45
+     $restricted = ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
46 46
 }
47 47
 if ( false === $restricted ) {
48
-	$round_progress = round( \lsx_health_plan\functions\get_progress( get_the_ID() ), 0 );
48
+     $round_progress = round( \lsx_health_plan\functions\get_progress( get_the_ID() ), 0 );
49 49
 }
50 50
 ?>
51 51
 
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
 			</div>
64 64
 
65 65
 			<?php
66
-			if ( ! empty( $has_sections ) ) {
67
-				if ( false === $is_section ) {
68
-					?>
66
+               if ( ! empty( $has_sections ) ) {
67
+                    if ( false === $is_section ) {
68
+                         ?>
69 69
 					<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
70 70
 						<div class="entry-content">
71 71
 							<div class="single-plan-inner main-plan-content">
@@ -73,47 +73,47 @@  discard block
 block discarded – undo
73 73
 									<?php lsx_get_svg_icon( 'meal.svg' ); ?>
74 74
 									<h2><?php echo esc_html_e( 'Your Plan', 'lsx-health-plan' ); ?></h2>
75 75
 									<?php if ( class_exists( 'LSX_Sharing' ) ) {
76
-										lsx_content_sharing();
77
-									} ?>
76
+                                                  lsx_content_sharing();
77
+                                             } ?>
78 78
 								</div>
79 79
 								<div class="plan">
80 80
 									<div class="set-box set content-box entry-content">
81 81
 										<div class="plan-top-content">
82 82
 										<?php
83
-										if ( $connected_members ) {
84
-											echo wp_kses_post( lsx_hp_member_connected( $connected_members, $plan ) );
85
-										}
86
-										if ( false === $restricted ) {
87
-											echo wp_kses_post( '<span class="progress"><progress class="bar" value="' . $round_progress . '" max="100"> ' . $round_progress . '% </progress><span>' . $round_progress . '%</span></span>' );
88
-										}
89
-										if ( $small_description ) {
90
-											?>
83
+                                                  if ( $connected_members ) {
84
+                                                       echo wp_kses_post( lsx_hp_member_connected( $connected_members, $plan ) );
85
+                                                  }
86
+                                                  if ( false === $restricted ) {
87
+                                                       echo wp_kses_post( '<span class="progress"><progress class="bar" value="' . $round_progress . '" max="100"> ' . $round_progress . '% </progress><span>' . $round_progress . '%</span></span>' );
88
+                                                  }
89
+                                                  if ( $small_description ) {
90
+                                                       ?>
91 91
 											<div class="the-content">
92 92
 												<span><?php echo esc_html( $small_description ); ?></span>
93 93
 											</div>
94 94
 											<?php
95 95
 											
96
-										}
97
-										?>
96
+                                                  }
97
+                                                  ?>
98 98
 										</div>
99 99
 										<?php
100
-										if ( lsx_health_plan_has_tips() ) {
101
-											echo wp_kses_post( do_shortcode( '[lsx_health_plan_featured_tips_block]' ) );
102
-										} ?>
100
+                                                  if ( lsx_health_plan_has_tips() ) {
101
+                                                       echo wp_kses_post( do_shortcode( '[lsx_health_plan_featured_tips_block]' ) );
102
+                                                  } ?>
103 103
 									</div>
104 104
 									<div class="the-plan-content">
105 105
 										<?php
106
-										echo do_shortcode( '[lsx_health_plan_day_plan_block week_view="true" show_downloads="true" plan="' . get_the_ID() . '"]' );
106
+                                                  echo do_shortcode( '[lsx_health_plan_day_plan_block week_view="true" show_downloads="true" plan="' . get_the_ID() . '"]' );
107 107
 
108
-										?>
108
+                                                  ?>
109 109
 										<div class="row status-plan-buttons main-plan-btn">
110 110
 											<?php
111
-											if ( function_exists( 'wc_get_page_id' ) ) {
112
-												?>
111
+                                                       if ( function_exists( 'wc_get_page_id' ) ) {
112
+                                                            ?>
113 113
 												<a class="btn border-btn" href="<?php echo wp_kses_post( get_permalink( wc_get_page_id( 'myaccount' ) ) ); ?>"><?php esc_html_e( 'My Plans', 'lsx-health-plan' ); ?></a>
114 114
 												<?php
115
-											}
116
-											?>
115
+                                                       }
116
+                                                       ?>
117 117
 										</div>
118 118
 									</div>
119 119
 								</div>
@@ -122,32 +122,32 @@  discard block
 block discarded – undo
122 122
 						</div><!-- .entry-content -->
123 123
 					</article>
124 124
 					<?php
125
-				} else {
126
-					lsx_health_plan_single_nav();
127
-					lsx_health_plan_single_tabs();
128
-				}
129
-			}
130
-			?>
125
+                    } else {
126
+                         lsx_health_plan_single_nav();
127
+                         lsx_health_plan_single_tabs();
128
+                    }
129
+               }
130
+               ?>
131 131
 		</div>
132 132
 
133 133
 		<?php
134
-		// Show the buttons on the single plan tabs.
135
-		if ( ! empty( $has_sections ) && false !== $is_section ) {
136
-			?>
134
+          // Show the buttons on the single plan tabs.
135
+          if ( ! empty( $has_sections ) && false !== $is_section ) {
136
+               ?>
137 137
 			<div class="row status-plan-buttons">
138 138
 				<?php lsx_health_plan_day_button(); ?>
139 139
 			</div>
140 140
 			<?php
141
-		}
142
-		?>
141
+          }
142
+          ?>
143 143
 
144 144
 		<?php lsx_content_bottom(); ?>
145 145
 
146 146
 		<?php
147
-		if ( ! empty( $connected_articles ) ) {
148
-			lsx_hp_single_related( $connected_articles, __( 'Latest articles', 'lsx-health-plan' ) );
149
-		}
150
-		?>
147
+          if ( ! empty( $connected_articles ) ) {
148
+               lsx_hp_single_related( $connected_articles, __( 'Latest articles', 'lsx-health-plan' ) );
149
+          }
150
+          ?>
151 151
 
152 152
 
153 153
 	</main><!-- #main -->
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -16,44 +16,44 @@  discard block
 block discarded – undo
16 16
 );
17 17
 
18 18
 $plan_id      = get_the_ID();
19
-$has_sections = \lsx_health_plan\functions\plan\has_sections( $plan_id );
20
-$has_parent   = wp_get_post_parent_id( $plan_id );
19
+$has_sections = \lsx_health_plan\functions\plan\has_sections($plan_id);
20
+$has_parent   = wp_get_post_parent_id($plan_id);
21 21
 $restricted   = false;
22
-$is_section   = get_query_var( 'section', false );
22
+$is_section   = get_query_var('section', false);
23 23
 
24 24
 // Getting translated endpoint.
25
-$plan = \lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' );
25
+$plan = \lsx_health_plan\functions\get_option('endpoint_plan', 'plan');
26 26
 
27
-$connected_members  = get_post_meta( get_the_ID(), ( $plan . '_connected_team_member' ), true );
28
-$connected_articles = get_post_meta( get_the_ID(), ( $plan . '_connected_articles' ), true );
29
-$small_description = get_post_meta( get_the_ID(), ( $plan . '_short_description' ), true );
27
+$connected_members  = get_post_meta(get_the_ID(), ($plan . '_connected_team_member'), true);
28
+$connected_articles = get_post_meta(get_the_ID(), ($plan . '_connected_articles'), true);
29
+$small_description = get_post_meta(get_the_ID(), ($plan . '_short_description'), true);
30 30
 
31
-if ( ! empty( $has_sections ) ) {
31
+if ( ! empty($has_sections)) {
32 32
 	$plan_type_class = 'parent-plan';
33
-	if ( 0 !== $has_parent ) {
33
+	if (0 !== $has_parent) {
34 34
 		$plan_type_class = 'parent-sub-plan';
35 35
 	}
36 36
 } else {
37 37
 	$plan_type_class = 'unique-plan';
38
-	if ( 0 !== $has_parent ) {
38
+	if (0 !== $has_parent) {
39 39
 		$plan_type_class = 'child-plan-' . $has_parent;
40 40
 	}
41 41
 }
42 42
 
43 43
 // Get the plan restrictions.
44
-if ( function_exists( 'wc_memberships_is_post_content_restricted' ) && wc_memberships_is_post_content_restricted( get_the_ID() ) ) {
45
-	$restricted = ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
44
+if (function_exists('wc_memberships_is_post_content_restricted') && wc_memberships_is_post_content_restricted(get_the_ID())) {
45
+	$restricted = ! current_user_can('wc_memberships_view_restricted_post_content', get_the_ID());
46 46
 }
47
-if ( false === $restricted ) {
48
-	$round_progress = round( \lsx_health_plan\functions\get_progress( get_the_ID() ), 0 );
47
+if (false === $restricted) {
48
+	$round_progress = round(\lsx_health_plan\functions\get_progress(get_the_ID()), 0);
49 49
 }
50 50
 ?>
51 51
 
52
-<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>">
52
+<div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>">
53 53
 
54 54
 	<?php lsx_content_before(); ?>
55 55
 
56
-	<main id="main" class="site-main <?php echo esc_html( $plan_type_class ); ?>" role="main">
56
+	<main id="main" class="site-main <?php echo esc_html($plan_type_class); ?>" role="main">
57 57
 
58 58
 		<?php lsx_content_top(); ?>
59 59
 
@@ -63,16 +63,16 @@  discard block
 block discarded – undo
63 63
 			</div>
64 64
 
65 65
 			<?php
66
-			if ( ! empty( $has_sections ) ) {
67
-				if ( false === $is_section ) {
66
+			if ( ! empty($has_sections)) {
67
+				if (false === $is_section) {
68 68
 					?>
69 69
 					<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
70 70
 						<div class="entry-content">
71 71
 							<div class="single-plan-inner main-plan-content">
72 72
 								<div class="single-plan-section-title title-lined">
73
-									<?php lsx_get_svg_icon( 'meal.svg' ); ?>
74
-									<h2><?php echo esc_html_e( 'Your Plan', 'lsx-health-plan' ); ?></h2>
75
-									<?php if ( class_exists( 'LSX_Sharing' ) ) {
73
+									<?php lsx_get_svg_icon('meal.svg'); ?>
74
+									<h2><?php echo esc_html_e('Your Plan', 'lsx-health-plan'); ?></h2>
75
+									<?php if (class_exists('LSX_Sharing')) {
76 76
 										lsx_content_sharing();
77 77
 									} ?>
78 78
 								</div>
@@ -80,16 +80,16 @@  discard block
 block discarded – undo
80 80
 									<div class="set-box set content-box entry-content">
81 81
 										<div class="plan-top-content">
82 82
 										<?php
83
-										if ( $connected_members ) {
84
-											echo wp_kses_post( lsx_hp_member_connected( $connected_members, $plan ) );
83
+										if ($connected_members) {
84
+											echo wp_kses_post(lsx_hp_member_connected($connected_members, $plan));
85 85
 										}
86
-										if ( false === $restricted ) {
87
-											echo wp_kses_post( '<span class="progress"><progress class="bar" value="' . $round_progress . '" max="100"> ' . $round_progress . '% </progress><span>' . $round_progress . '%</span></span>' );
86
+										if (false === $restricted) {
87
+											echo wp_kses_post('<span class="progress"><progress class="bar" value="' . $round_progress . '" max="100"> ' . $round_progress . '% </progress><span>' . $round_progress . '%</span></span>');
88 88
 										}
89
-										if ( $small_description ) {
89
+										if ($small_description) {
90 90
 											?>
91 91
 											<div class="the-content">
92
-												<span><?php echo esc_html( $small_description ); ?></span>
92
+												<span><?php echo esc_html($small_description); ?></span>
93 93
 											</div>
94 94
 											<?php
95 95
 											
@@ -97,20 +97,20 @@  discard block
 block discarded – undo
97 97
 										?>
98 98
 										</div>
99 99
 										<?php
100
-										if ( lsx_health_plan_has_tips() ) {
101
-											echo wp_kses_post( do_shortcode( '[lsx_health_plan_featured_tips_block]' ) );
100
+										if (lsx_health_plan_has_tips()) {
101
+											echo wp_kses_post(do_shortcode('[lsx_health_plan_featured_tips_block]'));
102 102
 										} ?>
103 103
 									</div>
104 104
 									<div class="the-plan-content">
105 105
 										<?php
106
-										echo do_shortcode( '[lsx_health_plan_day_plan_block week_view="true" show_downloads="true" plan="' . get_the_ID() . '"]' );
106
+										echo do_shortcode('[lsx_health_plan_day_plan_block week_view="true" show_downloads="true" plan="' . get_the_ID() . '"]');
107 107
 
108 108
 										?>
109 109
 										<div class="row status-plan-buttons main-plan-btn">
110 110
 											<?php
111
-											if ( function_exists( 'wc_get_page_id' ) ) {
111
+											if (function_exists('wc_get_page_id')) {
112 112
 												?>
113
-												<a class="btn border-btn" href="<?php echo wp_kses_post( get_permalink( wc_get_page_id( 'myaccount' ) ) ); ?>"><?php esc_html_e( 'My Plans', 'lsx-health-plan' ); ?></a>
113
+												<a class="btn border-btn" href="<?php echo wp_kses_post(get_permalink(wc_get_page_id('myaccount'))); ?>"><?php esc_html_e('My Plans', 'lsx-health-plan'); ?></a>
114 114
 												<?php
115 115
 											}
116 116
 											?>
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
 		<?php
134 134
 		// Show the buttons on the single plan tabs.
135
-		if ( ! empty( $has_sections ) && false !== $is_section ) {
135
+		if ( ! empty($has_sections) && false !== $is_section) {
136 136
 			?>
137 137
 			<div class="row status-plan-buttons">
138 138
 				<?php lsx_health_plan_day_button(); ?>
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
 		<?php lsx_content_bottom(); ?>
145 145
 
146 146
 		<?php
147
-		if ( ! empty( $connected_articles ) ) {
148
-			lsx_hp_single_related( $connected_articles, __( 'Latest articles', 'lsx-health-plan' ) );
147
+		if ( ! empty($connected_articles)) {
148
+			lsx_hp_single_related($connected_articles, __('Latest articles', 'lsx-health-plan'));
149 149
 		}
150 150
 		?>
151 151
 
Please login to merge, or discard this patch.
includes/conditionals.php 2 patches
Indentation   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
12 12
  * @return boolean
13 13
  */
14 14
 function lsx_health_plan_has_warmup( $post_id = '' ) {
15
-	if ( '' === $post_id ) {
16
-		$post_id = get_the_ID();
17
-	}
18
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'plan_warmup' );
15
+     if ( '' === $post_id ) {
16
+          $post_id = get_the_ID();
17
+     }
18
+     return \lsx_health_plan\functions\has_attached_post( $post_id, 'plan_warmup' );
19 19
 }
20 20
 
21 21
 /**
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
  * @return boolean
26 26
  */
27 27
 function lsx_health_plan_has_workout( $post_id = '' ) {
28
-	if ( ! post_type_exists( 'workout' ) ) {
29
-		return false;
30
-	}
31
-	if ( '' === $post_id ) {
32
-		$post_id = get_the_ID();
33
-	}
34
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_workouts' );
28
+     if ( ! post_type_exists( 'workout' ) ) {
29
+          return false;
30
+     }
31
+     if ( '' === $post_id ) {
32
+          $post_id = get_the_ID();
33
+     }
34
+     return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_workouts' );
35 35
 }
36 36
 
37 37
 /**
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
  * @return boolean
42 42
  */
43 43
 function lsx_health_plan_has_meal( $post_id = '' ) {
44
-	if ( ! post_type_exists( 'meal' ) ) {
45
-		return false;
46
-	}
47
-	if ( '' === $post_id ) {
48
-		$post_id = get_the_ID();
49
-	}
50
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_meals' );
44
+     if ( ! post_type_exists( 'meal' ) ) {
45
+          return false;
46
+     }
47
+     if ( '' === $post_id ) {
48
+          $post_id = get_the_ID();
49
+     }
50
+     return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_meals' );
51 51
 }
52 52
 
53 53
 /**
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
  * @return boolean
58 58
  */
59 59
 function lsx_health_plan_has_recipe( $post_id = '' ) {
60
-	if ( ! post_type_exists( 'recipe' ) ) {
61
-		return false;
62
-	}
63
-	if ( '' === $post_id ) {
64
-		$post_id = get_the_ID();
65
-	}
66
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_recipes' );
60
+     if ( ! post_type_exists( 'recipe' ) ) {
61
+          return false;
62
+     }
63
+     if ( '' === $post_id ) {
64
+          $post_id = get_the_ID();
65
+     }
66
+     return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_recipes' );
67 67
 }
68 68
 
69 69
 /**
@@ -73,15 +73,15 @@  discard block
 block discarded – undo
73 73
  * @return boolean
74 74
  */
75 75
 function lsx_health_plan_has_downloads( $post_id = '' ) {
76
-	$has_downloads = false;
77
-	if ( '' === $post_id ) {
78
-		$post_id = get_the_ID();
79
-	}
80
-	$downloads = \lsx_health_plan\functions\get_downloads( 'all', $post_id );
81
-	if ( ! empty( $downloads ) ) {
82
-		$has_downloads = true;
83
-	}
84
-	return $has_downloads;
76
+     $has_downloads = false;
77
+     if ( '' === $post_id ) {
78
+          $post_id = get_the_ID();
79
+     }
80
+     $downloads = \lsx_health_plan\functions\get_downloads( 'all', $post_id );
81
+     if ( ! empty( $downloads ) ) {
82
+          $has_downloads = true;
83
+     }
84
+     return $has_downloads;
85 85
 }
86 86
 
87 87
 /**
@@ -91,13 +91,13 @@  discard block
 block discarded – undo
91 91
  * @return boolean
92 92
  */
93 93
 function lsx_health_plan_has_tip( $post_id = '' ) {
94
-	if ( ! post_type_exists( 'tip' ) ) {
95
-		return false;
96
-	}
97
-	if ( '' === $post_id ) {
98
-		$post_id = get_the_ID();
99
-	}
100
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_tips' );
94
+     if ( ! post_type_exists( 'tip' ) ) {
95
+          return false;
96
+     }
97
+     if ( '' === $post_id ) {
98
+          $post_id = get_the_ID();
99
+     }
100
+     return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_tips' );
101 101
 }
102 102
 
103 103
 /**
@@ -107,13 +107,13 @@  discard block
 block discarded – undo
107 107
  * @return boolean
108 108
  */
109 109
 function lsx_health_plan_has_video( $post_id = '' ) {
110
-	if ( ! post_type_exists( 'video' ) ) {
111
-		return false;
112
-	}
113
-	if ( '' === $post_id ) {
114
-		$post_id = get_the_ID();
115
-	}
116
-	return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_videos' );
110
+     if ( ! post_type_exists( 'video' ) ) {
111
+          return false;
112
+     }
113
+     if ( '' === $post_id ) {
114
+          $post_id = get_the_ID();
115
+     }
116
+     return \lsx_health_plan\functions\has_attached_post( $post_id, 'connected_videos' );
117 117
 }
118 118
 
119 119
 /**
@@ -122,16 +122,16 @@  discard block
 block discarded – undo
122 122
  * @return boolean
123 123
  */
124 124
 function lsx_health_plan_user_has_purchase() {
125
-	$valid_order = false;
126
-	$product_id  = \lsx_health_plan\functions\get_option( 'membership_product', false );
125
+     $valid_order = false;
126
+     $product_id  = \lsx_health_plan\functions\get_option( 'membership_product', false );
127 127
 
128
-	if ( is_user_logged_in() && false !== $product_id ) {
129
-		$current_user = wp_get_current_user();
130
-		if ( wc_customer_bought_product( $current_user->user_email, $current_user->ID, $product_id ) ) {
131
-			$valid_order = true;
132
-		}
133
-	}
134
-	return $valid_order;
128
+     if ( is_user_logged_in() && false !== $product_id ) {
129
+          $current_user = wp_get_current_user();
130
+          if ( wc_customer_bought_product( $current_user->user_email, $current_user->ID, $product_id ) ) {
131
+               $valid_order = true;
132
+          }
133
+     }
134
+     return $valid_order;
135 135
 }
136 136
 
137 137
 /**
@@ -141,18 +141,18 @@  discard block
 block discarded – undo
141 141
  * @return boolean
142 142
  */
143 143
 function lsx_health_plan_is_current_tab( $needle = '' ) {
144
-	$is_tab = false;
145
-	$plan_slug = \lsx_health_plan\functions\get_option( 'my_plan_slug', false );
146
-	if ( false === $plan_slug ) {
147
-		$plan_slug = 'my-plan';
148
-	}
149
-	if ( is_singular( 'plan' ) || is_page( $plan_slug ) ) {
150
-		$endpoint = get_query_var( 'endpoint' );
151
-		if ( false !== $endpoint && $needle === $endpoint ) {
152
-			$is_tab = true;
153
-		}
154
-	}
155
-	return $is_tab;
144
+     $is_tab = false;
145
+     $plan_slug = \lsx_health_plan\functions\get_option( 'my_plan_slug', false );
146
+     if ( false === $plan_slug ) {
147
+          $plan_slug = 'my-plan';
148
+     }
149
+     if ( is_singular( 'plan' ) || is_page( $plan_slug ) ) {
150
+          $endpoint = get_query_var( 'endpoint' );
151
+          if ( false !== $endpoint && $needle === $endpoint ) {
152
+               $is_tab = true;
153
+          }
154
+     }
155
+     return $is_tab;
156 156
 }
157 157
 
158 158
 /**
@@ -162,22 +162,22 @@  discard block
 block discarded – undo
162 162
  * @return boolean
163 163
  */
164 164
 function lsx_health_plan_is_day_complete( $post_id = '', $section_key = '' ) {
165
-	$is_complete = false;
166
-	if ( '' === $post_id ) {
167
-		$post_id = get_the_ID();
168
-	}
169
-	$key             = \lsx_health_plan\functions\plan\generate_section_id( $section_key );
170
-	$is_day_complete = get_user_meta( get_current_user_id(), 'day_' . $key . '_complete', true );
171
-	if ( false !== $is_day_complete && '' !== $is_day_complete ) {
172
-		$is_complete = true;
173
-	}
165
+     $is_complete = false;
166
+     if ( '' === $post_id ) {
167
+          $post_id = get_the_ID();
168
+     }
169
+     $key             = \lsx_health_plan\functions\plan\generate_section_id( $section_key );
170
+     $is_day_complete = get_user_meta( get_current_user_id(), 'day_' . $key . '_complete', true );
171
+     if ( false !== $is_day_complete && '' !== $is_day_complete ) {
172
+          $is_complete = true;
173
+     }
174 174
 
175
-	return $is_complete;
175
+     return $is_complete;
176 176
 }
177 177
 
178 178
 function lsx_health_plan_is_plan_complete() {
179
-	$complete = false;
180
-	return $complete;
179
+     $complete = false;
180
+     return $complete;
181 181
 }
182 182
 
183 183
 /**
@@ -187,14 +187,14 @@  discard block
 block discarded – undo
187 187
  * @return boolean
188 188
  */
189 189
 function lsx_health_plan_week_has_downloads( $week = '' ) {
190
-	$has_downloads = false;
191
-	if ( '' !== $week ) {
192
-		$downloads = \lsx_health_plan\functions\get_weekly_downloads( $week );
193
-		if ( ! empty( $downloads ) ) {
194
-			$has_downloads = true;
195
-		}
196
-	}
197
-	return $has_downloads;
190
+     $has_downloads = false;
191
+     if ( '' !== $week ) {
192
+          $downloads = \lsx_health_plan\functions\get_weekly_downloads( $week );
193
+          if ( ! empty( $downloads ) ) {
194
+               $has_downloads = true;
195
+          }
196
+     }
197
+     return $has_downloads;
198 198
 }
199 199
 
200 200
 /**
@@ -204,15 +204,15 @@  discard block
 block discarded – undo
204 204
  * @return boolean
205 205
  */
206 206
 function lsx_health_plan_has_tips( $post_id = '' ) {
207
-	$has_tips = false;
208
-	if ( '' === $post_id ) {
209
-		$post_id = get_the_ID();
210
-	}
211
-	$post_type      = get_post_type( $post_id );
212
-	$connected_tips = get_post_meta( get_the_ID(), $post_type . '_connected_tips', true );
213
-	$connected_tips = \lsx_health_plan\functions\check_posts_exist( $connected_tips );
214
-	if ( ! empty( $connected_tips ) ) {
215
-		$has_tips = true;
216
-	}
217
-	return $has_tips;
207
+     $has_tips = false;
208
+     if ( '' === $post_id ) {
209
+          $post_id = get_the_ID();
210
+     }
211
+     $post_type      = get_post_type( $post_id );
212
+     $connected_tips = get_post_meta( get_the_ID(), $post_type . '_connected_tips', true );
213
+     $connected_tips = \lsx_health_plan\functions\check_posts_exist( $connected_tips );
214
+     if ( ! empty( $connected_tips ) ) {
215
+          $has_tips = true;
216
+     }
217
+     return $has_tips;
218 218
 }
Please login to merge, or discard this patch.
Spacing   +51 added lines, -51 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 = '', $section_key = '' ) {
164
+function lsx_health_plan_is_day_complete($post_id = '', $section_key = '') {
165 165
 	$is_complete = false;
166
-	if ( '' === $post_id ) {
166
+	if ('' === $post_id) {
167 167
 		$post_id = get_the_ID();
168 168
 	}
169
-	$key             = \lsx_health_plan\functions\plan\generate_section_id( $section_key );
170
-	$is_day_complete = get_user_meta( get_current_user_id(), 'day_' . $key . '_complete', true );
171
-	if ( false !== $is_day_complete && '' !== $is_day_complete ) {
169
+	$key             = \lsx_health_plan\functions\plan\generate_section_id($section_key);
170
+	$is_day_complete = get_user_meta(get_current_user_id(), 'day_' . $key . '_complete', true);
171
+	if (false !== $is_day_complete && '' !== $is_day_complete) {
172 172
 		$is_complete = true;
173 173
 	}
174 174
 
@@ -186,11 +186,11 @@  discard block
 block discarded – undo
186 186
  * @param string $week The week name 'week-1'.
187 187
  * @return boolean
188 188
  */
189
-function lsx_health_plan_week_has_downloads( $week = '' ) {
189
+function lsx_health_plan_week_has_downloads($week = '') {
190 190
 	$has_downloads = false;
191
-	if ( '' !== $week ) {
192
-		$downloads = \lsx_health_plan\functions\get_weekly_downloads( $week );
193
-		if ( ! empty( $downloads ) ) {
191
+	if ('' !== $week) {
192
+		$downloads = \lsx_health_plan\functions\get_weekly_downloads($week);
193
+		if ( ! empty($downloads)) {
194 194
 			$has_downloads = true;
195 195
 		}
196 196
 	}
@@ -203,15 +203,15 @@  discard block
 block discarded – undo
203 203
  * @param string $post_id
204 204
  * @return boolean
205 205
  */
206
-function lsx_health_plan_has_tips( $post_id = '' ) {
206
+function lsx_health_plan_has_tips($post_id = '') {
207 207
 	$has_tips = false;
208
-	if ( '' === $post_id ) {
208
+	if ('' === $post_id) {
209 209
 		$post_id = get_the_ID();
210 210
 	}
211
-	$post_type      = get_post_type( $post_id );
212
-	$connected_tips = get_post_meta( get_the_ID(), $post_type . '_connected_tips', true );
213
-	$connected_tips = \lsx_health_plan\functions\check_posts_exist( $connected_tips );
214
-	if ( ! empty( $connected_tips ) ) {
211
+	$post_type      = get_post_type($post_id);
212
+	$connected_tips = get_post_meta(get_the_ID(), $post_type . '_connected_tips', true);
213
+	$connected_tips = \lsx_health_plan\functions\check_posts_exist($connected_tips);
214
+	if ( ! empty($connected_tips)) {
215 215
 		$has_tips = true;
216 216
 	}
217 217
 	return $has_tips;
Please login to merge, or discard this patch.