Issues (1082)

templates/content-widget-team.php (22 issues)

1
<?php
2
/**
3
 * Team Widget Content Part
4
 *
5
 * @package 	tour-operator
6
 * @category	team
7
 * @subpackage	widget
8
 */
9
10
global $disable_placeholder, $disable_text, $post, $disable_view_more;
11
12
$member_name = get_the_title();
13
14
$has_single = ! lsx_to_is_single_disabled();
15
$permalink = '';
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 2 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.

Loading history...
16
17
if ( $has_single ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
18
	$permalink = get_the_permalink();
19
} elseif ( ! is_post_type_archive( 'team' ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
20
	$has_single = true;
21
	$permalink = get_post_type_archive_link( 'team' ) . '#team-' . $post->post_name;
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 2 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.

Loading history...
22
}
23
?>
24
<article <?php post_class(); ?>>
25
	<?php if ( empty( $disable_placeholder ) ) { ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
26
		<div class="lsx-to-widget-thumb">
27
			<?php if ( $has_single ) { ?><a href="<?php echo esc_url( $permalink ); ?>"><?php } ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
28
				<?php lsx_thumbnail( 'lsx-thumbnail-square' ); ?>
29
			<?php if ( $has_single ) { ?></a><?php } ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
30
		</div>
31
	<?php } ?>
32
33
	<h4 class="lsx-to-widget-title text-center">
34
		<?php if ( $has_single ) { ?><a href="<?php echo esc_url( $permalink ); ?>"><?php } ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
35
			<?php the_title(); ?>
36
		<?php if ( $has_single ) { ?></a><?php } ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
37
	</h4>
38
39
	<?php
40
	if ( empty( $disable_text ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
41
		lsx_to_team_role( '<p class="lsx-to-widget-tagline text-center">', '</p>' );
42
43
		$member_description = apply_filters( 'the_excerpt', get_the_excerpt() );
44
45
		if ( empty( $member_description ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
46
			$member_description = apply_filters( 'the_excerpt', wp_trim_words( $post->post_content, 20 ) );
47
		}
48
49
		$member_description = ! empty( $member_description ) ? "<div class='lsx-team-description'>$member_description</div>" : '';
50
		echo wp_kses_post( $member_description );
51
	}
52
	?>
53
54
	<?php if ( $has_single && empty( $disable_view_more ) ) { ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
55
		<p class="text-center lsx-to-single-link"><a href="<?php echo esc_url( $permalink ); ?>"><?php echo esc_html__( 'More about', 'to-team' ) . ' ' . esc_html( strtok( $member_name, ' ' ) ); ?> <i class="fa fa-angle-right" aria-hidden="true"></i></a></p>
56
	<?php } ?>
57
</article>
58