1 | <?php |
||||
2 | /** |
||||
3 | * Team Archive |
||||
4 | * |
||||
5 | * @package tour-operator |
||||
6 | * @category team |
||||
7 | */ |
||||
8 | |||||
9 | get_header(); ?> |
||||
10 | |||||
11 | <?php lsx_content_wrap_before(); ?> |
||||
12 | |||||
13 | <div id="primary" class="content-area col-sm-12 <?php echo esc_attr( lsx_main_class() ); ?>"> |
||||
14 | |||||
15 | <?php lsx_content_before(); ?> |
||||
16 | |||||
17 | <main id="main" class="site-main" role="main"> |
||||
18 | |||||
19 | <?php lsx_content_top(); ?> |
||||
20 | |||||
21 | <?php if ( have_posts() ) : ?> |
||||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||||
22 | |||||
23 | <?php |
||||
24 | $header_before = ''; |
||||
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. ![]() |
|||||
25 | $group_items_by_role = false; |
||||
26 | |||||
27 | if ( isset( tour_operator()->options['team'] ) && isset( tour_operator()->options['team']['group_items_by_role'] ) ) { |
||||
0 ignored issues
–
show
|
|||||
28 | $group_items_by_role = true; |
||||
29 | } |
||||
30 | |||||
31 | $count = 0; |
||||
32 | ?> |
||||
33 | |||||
34 | <?php while ( have_posts() ) : the_post(); ?> |
||||
0 ignored issues
–
show
|
|||||
35 | |||||
36 | <?php |
||||
37 | if ( true === $group_items_by_role ) { |
||||
0 ignored issues
–
show
|
|||||
38 | $header_current = get_the_terms( get_the_id(), 'role' ); |
||||
0 ignored issues
–
show
It seems like
get_the_id() can also be of type false ; however, parameter $post of get_the_terms() does only seem to accept WP_Post|integer , 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
![]() |
|||||
39 | $header_html = ''; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 4 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. ![]() |
|||||
40 | |||||
41 | if ( ! is_wp_error( $header_current ) && is_array( $header_current ) && ! empty( $header_current ) ) { |
||||
0 ignored issues
–
show
|
|||||
42 | $header_current = $header_current[0]->name; |
||||
43 | |||||
44 | if ( $header_before !== $header_current ) { |
||||
0 ignored issues
–
show
|
|||||
45 | $header_html = '<h3 class="lsx-to-archive-items-separator lsx-title">' . $header_current . '</h3>'; |
||||
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. ![]() |
|||||
46 | $header_before = $header_current; |
||||
47 | } |
||||
48 | } |
||||
49 | } |
||||
50 | |||||
51 | $count++; |
||||
52 | ?> |
||||
53 | |||||
54 | <?php if ( $count > 1 && true === $group_items_by_role && ! empty( $header_html ) ) { ?> |
||||
0 ignored issues
–
show
|
|||||
55 | </div> |
||||
56 | <?php } ?> |
||||
57 | |||||
58 | <?php if ( 1 === $count || ( true === $group_items_by_role && ! empty( $header_html ) ) ) { ?> |
||||
0 ignored issues
–
show
|
|||||
59 | <?php if ( true === $group_items_by_role && ! empty( $header_html ) ) { ?> |
||||
0 ignored issues
–
show
|
|||||
60 | <?php echo wp_kses_post( $header_html ); ?> |
||||
61 | <?php } ?> |
||||
62 | |||||
63 | <div class="row lsx-to-archive-items lsx-to-archive-template-<?php echo esc_attr( tour_operator()->archive_layout ); ?> lsx-to-archive-template-image-<?php echo esc_attr( tour_operator()->archive_list_layout_image_style ); ?>"> |
||||
64 | <?php } ?> |
||||
65 | |||||
66 | <div class="<?php echo esc_attr( lsx_to_archive_class( 'lsx-to-archive-item' ) ); ?>"> |
||||
67 | <?php lsx_to_team_content( 'content', 'team' ); ?> |
||||
68 | </div> |
||||
69 | |||||
70 | <?php if ( $GLOBALS['wp_query']->post_count === $count ) { ?> |
||||
0 ignored issues
–
show
|
|||||
71 | </div> |
||||
72 | <?php } ?> |
||||
73 | |||||
74 | <?php endwhile; ?> |
||||
75 | |||||
76 | <?php else : ?> |
||||
0 ignored issues
–
show
|
|||||
77 | |||||
78 | <?php get_template_part( 'partials/content', 'none' ); ?> |
||||
79 | |||||
80 | <?php endif; ?> |
||||
81 | |||||
82 | <?php lsx_content_bottom(); ?> |
||||
83 | |||||
84 | </main><!-- #main --> |
||||
85 | |||||
86 | <?php lsx_content_after(); ?> |
||||
87 | |||||
88 | </div><!-- #primary --> |
||||
89 | |||||
90 | <?php lsx_content_wrap_after(); ?> |
||||
91 | |||||
92 | <?php //get_sidebar(); ?> |
||||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
75% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
|||||
93 | |||||
94 | <?php get_footer(); |
||||
0 ignored issues
–
show
|
|||||
95 |