Passed
Push — add/multiplan ( 6df1c3...cc23c7 )
by Warwick
07:00 queued 02:56
created
includes/template-tags/team.php 2 patches
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 $tab_experience['content']   = get_post_meta( get_the_ID(), 'team_member_experience', true );
8 8
 $tab_experience['shortcode'] = ''; 
9 9
 if ( ! empty( $tab_experience['content'] ) ) {
10
-	$tabs[] = $tab_experience;
10
+     $tabs[] = $tab_experience;
11 11
 }
12 12
 
13 13
 // Tab Featured plan
@@ -18,75 +18,75 @@  discard block
 block discarded – undo
18 18
 
19 19
 if ( ! empty( $tab_plans['posts'] ) ) {
20 20
 
21
-	$plan_content = '';
21
+     $plan_content = '';
22 22
 
23
-	$include = implode( ',', $tab_plans['posts'] );
24
-	$args = array(
25
-		'orderby'        => 'menu_order',
26
-		'order'          => 'ASC',
27
-		'post_type'      => 'plan',
28
-		'post__in'       => $tab_plans['posts'],
29
-	);
30
-	//$the_query = new WP_Query( $args );
23
+     $include = implode( ',', $tab_plans['posts'] );
24
+     $args = array(
25
+          'orderby'        => 'menu_order',
26
+          'order'          => 'ASC',
27
+          'post_type'      => 'plan',
28
+          'post__in'       => $tab_plans['posts'],
29
+     );
30
+     //$the_query = new WP_Query( $args );
31 31
 
32
-	$plan_content = '<div class="all-plans-block plan-grid block-all-plans-block team-member-plans">
32
+     $plan_content = '<div class="all-plans-block plan-grid block-all-plans-block team-member-plans">
33 33
 	<div class="row">';
34 34
 
35
-	foreach ( $tab_plans['posts'] as $index => $post ) {
36
-
37
-		$plan_content .= '<div class="col-xs-12 col-sm-6 col-md-4">';
38
-		$plan_content .= '<article class="lsx-slot lsx-hp-shadow">';
39
-		$plan_content .= '<div class="plan-feature-img">';
40
-		$plan_content .= '<a href="' . get_permalink( $post ) . '">';
41
-
42
-		$linked_product  = false;
43
-		$restricted      = false;
44
-		$product         = null;
45
-		if ( \lsx_health_plan\functions\woocommerce\plan_has_products( $post ) ) {
46
-			$products       = \lsx_health_plan\functions\woocommerce\get_plan_products( $post );
47
-			$linked_product = wc_get_product( $products[0] );
48
-			$product        = $linked_product;
49
-		}
50
-		if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) {
51
-			$restricted = wc_memberships_is_post_content_restricted( get_the_ID() ) && ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
52
-		}
53
-
54
-		$featured_image = get_the_post_thumbnail( $post );
55
-		if ( ! empty( $featured_image ) && '' !== $featured_image ) {
56
-			$plan_content .= $featured_image;
57
-		} else {
58
-			$plan_content .= '<img loading="lazy" class="placeholder" src="' . plugin_dir_url( __DIR__ ) . '../assets/images/placeholder.jpg' . '">';
59
-		}
60
-		$plan_content .= '</a>';
61
-		$plan_content .= '</div>';
62
-
63
-		$plan_content .= '<div class="content-box plan-content-box">';
64
-		$plan_content .= '<h3 class="plan"><a href="' . get_permalink( $post ) . '">' . get_the_title( $post ) . '</a></h3>';
65
-
66
-		if ( false !== $linked_product && false !== $restricted ) {
67
-			$plan_content .= $linked_product->get_price_html();
68
-		}
69
-
70
-		$plan_content .= '<div class="excerpt">';
71
-		if ( ! has_excerpt( $post ) ) {
72
-			$content = wp_trim_words( get_the_content( $post ), 20 );
73
-			$plan_content .= '<p>' . $content . '</p>';
74
-		} else {
75
-			$plan_content .= apply_filters( 'the_excerpt', get_the_excerpt( $post ) );
76
-		}
77
-		$plan_content .= '</div>';
78
-
79
-		$plan_content .= '</div>';
80
-		$plan_content .= '</article>';
81
-		$plan_content .= '</div>';
82
-
83
-	}
84
-	$plan_content .= '</div></div>';
85
-
86
-	$tab_plans['content'] = $plan_content;
35
+     foreach ( $tab_plans['posts'] as $index => $post ) {
36
+
37
+          $plan_content .= '<div class="col-xs-12 col-sm-6 col-md-4">';
38
+          $plan_content .= '<article class="lsx-slot lsx-hp-shadow">';
39
+          $plan_content .= '<div class="plan-feature-img">';
40
+          $plan_content .= '<a href="' . get_permalink( $post ) . '">';
41
+
42
+          $linked_product  = false;
43
+          $restricted      = false;
44
+          $product         = null;
45
+          if ( \lsx_health_plan\functions\woocommerce\plan_has_products( $post ) ) {
46
+               $products       = \lsx_health_plan\functions\woocommerce\get_plan_products( $post );
47
+               $linked_product = wc_get_product( $products[0] );
48
+               $product        = $linked_product;
49
+          }
50
+          if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) {
51
+               $restricted = wc_memberships_is_post_content_restricted( get_the_ID() ) && ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
52
+          }
53
+
54
+          $featured_image = get_the_post_thumbnail( $post );
55
+          if ( ! empty( $featured_image ) && '' !== $featured_image ) {
56
+               $plan_content .= $featured_image;
57
+          } else {
58
+               $plan_content .= '<img loading="lazy" class="placeholder" src="' . plugin_dir_url( __DIR__ ) . '../assets/images/placeholder.jpg' . '">';
59
+          }
60
+          $plan_content .= '</a>';
61
+          $plan_content .= '</div>';
62
+
63
+          $plan_content .= '<div class="content-box plan-content-box">';
64
+          $plan_content .= '<h3 class="plan"><a href="' . get_permalink( $post ) . '">' . get_the_title( $post ) . '</a></h3>';
65
+
66
+          if ( false !== $linked_product && false !== $restricted ) {
67
+               $plan_content .= $linked_product->get_price_html();
68
+          }
69
+
70
+          $plan_content .= '<div class="excerpt">';
71
+          if ( ! has_excerpt( $post ) ) {
72
+               $content = wp_trim_words( get_the_content( $post ), 20 );
73
+               $plan_content .= '<p>' . $content . '</p>';
74
+          } else {
75
+               $plan_content .= apply_filters( 'the_excerpt', get_the_excerpt( $post ) );
76
+          }
77
+          $plan_content .= '</div>';
78
+
79
+          $plan_content .= '</div>';
80
+          $plan_content .= '</article>';
81
+          $plan_content .= '</div>';
82
+
83
+     }
84
+     $plan_content .= '</div></div>';
85
+
86
+     $tab_plans['content'] = $plan_content;
87 87
 }
88 88
 if ( ! empty( $tab_plans['content'] ) ) {
89
-	$tabs[] = $tab_plans;
89
+     $tabs[] = $tab_plans;
90 90
 }
91 91
 
92 92
 
@@ -97,15 +97,15 @@  discard block
 block discarded – undo
97 97
 $tab_testimonial['content']   = '';
98 98
 
99 99
 if ( is_plugin_active( 'lsx-testimonials/lsx-testimonials.php' ) && ( ! empty( $tab_testimonial['posts'] ) ) ) {
100
-	if ( count( $tab_testimonial['posts'] ) <= 2 ) {
101
-		$columns = count( $tab_testimonial['posts'] );
102
-	} else {
103
-		$columns = 3;
104
-	}
105
-
106
-	$post_ids = join( ',', $tab_testimonial['posts'] );
107
-	$tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]';
108
-	$tabs[] = $tab_testimonial;
100
+     if ( count( $tab_testimonial['posts'] ) <= 2 ) {
101
+          $columns = count( $tab_testimonial['posts'] );
102
+     } else {
103
+          $columns = 3;
104
+     }
105
+
106
+     $post_ids = join( ',', $tab_testimonial['posts'] );
107
+     $tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]';
108
+     $tabs[] = $tab_testimonial;
109 109
 }
110 110
 
111 111
 if ( count( $tabs ) > 0 ) : ?>
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -3,24 +3,24 @@  discard block
 block discarded – undo
3 3
 $tabs = array();
4 4
 
5 5
 // Tab Experience
6
-$tab_experience['title']     = esc_html__( 'Experience', 'lsx-team' );
7
-$tab_experience['content']   = get_post_meta( get_the_ID(), 'team_member_experience', true );
6
+$tab_experience['title']     = esc_html__('Experience', 'lsx-team');
7
+$tab_experience['content']   = get_post_meta(get_the_ID(), 'team_member_experience', true);
8 8
 $tab_experience['shortcode'] = ''; 
9
-if ( ! empty( $tab_experience['content'] ) ) {
9
+if ( ! empty($tab_experience['content'])) {
10 10
 	$tabs[] = $tab_experience;
11 11
 }
12 12
 
13 13
 // Tab Featured plan
14
-$tab_plans['title']     = esc_html__( 'Featured Plans', 'lsx-team' );
15
-$tab_plans['posts']     = get_post_meta( get_the_ID(), 'connected_team_member_plan', true );
14
+$tab_plans['title']     = esc_html__('Featured Plans', 'lsx-team');
15
+$tab_plans['posts']     = get_post_meta(get_the_ID(), 'connected_team_member_plan', true);
16 16
 $tab_plans['content']   = '';
17 17
 $tab_plans['shortcode'] = '';
18 18
 
19
-if ( ! empty( $tab_plans['posts'] ) ) {
19
+if ( ! empty($tab_plans['posts'])) {
20 20
 
21 21
 	$plan_content = '';
22 22
 
23
-	$include = implode( ',', $tab_plans['posts'] );
23
+	$include = implode(',', $tab_plans['posts']);
24 24
 	$args = array(
25 25
 		'orderby'        => 'menu_order',
26 26
 		'order'          => 'ASC',
@@ -32,47 +32,47 @@  discard block
 block discarded – undo
32 32
 	$plan_content = '<div class="all-plans-block plan-grid block-all-plans-block team-member-plans">
33 33
 	<div class="row">';
34 34
 
35
-	foreach ( $tab_plans['posts'] as $index => $post ) {
35
+	foreach ($tab_plans['posts'] as $index => $post) {
36 36
 
37 37
 		$plan_content .= '<div class="col-xs-12 col-sm-6 col-md-4">';
38 38
 		$plan_content .= '<article class="lsx-slot lsx-hp-shadow">';
39 39
 		$plan_content .= '<div class="plan-feature-img">';
40
-		$plan_content .= '<a href="' . get_permalink( $post ) . '">';
40
+		$plan_content .= '<a href="' . get_permalink($post) . '">';
41 41
 
42 42
 		$linked_product  = false;
43 43
 		$restricted      = false;
44 44
 		$product         = null;
45
-		if ( \lsx_health_plan\functions\woocommerce\plan_has_products( $post ) ) {
46
-			$products       = \lsx_health_plan\functions\woocommerce\get_plan_products( $post );
47
-			$linked_product = wc_get_product( $products[0] );
45
+		if (\lsx_health_plan\functions\woocommerce\plan_has_products($post)) {
46
+			$products       = \lsx_health_plan\functions\woocommerce\get_plan_products($post);
47
+			$linked_product = wc_get_product($products[0]);
48 48
 			$product        = $linked_product;
49 49
 		}
50
-		if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) {
51
-			$restricted = wc_memberships_is_post_content_restricted( get_the_ID() ) && ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() );
50
+		if (function_exists('wc_memberships_is_post_content_restricted')) {
51
+			$restricted = wc_memberships_is_post_content_restricted(get_the_ID()) && ! current_user_can('wc_memberships_view_restricted_post_content', get_the_ID());
52 52
 		}
53 53
 
54
-		$featured_image = get_the_post_thumbnail( $post );
55
-		if ( ! empty( $featured_image ) && '' !== $featured_image ) {
54
+		$featured_image = get_the_post_thumbnail($post);
55
+		if ( ! empty($featured_image) && '' !== $featured_image) {
56 56
 			$plan_content .= $featured_image;
57 57
 		} else {
58
-			$plan_content .= '<img loading="lazy" class="placeholder" src="' . plugin_dir_url( __DIR__ ) . '../assets/images/placeholder.jpg' . '">';
58
+			$plan_content .= '<img loading="lazy" class="placeholder" src="' . plugin_dir_url(__DIR__) . '../assets/images/placeholder.jpg' . '">';
59 59
 		}
60 60
 		$plan_content .= '</a>';
61 61
 		$plan_content .= '</div>';
62 62
 
63 63
 		$plan_content .= '<div class="content-box plan-content-box">';
64
-		$plan_content .= '<h3 class="plan"><a href="' . get_permalink( $post ) . '">' . get_the_title( $post ) . '</a></h3>';
64
+		$plan_content .= '<h3 class="plan"><a href="' . get_permalink($post) . '">' . get_the_title($post) . '</a></h3>';
65 65
 
66
-		if ( false !== $linked_product && false !== $restricted ) {
66
+		if (false !== $linked_product && false !== $restricted) {
67 67
 			$plan_content .= $linked_product->get_price_html();
68 68
 		}
69 69
 
70 70
 		$plan_content .= '<div class="excerpt">';
71
-		if ( ! has_excerpt( $post ) ) {
72
-			$content = wp_trim_words( get_the_content( $post ), 20 );
71
+		if ( ! has_excerpt($post)) {
72
+			$content = wp_trim_words(get_the_content($post), 20);
73 73
 			$plan_content .= '<p>' . $content . '</p>';
74 74
 		} else {
75
-			$plan_content .= apply_filters( 'the_excerpt', get_the_excerpt( $post ) );
75
+			$plan_content .= apply_filters('the_excerpt', get_the_excerpt($post));
76 76
 		}
77 77
 		$plan_content .= '</div>';
78 78
 
@@ -85,41 +85,41 @@  discard block
 block discarded – undo
85 85
 
86 86
 	$tab_plans['content'] = $plan_content;
87 87
 }
88
-if ( ! empty( $tab_plans['content'] ) ) {
88
+if ( ! empty($tab_plans['content'])) {
89 89
 	$tabs[] = $tab_plans;
90 90
 }
91 91
 
92 92
 
93 93
 // Tab Testimonials
94 94
 $tab_testimonial['post_type'] = 'testimonial';
95
-$tab_testimonial['title']     = esc_html__( 'Testimonials', 'lsx-team' );
96
-$tab_testimonial['posts']     = get_post_meta( get_the_ID(), 'testimonial_to_team', true );
95
+$tab_testimonial['title']     = esc_html__('Testimonials', 'lsx-team');
96
+$tab_testimonial['posts']     = get_post_meta(get_the_ID(), 'testimonial_to_team', true);
97 97
 $tab_testimonial['content']   = '';
98 98
 
99
-if ( is_plugin_active( 'lsx-testimonials/lsx-testimonials.php' ) && ( ! empty( $tab_testimonial['posts'] ) ) ) {
100
-	if ( count( $tab_testimonial['posts'] ) <= 2 ) {
101
-		$columns = count( $tab_testimonial['posts'] );
99
+if (is_plugin_active('lsx-testimonials/lsx-testimonials.php') && ( ! empty($tab_testimonial['posts']))) {
100
+	if (count($tab_testimonial['posts']) <= 2) {
101
+		$columns = count($tab_testimonial['posts']);
102 102
 	} else {
103 103
 		$columns = 3;
104 104
 	}
105 105
 
106
-	$post_ids = join( ',', $tab_testimonial['posts'] );
106
+	$post_ids = join(',', $tab_testimonial['posts']);
107 107
 	$tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]';
108 108
 	$tabs[] = $tab_testimonial;
109 109
 }
110 110
 
111
-if ( count( $tabs ) > 0 ) : ?>
111
+if (count($tabs) > 0) : ?>
112 112
 	<div class="entry-tabs hp-entry-tabs">
113 113
 		<ul class="nav nav-tabs">
114
-			<?php foreach ( $tabs as $i => $tab ) : ?>
115
-				<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>
114
+			<?php foreach ($tabs as $i => $tab) : ?>
115
+				<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>
116 116
 			<?php endforeach; ?>
117 117
 		</ul>
118 118
 
119 119
 		<div class="tab-content">
120
-			<?php foreach ( $tabs as $i => $tab ) : ?>
121
-				<div id="<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>" class="tab-pane fade<?php if ( 0 === $i ) echo ' in active'; ?>">
122
-					<?php echo do_shortcode( $tab['shortcode'] ); ?>
120
+			<?php foreach ($tabs as $i => $tab) : ?>
121
+				<div id="<?php echo esc_attr(sanitize_title($tab['title'])); ?>" class="tab-pane fade<?php if (0 === $i) echo ' in active'; ?>">
122
+					<?php echo do_shortcode($tab['shortcode']); ?>
123 123
 					<?php echo $tab['content']; ?>
124 124
 				</div>
125 125
 			<?php endforeach; ?>
Please login to merge, or discard this patch.