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