Passed
Push — master ( c365a5...a83aa0 )
by Virginia
08:09
created
templates/content-single-team.php 1 patch
Indentation   +131 added lines, -131 removed lines patch added patch discarded remove patch
@@ -5,137 +5,137 @@
 block discarded – undo
5 5
 ?>
6 6
 
7 7
 <?php
8
-	global $lsx_team;
9
-
10
-	$thumbnail = $lsx_team->get_thumbnail( get_the_ID(), 'lsx-team-single' );
11
-
12
-	$job_title = get_post_meta( get_the_ID(), 'lsx_job_title', true );
13
-
14
-	$links = array(
15
-		'facebook'  => get_post_meta( get_the_ID(), 'lsx_facebook', true ),
16
-		'twitter'   => get_post_meta( get_the_ID(), 'lsx_twitter', true ),
17
-		'linkedin'  => get_post_meta( get_the_ID(), 'lsx_linkedin', true ),
18
-		'github'    => get_post_meta( get_the_ID(), 'lsx_github', true ),
19
-		'wordpress' => get_post_meta( get_the_ID(), 'lsx_wordpress', true ),
20
-	);
21
-
22
-	foreach ( $links as $service => $link ) {
23
-		if ( empty( $link ) ) {
24
-			unset( $links[ $service ] );
25
-		}
26
-	}
27
-
28
-	$email = get_post_meta( get_the_ID(), 'lsx_email_contact', true );
29
-	$phone = get_post_meta( get_the_ID(), 'lsx_tel', true );
30
-	$skype = get_post_meta( get_the_ID(), 'lsx_skype', true );
31
-
32
-	$phone_attr = $phone;
33
-	$phone_attr = str_replace( ' ', '', $phone_attr );
34
-	$phone_attr = str_replace( '+', '', $phone_attr );
35
-	$phone_attr = str_replace( '(', '', $phone_attr );
36
-	$phone_attr = str_replace( ')', '', $phone_attr );
37
-	$phone_attr = str_replace( '.', '', $phone_attr );
38
-
39
-	// Tabs
40
-
41
-	$tabs = array();
42
-
43
-	// Tab Posts
44
-
45
-	$site_user = get_post_meta( get_the_ID(), 'lsx_site_user', true );
46
-
47
-	if ( ! empty( $site_user ) ) {
48
-		if ( is_user_member_of_blog( $site_user ) ) {
49
-			$user_posts = count_user_posts( $site_user, 'post' );
50
-
51
-			if ( $user_posts > 0 ) {
52
-				$params = array(
53
-					'post_type' => 'post',
54
-					'author' => $site_user,
55
-					'posts_per_page' => 9,
56
-					'order' => 'DESC',
57
-					'orderby' => 'date',
58
-					'fields' => 'ids',
59
-					'tax_query' => array(
60
-						array(
61
-							'taxonomy' => 'post_format',
62
-							'field' => 'slug',
63
-							'terms' => array(
64
-								'post-format-aside',
65
-								'post-format-audio',
66
-								'post-format-chat',
67
-								'post-format-gallery',
68
-								'post-format-image',
69
-								'post-format-link',
70
-								'post-format-quote',
71
-								'post-format-status',
72
-								'post-format-video',
73
-							),
74
-							'operator' => 'NOT IN',
75
-						),
76
-					),
77
-				);
78
-
79
-				$posts_query = new \WP_Query( $params );
80
-
81
-				if ( $posts_query->have_posts() ) {
82
-					$tab_post['post_type'] = 'post';
83
-					$tab_post['title'] = esc_html__( 'Posts', 'lsx-team' );
84
-					$tab_post['posts'] = $posts_query->posts;
85
-
86
-					if ( ! empty( $tab_post['posts'] ) ) {
87
-						$post_ids = join( ',', $tab_post['posts'] );
88
-						$tab_post['shortcode'] = '[lsx_posts columns="3" limit="9" include="' . $post_ids . '"]';
89
-						$tabs[] = $tab_post;
90
-					}
91
-				}
92
-			}
93
-		}
94
-	}
95
-
96
-	// Tab Projects
97
-
98
-	$tab_project['post_type'] = 'project';
99
-	$tab_project['title'] = esc_html__( 'Projects', 'lsx-team' );
100
-	$tab_project['posts'] = get_post_meta( get_the_ID(), 'project_to_team', true );
101
-
102
-	if ( is_plugin_active( 'lsx-projects/lsx-projects.php' ) && ( ! empty( $tab_project['posts'] ) ) ) {
103
-		$post_ids = join( ',', $tab_project['posts'] );
104
-		$tab_project['shortcode'] = '[lsx_projects columns="3" include="' . $post_ids . '"]';
105
-		$tabs[] = $tab_project;
106
-	}
107
-
108
-	// Tab Services
109
-
110
-	if ( is_plugin_active( 'lsx-services/lsx-services.php' ) ) {
111
-		$tab_service['post_type'] = 'service';
112
-		$tab_service['title'] = esc_html__( 'Services', 'lsx-team' );
113
-		$tab_service['posts'] = get_post_meta( get_the_ID(), 'service_to_team', true );
114
-
115
-		if ( ! empty( $tab_service['posts'] ) ) {
116
-			$post_ids = join( ',', $tab_service['posts'] );
117
-			$tab_service['shortcode'] = '[lsx_services columns="3" include="' . $post_ids . '"]';
118
-			$tabs[] = $tab_service;
119
-		}
120
-	}
121
-
122
-	// Tab Testimonials
123
-
124
-	$tab_testimonial['post_type'] = 'testimonial';
125
-	$tab_testimonial['title'] = esc_html__( 'Testimonials', 'lsx-team' );
126
-	$tab_testimonial['posts'] = get_post_meta( get_the_ID(), 'testimonial_to_team', true );
127
-
128
-	if ( is_plugin_active( 'lsx-testimonials/lsx-testimonials.php' ) && ( ! empty( $tab_testimonial['posts'] ) ) ) {
129
-		if ( count( $tab_testimonial['posts'] ) <= 2 ) {
130
-			$columns = count( $tab_testimonial['posts'] );
131
-		} else {
132
-			$columns = 2;
133
-		}
134
-
135
-		$post_ids = join( ',', $tab_testimonial['posts'] );
136
-		$tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]';
137
-		$tabs[] = $tab_testimonial;
138
-	}
8
+     global $lsx_team;
9
+
10
+     $thumbnail = $lsx_team->get_thumbnail( get_the_ID(), 'lsx-team-single' );
11
+
12
+     $job_title = get_post_meta( get_the_ID(), 'lsx_job_title', true );
13
+
14
+     $links = array(
15
+          'facebook'  => get_post_meta( get_the_ID(), 'lsx_facebook', true ),
16
+          'twitter'   => get_post_meta( get_the_ID(), 'lsx_twitter', true ),
17
+          'linkedin'  => get_post_meta( get_the_ID(), 'lsx_linkedin', true ),
18
+          'github'    => get_post_meta( get_the_ID(), 'lsx_github', true ),
19
+          'wordpress' => get_post_meta( get_the_ID(), 'lsx_wordpress', true ),
20
+     );
21
+
22
+     foreach ( $links as $service => $link ) {
23
+          if ( empty( $link ) ) {
24
+               unset( $links[ $service ] );
25
+          }
26
+     }
27
+
28
+     $email = get_post_meta( get_the_ID(), 'lsx_email_contact', true );
29
+     $phone = get_post_meta( get_the_ID(), 'lsx_tel', true );
30
+     $skype = get_post_meta( get_the_ID(), 'lsx_skype', true );
31
+
32
+     $phone_attr = $phone;
33
+     $phone_attr = str_replace( ' ', '', $phone_attr );
34
+     $phone_attr = str_replace( '+', '', $phone_attr );
35
+     $phone_attr = str_replace( '(', '', $phone_attr );
36
+     $phone_attr = str_replace( ')', '', $phone_attr );
37
+     $phone_attr = str_replace( '.', '', $phone_attr );
38
+
39
+     // Tabs
40
+
41
+     $tabs = array();
42
+
43
+     // Tab Posts
44
+
45
+     $site_user = get_post_meta( get_the_ID(), 'lsx_site_user', true );
46
+
47
+     if ( ! empty( $site_user ) ) {
48
+          if ( is_user_member_of_blog( $site_user ) ) {
49
+               $user_posts = count_user_posts( $site_user, 'post' );
50
+
51
+               if ( $user_posts > 0 ) {
52
+                    $params = array(
53
+                         'post_type' => 'post',
54
+                         'author' => $site_user,
55
+                         'posts_per_page' => 9,
56
+                         'order' => 'DESC',
57
+                         'orderby' => 'date',
58
+                         'fields' => 'ids',
59
+                         'tax_query' => array(
60
+                              array(
61
+                                   'taxonomy' => 'post_format',
62
+                                   'field' => 'slug',
63
+                                   'terms' => array(
64
+                                        'post-format-aside',
65
+                                        'post-format-audio',
66
+                                        'post-format-chat',
67
+                                        'post-format-gallery',
68
+                                        'post-format-image',
69
+                                        'post-format-link',
70
+                                        'post-format-quote',
71
+                                        'post-format-status',
72
+                                        'post-format-video',
73
+                                   ),
74
+                                   'operator' => 'NOT IN',
75
+                              ),
76
+                         ),
77
+                    );
78
+
79
+                    $posts_query = new \WP_Query( $params );
80
+
81
+                    if ( $posts_query->have_posts() ) {
82
+                         $tab_post['post_type'] = 'post';
83
+                         $tab_post['title'] = esc_html__( 'Posts', 'lsx-team' );
84
+                         $tab_post['posts'] = $posts_query->posts;
85
+
86
+                         if ( ! empty( $tab_post['posts'] ) ) {
87
+                              $post_ids = join( ',', $tab_post['posts'] );
88
+                              $tab_post['shortcode'] = '[lsx_posts columns="3" limit="9" include="' . $post_ids . '"]';
89
+                              $tabs[] = $tab_post;
90
+                         }
91
+                    }
92
+               }
93
+          }
94
+     }
95
+
96
+     // Tab Projects
97
+
98
+     $tab_project['post_type'] = 'project';
99
+     $tab_project['title'] = esc_html__( 'Projects', 'lsx-team' );
100
+     $tab_project['posts'] = get_post_meta( get_the_ID(), 'project_to_team', true );
101
+
102
+     if ( is_plugin_active( 'lsx-projects/lsx-projects.php' ) && ( ! empty( $tab_project['posts'] ) ) ) {
103
+          $post_ids = join( ',', $tab_project['posts'] );
104
+          $tab_project['shortcode'] = '[lsx_projects columns="3" include="' . $post_ids . '"]';
105
+          $tabs[] = $tab_project;
106
+     }
107
+
108
+     // Tab Services
109
+
110
+     if ( is_plugin_active( 'lsx-services/lsx-services.php' ) ) {
111
+          $tab_service['post_type'] = 'service';
112
+          $tab_service['title'] = esc_html__( 'Services', 'lsx-team' );
113
+          $tab_service['posts'] = get_post_meta( get_the_ID(), 'service_to_team', true );
114
+
115
+          if ( ! empty( $tab_service['posts'] ) ) {
116
+               $post_ids = join( ',', $tab_service['posts'] );
117
+               $tab_service['shortcode'] = '[lsx_services columns="3" include="' . $post_ids . '"]';
118
+               $tabs[] = $tab_service;
119
+          }
120
+     }
121
+
122
+     // Tab Testimonials
123
+
124
+     $tab_testimonial['post_type'] = 'testimonial';
125
+     $tab_testimonial['title'] = esc_html__( 'Testimonials', 'lsx-team' );
126
+     $tab_testimonial['posts'] = get_post_meta( get_the_ID(), 'testimonial_to_team', true );
127
+
128
+     if ( is_plugin_active( 'lsx-testimonials/lsx-testimonials.php' ) && ( ! empty( $tab_testimonial['posts'] ) ) ) {
129
+          if ( count( $tab_testimonial['posts'] ) <= 2 ) {
130
+               $columns = count( $tab_testimonial['posts'] );
131
+          } else {
132
+               $columns = 2;
133
+          }
134
+
135
+          $post_ids = join( ',', $tab_testimonial['posts'] );
136
+          $tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]';
137
+          $tabs[] = $tab_testimonial;
138
+     }
139 139
 ?>
140 140
 
141 141
 <?php lsx_entry_before(); ?>
Please login to merge, or discard this patch.