1 | <?php |
||||||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||||||
2 | /** |
||||||
3 | * LSX Team Main Class |
||||||
4 | * |
||||||
5 | * @package LSX Team |
||||||
6 | * @author LightSpeed |
||||||
7 | * @license GPL3 |
||||||
8 | * @link |
||||||
9 | * @copyright 2018 LightSpeed |
||||||
10 | */ |
||||||
11 | class LSX_Team { |
||||||
12 | |||||||
13 | public $options; |
||||||
0 ignored issues
–
show
|
|||||||
14 | |||||||
15 | public function __construct() { |
||||||
0 ignored issues
–
show
|
|||||||
16 | $this->options = team_get_options(); |
||||||
17 | |||||||
18 | add_action( 'init', array( $this, 'custom_image_sizes' ) ); |
||||||
19 | add_filter( 'lsx_banner_allowed_post_types', array( $this, 'lsx_banner_allowed_post_types' ) ); |
||||||
20 | |||||||
21 | } |
||||||
0 ignored issues
–
show
|
|||||||
22 | |||||||
23 | /** |
||||||
0 ignored issues
–
show
|
|||||||
24 | * Enable project custom post type on LSX Banners. |
||||||
25 | */ |
||||||
26 | public function custom_image_sizes( $post_types ) { |
||||||
27 | add_image_size( 'lsx-team-archive', 170, 170, true ); |
||||||
28 | add_image_size( 'lsx-team-single', 320, 320, true ); |
||||||
29 | } |
||||||
0 ignored issues
–
show
|
|||||||
30 | |||||||
31 | /** |
||||||
0 ignored issues
–
show
|
|||||||
32 | * Enable project custom post type on LSX Banners. |
||||||
33 | */ |
||||||
34 | public function lsx_banner_allowed_post_types( $post_types ) { |
||||||
35 | $post_types[] = 'team'; |
||||||
36 | return $post_types; |
||||||
37 | } |
||||||
0 ignored issues
–
show
|
|||||||
38 | |||||||
39 | /** |
||||||
0 ignored issues
–
show
|
|||||||
40 | * Return the team thumbnail. |
||||||
41 | */ |
||||||
42 | public function get_thumbnail( $post_id, $size ) { |
||||||
43 | add_filter( 'lsx_placeholder_url', array( $this, 'placeholder' ), 10, 1 ); |
||||||
44 | add_filter( 'lsx_to_placeholder_url', array( $this, 'placeholder' ), 10, 1 ); |
||||||
45 | |||||||
46 | if ( is_numeric( $size ) ) { |
||||||
0 ignored issues
–
show
|
|||||||
47 | $thumb_size = array( $size, $size ); |
||||||
48 | } else { |
||||||
49 | $thumb_size = $size; |
||||||
50 | } |
||||||
51 | |||||||
52 | $thumbnail_class = 'img-responsive'; |
||||||
53 | |||||||
54 | if ( ! empty( get_the_post_thumbnail( $post_id ) ) || ! empty( get_post_meta( $post_id, 'lsx_email_gravatar', true ) ) ) { |
||||||
0 ignored issues
–
show
|
|||||||
55 | if ( ! empty( get_the_post_thumbnail( $post_id ) ) ) { |
||||||
0 ignored issues
–
show
|
|||||||
56 | $thumbnail = get_the_post_thumbnail( $post_id, $thumb_size, array( |
||||||
0 ignored issues
–
show
|
|||||||
57 | 'class' => $thumbnail_class, |
||||||
58 | ) ); |
||||||
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
![]() |
|||||||
59 | } else { |
||||||
60 | $thumbnail = get_avatar( get_post_meta( $post_id, 'lsx_email_gravatar', true ), $size, $this->options['display']['team_placeholder'], false, array( |
||||||
0 ignored issues
–
show
false of type false is incompatible with the type string expected by parameter $alt of get_avatar() .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
61 | 'class' => $thumbnail_class, |
||||||
62 | ) ); |
||||||
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
![]() |
|||||||
63 | } |
||||||
64 | } |
||||||
0 ignored issues
–
show
|
|||||||
65 | if ( empty( $thumbnail ) ) { |
||||||
0 ignored issues
–
show
|
|||||||
66 | if ( $this->options['display'] && ! empty( $this->options['display']['team_placeholder'] ) ) { |
||||||
0 ignored issues
–
show
|
|||||||
67 | $thumbnail = '<img loading="lazy" class="img-responsive wp-post-image" src="' . $this->options['display']['team_placeholder'] . '" width="' . $size . '" />'; |
||||||
68 | } else { |
||||||
69 | $thumbnail = '<img loading="lazy" class="img-responsive wp-post-image" src="https://www.gravatar.com/avatar/none?d=mm&s=' . $size . '" width="' . $size . '" />'; |
||||||
70 | } |
||||||
71 | } |
||||||
72 | |||||||
73 | remove_filter( 'lsx_placeholder_url', array( $this, 'placeholder' ), 10, 1 ); |
||||||
0 ignored issues
–
show
The call to
remove_filter() has too many arguments starting with 1 .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above. ![]() |
|||||||
74 | remove_filter( 'lsx_to_placeholder_url', array( $this, 'placeholder' ), 10, 1 ); |
||||||
75 | |||||||
76 | return $thumbnail; |
||||||
77 | } |
||||||
0 ignored issues
–
show
|
|||||||
78 | |||||||
79 | /** |
||||||
0 ignored issues
–
show
|
|||||||
80 | * Replaces the widget with Mystery Man |
||||||
81 | */ |
||||||
82 | public function placeholder( $image ) { |
||||||
83 | $image = array( |
||||||
84 | LSX_TEAM_URL . 'assets/img/mystery-man-square.png', |
||||||
85 | 512, |
||||||
86 | 512, |
||||||
87 | true, |
||||||
88 | ); |
||||||
89 | |||||||
90 | return $image; |
||||||
91 | } |
||||||
0 ignored issues
–
show
|
|||||||
92 | |||||||
93 | /** |
||||||
0 ignored issues
–
show
|
|||||||
94 | * Returns the shortcode output markup |
||||||
95 | */ |
||||||
96 | public function output( $atts ) { |
||||||
97 | extract( shortcode_atts(array( |
||||||
0 ignored issues
–
show
|
|||||||
98 | 'columns' => 4, |
||||||
0 ignored issues
–
show
|
|||||||
99 | 'orderby' => 'name', |
||||||
0 ignored issues
–
show
|
|||||||
100 | 'order' => 'ASC', |
||||||
0 ignored issues
–
show
|
|||||||
101 | 'role' => '', |
||||||
0 ignored issues
–
show
|
|||||||
102 | 'limit' => '99', |
||||||
0 ignored issues
–
show
|
|||||||
103 | 'include' => '', |
||||||
0 ignored issues
–
show
|
|||||||
104 | 'display' => 'excerpt', |
||||||
0 ignored issues
–
show
|
|||||||
105 | 'size' => 'lsx-team-archive', |
||||||
0 ignored issues
–
show
|
|||||||
106 | 'show_link' => false, |
||||||
0 ignored issues
–
show
|
|||||||
107 | 'show_email' => false, |
||||||
0 ignored issues
–
show
|
|||||||
108 | 'show_image' => true, |
||||||
0 ignored issues
–
show
|
|||||||
109 | 'show_roles' => false, |
||||||
0 ignored issues
–
show
|
|||||||
110 | 'show_job_title' => true, |
||||||
111 | 'show_desc' => true, |
||||||
0 ignored issues
–
show
|
|||||||
112 | 'show_social' => true, |
||||||
0 ignored issues
–
show
|
|||||||
113 | 'carousel' => true, |
||||||
0 ignored issues
–
show
|
|||||||
114 | 'featured' => false, |
||||||
0 ignored issues
–
show
|
|||||||
115 | ), $atts ) ); |
||||||
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
![]() |
|||||||
116 | |||||||
117 | $output = ''; |
||||||
118 | |||||||
119 | if ( ! empty( $include ) ) { |
||||||
0 ignored issues
–
show
|
|||||||
120 | $include = explode( ',', $include ); |
||||||
121 | |||||||
122 | $args = array( |
||||||
123 | 'post_type' => 'team', |
||||||
0 ignored issues
–
show
|
|||||||
124 | 'posts_per_page' => $limit, |
||||||
125 | 'post__in' => $include, |
||||||
0 ignored issues
–
show
|
|||||||
126 | 'orderby' => 'post__in', |
||||||
0 ignored issues
–
show
|
|||||||
127 | 'order' => $order, |
||||||
0 ignored issues
–
show
|
|||||||
128 | ); |
||||||
129 | } else { |
||||||
130 | $args = array( |
||||||
131 | 'post_type' => 'team', |
||||||
0 ignored issues
–
show
|
|||||||
132 | 'posts_per_page' => $limit, |
||||||
133 | 'orderby' => $orderby, |
||||||
0 ignored issues
–
show
|
|||||||
134 | 'order' => $order, |
||||||
0 ignored issues
–
show
|
|||||||
135 | ); |
||||||
136 | |||||||
137 | if ( 'true' === $featured || true === $featured ) { |
||||||
0 ignored issues
–
show
|
|||||||
138 | $args['meta_key'] = 'lsx_featured'; |
||||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||||||
139 | $args['meta_value'] = 1; |
||||||
0 ignored issues
–
show
|
|||||||
140 | } |
||||||
141 | } |
||||||
142 | |||||||
143 | if ( ! empty( $role ) ) { |
||||||
0 ignored issues
–
show
|
|||||||
144 | $args['tax_query'] = array( |
||||||
0 ignored issues
–
show
|
|||||||
145 | array( |
||||||
146 | 'taxonomy' => 'team_role', |
||||||
147 | 'field' => 'id', |
||||||
0 ignored issues
–
show
|
|||||||
148 | 'terms' => $role, |
||||||
0 ignored issues
–
show
|
|||||||
149 | ), |
||||||
150 | ); |
||||||
151 | } |
||||||
152 | |||||||
153 | $team = new \WP_Query( $args ); |
||||||
154 | |||||||
155 | if ( $team->have_posts() ) { |
||||||
0 ignored issues
–
show
|
|||||||
156 | global $post; |
||||||
157 | |||||||
158 | $count = 0; |
||||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 8 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||||||
159 | $count_global = 0; |
||||||
160 | |||||||
161 | $column_size = intval( 12 / $columns ); |
||||||
162 | |||||||
163 | $carousel = true === $carousel || 'true' === $carousel ? true : false; |
||||||
164 | |||||||
165 | if ( $carousel ) { |
||||||
0 ignored issues
–
show
|
|||||||
166 | $output .= "<div class='lsx-team-shortcode lsx-team-block' id='lsx-team-slider' data-slick='{\"slidesToShow\": $columns, \"slidesToScroll\": $columns }'>"; |
||||||
167 | } else { |
||||||
168 | $output .= "<div class='lsx-team-shortcode'><div class='row'>"; |
||||||
169 | } |
||||||
170 | |||||||
171 | while ( $team->have_posts() ) { |
||||||
0 ignored issues
–
show
|
|||||||
172 | $team->the_post(); |
||||||
173 | |||||||
174 | // Count |
||||||
0 ignored issues
–
show
|
|||||||
175 | $count++; |
||||||
176 | $count_global++; |
||||||
177 | |||||||
178 | $member_name = apply_filters( 'the_title', $post->post_title ); |
||||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 8 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||||||
179 | $member_roles = ''; |
||||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||||||
180 | $member_description = ''; |
||||||
181 | $member_avatar = ''; |
||||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||||||
182 | $member_socials = ''; |
||||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||||||
183 | $member_job_title = ''; |
||||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||||||
184 | $member_email = ''; |
||||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||||||
185 | $bottom_link = ''; |
||||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 8 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||||||
186 | $facebook = get_post_meta( $post->ID, 'lsx_facebook', true ); |
||||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 11 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||||||
187 | $twitter = get_post_meta( $post->ID, 'lsx_twitter', true ); |
||||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 12 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||||||
188 | $linkedin = get_post_meta( $post->ID, 'lsx_linkedin', true ); |
||||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 11 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||||||
189 | |||||||
190 | // Link to single |
||||||
0 ignored issues
–
show
|
|||||||
191 | if ( ( true === $show_link || 'true' === $show_link ) && ( empty( team_get_option( 'team_disable_single' ) ) ) ) { |
||||||
0 ignored issues
–
show
|
|||||||
192 | $bottom_link = '<a href="' . get_permalink( $post->ID ) . '" class="lsx-team-show-more">More about ' . strtok( $member_name, ' ' ) . '<i class="fa fa-long-arrow-right" aria-hidden="true"></i></a>'; |
||||||
0 ignored issues
–
show
Are you sure
get_permalink($post->ID) of type false|string can be used in concatenation ?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
193 | } |
||||||
194 | |||||||
195 | if ( true === $show_email || 'true' === $show_email ) { |
||||||
0 ignored issues
–
show
|
|||||||
196 | $email = get_post_meta( $post->ID, 'lsx_email_contact', true ); |
||||||
197 | |||||||
198 | $member_email = '<a href="mailto:' . sanitize_email( $email ) . '" class="lsx-team-email">' . sanitize_email( $email ) . '</a>'; |
||||||
0 ignored issues
–
show
It seems like
$email can also be of type false ; however, parameter $email of sanitize_email() does only seem to accept string , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
199 | } |
||||||
200 | |||||||
201 | if ( ( true === $show_link || 'true' === $show_link ) && ( empty( team_get_option( 'team_disable_single' ) ) ) ) { |
||||||
0 ignored issues
–
show
|
|||||||
202 | $member_name = '<h5 class="lsx-team-name"><a href="' . get_permalink() . '">' . $member_name . '</a></h5>'; |
||||||
0 ignored issues
–
show
Are you sure
get_permalink() of type false|string can be used in concatenation ?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
203 | } else { |
||||||
204 | $member_name = '<h5 class="lsx-team-name">' . $member_name . '</h5>'; |
||||||
205 | } |
||||||
206 | |||||||
207 | // Member roles |
||||||
0 ignored issues
–
show
|
|||||||
208 | if ( true === $show_roles || 'true' === $show_roles ) { |
||||||
0 ignored issues
–
show
|
|||||||
209 | $roles = ''; |
||||||
210 | $terms = get_the_terms( $post->ID, 'team_role' ); |
||||||
211 | |||||||
212 | if ( $terms && ! is_wp_error( $terms ) ) { |
||||||
0 ignored issues
–
show
|
|||||||
213 | $roles = array(); |
||||||
214 | |||||||
215 | foreach ( $terms as $term ) { |
||||||
0 ignored issues
–
show
|
|||||||
216 | $roles[] = $term->name; |
||||||
217 | } |
||||||
218 | |||||||
219 | $roles = join( ', ', $roles ); |
||||||
220 | } |
||||||
221 | |||||||
222 | $member_roles = '' !== $roles ? "<small class='lsx-team-roles'>$roles</small>" : ''; |
||||||
223 | } |
||||||
224 | |||||||
225 | if ( true === $show_job_title || 'true' === $show_job_title ) { |
||||||
0 ignored issues
–
show
|
|||||||
226 | $job_title = get_post_meta( $post->ID, 'lsx_job_title', true ); |
||||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 8 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||||||
227 | $member_job_title = ! empty( $job_title ) ? "<small class='lsx-team-job-title'>$job_title</small>" : ''; |
||||||
228 | } |
||||||
229 | |||||||
230 | // Member description |
||||||
0 ignored issues
–
show
|
|||||||
231 | if ( true === $show_desc || 'true' === $show_desc ) { |
||||||
0 ignored issues
–
show
|
|||||||
232 | if ( 'full' === $display ) { |
||||||
0 ignored issues
–
show
|
|||||||
233 | $member_description = apply_filters( 'the_content', get_the_content( esc_html__( 'Read More', 'lsx-team' ) ) ); |
||||||
234 | $member_description = str_replace( ']]>', ']]>', $member_description ); |
||||||
235 | } elseif ( 'excerpt' === $display ) { |
||||||
0 ignored issues
–
show
|
|||||||
236 | $member_description = apply_filters( 'the_excerpt', get_the_excerpt() ); |
||||||
237 | } |
||||||
238 | |||||||
239 | $member_description = ! empty( $member_description ) ? "<div class='lsx-team-description'>$member_description</div>" : ''; |
||||||
240 | } |
||||||
241 | |||||||
242 | // Member avatar |
||||||
0 ignored issues
–
show
|
|||||||
243 | if ( true === $show_image || 'true' === $show_image ) { |
||||||
0 ignored issues
–
show
|
|||||||
244 | $member_avatar = $this->get_thumbnail( $post->ID, $size ); |
||||||
245 | |||||||
246 | if ( ( true === $show_link || 'true' === $show_link ) && ( empty( $this->options['display'] ) || empty( team_get_option( 'team_disable_single' ) ) ) ) { |
||||||
0 ignored issues
–
show
|
|||||||
247 | $member_avatar = "<figure class='lsx-team-avatar'><a href='" . get_permalink() . "'>$member_avatar</a></figure>"; |
||||||
248 | } else { |
||||||
249 | $member_avatar = "<figure class='lsx-team-avatar'>$member_avatar</figure>"; |
||||||
250 | } |
||||||
251 | } |
||||||
252 | |||||||
253 | // Member socials |
||||||
0 ignored issues
–
show
|
|||||||
254 | if ( true === $show_social || 'true' === $show_social ) { |
||||||
0 ignored issues
–
show
|
|||||||
255 | $links = array( |
||||||
256 | 'facebook' => $facebook, |
||||||
257 | 'twitter' => $twitter, |
||||||
0 ignored issues
–
show
|
|||||||
258 | 'linkedin' => $linkedin, |
||||||
259 | ); |
||||||
260 | |||||||
261 | foreach ( $links as $sm => $sm_link ) { |
||||||
0 ignored issues
–
show
|
|||||||
262 | if ( ! empty( $sm_link ) ) { |
||||||
0 ignored issues
–
show
|
|||||||
263 | $member_socials .= "<li><a href='$sm_link' target='_blank'><i class='fa fa-$sm' aria-hidden='true'></i></a></li>"; |
||||||
264 | } |
||||||
265 | } |
||||||
266 | |||||||
267 | $member_socials = ! empty( $member_socials ) ? "<ul class='lsx-team-socials list-inline'>$member_socials</ul>" : ''; |
||||||
268 | } |
||||||
269 | |||||||
270 | if ( ! $carousel ) { |
||||||
0 ignored issues
–
show
|
|||||||
271 | $output .= "<div class='col-xs-12 col-md-$column_size'>"; |
||||||
272 | } |
||||||
273 | |||||||
274 | $output .= " |
||||||
275 | <div class='lsx-team-slot'> |
||||||
276 | $member_avatar |
||||||
277 | $member_name |
||||||
278 | $member_job_title |
||||||
279 | $member_roles |
||||||
280 | $member_description |
||||||
281 | $member_socials |
||||||
282 | $member_email |
||||||
283 | $bottom_link |
||||||
284 | </div> |
||||||
285 | "; |
||||||
286 | |||||||
287 | if ( ! $carousel ) { |
||||||
0 ignored issues
–
show
|
|||||||
288 | $output .= '</div>'; |
||||||
289 | |||||||
290 | if ( $count == $columns && $team->post_count > $count_global ) { |
||||||
0 ignored issues
–
show
|
|||||||
291 | $output .= '</div>'; |
||||||
292 | $output .= '<div class="row">'; |
||||||
293 | $count = 0; |
||||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||||||
294 | } |
||||||
295 | } |
||||||
296 | |||||||
297 | wp_reset_postdata(); |
||||||
298 | } |
||||||
299 | |||||||
300 | if ( ! $carousel ) { |
||||||
0 ignored issues
–
show
|
|||||||
301 | $output .= '</div>'; |
||||||
302 | } |
||||||
303 | |||||||
304 | $output .= '</div>'; |
||||||
305 | |||||||
306 | return $output; |
||||||
307 | } |
||||||
308 | } |
||||||
0 ignored issues
–
show
|
|||||||
309 | |||||||
310 | } |
||||||
311 | |||||||
312 | global $lsx_team; |
||||||
313 | $lsx_team = new LSX_Team(); |
||||||
314 |