Issues (4138)

templates/partials/content-default.php (17 issues)

1
<?php
2
/**
3
 * Template used to display post content default.
4
 *
5
 * @package lsx-health-plan
6
 */
7
8
global $shortcode_args;
9
10
$column_class = '4';
11
// Check for shortcode overrides.
12
if ( null !== $shortcode_args ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
13
	if ( isset( $shortcode_args['columns'] ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
14
		$column_class = $shortcode_args['columns'];
15
		$column_class = \lsx_health_plan\functions\column_class( $column_class );
16
	}
17
}
18
19
lsx_entry_before();
20
21
$post_id        = get_the_id();
22
$featured_image = get_the_post_thumbnail_url( $post_id, $image_size );
0 ignored issues
show
It seems like $post_id can also be of type false; however, parameter $post of get_the_post_thumbnail_url() 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 ignore-type  annotation

22
$featured_image = get_the_post_thumbnail_url( /** @scrutinizer ignore-type */ $post_id, $image_size );
Loading history...
23
?>
24
<div class="col-xs-12 col-sm-6 col-md-<?php echo esc_attr( $column_class ); ?>">
25
	<div style="background-image:url('<?php echo esc_url( $featured_image ); ?>')" class="lsx-exercises-item bg-<?php echo esc_html( $image_size ); ?>">
0 ignored issues
show
It seems like $featured_image can also be of type false; however, parameter $url of esc_url() 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 ignore-type  annotation

25
	<div style="background-image:url('<?php echo esc_url( /** @scrutinizer ignore-type */ $featured_image ); ?>')" class="lsx-exercises-item bg-<?php echo esc_html( $image_size ); ?>">
Loading history...
26
		<?php
27
28
		if ( ( 'item' === $link ) || ( 'modal' === $link ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
29
			?>
30
			<a href="<?php echo esc_url( get_permalink() ); ?>" class="exercise-link excerpt-<?php echo esc_html( $description ); ?>">
31
			<?php
32
		} else {
33
			?>
34
			<div class="exercise-link excerpt-<?php echo esc_html( $description ); ?>">
35
			<?php
36
		}
37
		?>
38
39
		<?php the_title( '<h4 class="lsx-exercises-title">', '</h4>' ); ?>
40
		<?php if ( isset( $description ) && ( 'none' !== $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...
41
			<?php
42
			if ( 'excerpt' === $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...
43
				$excerpt = \lsx_health_plan\functions\hp_excerpt( $post_id );
44
				?>
45
				<p class="lsx-exercises-excerpt"><?php echo wp_kses_post( $excerpt ); ?></p>
0 ignored issues
show
$excerpt of type void is incompatible with the type string expected by parameter $data of wp_kses_post(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

45
				<p class="lsx-exercises-excerpt"><?php echo wp_kses_post( /** @scrutinizer ignore-type */ $excerpt ); ?></p>
Loading history...
46
			<?php } ?>
47
			<?php if ( 'full' === $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...
48
				<?php echo wp_kses_post( get_the_content() ); ?>
49
			<?php } ?>
50
		<?php } ?>
51
		<?php
52
		if ( isset( $link ) && ( ( 'item' === $link ) || ( 'modal' === $link ) ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
53
		?>
54
			</a>
55
		<?php } else { ?>
56
			</div>
57
		<?php } ?>
58
	</div>
59
</div>
60
<?php
61
lsx_entry_after();
62