Issues (4138)

templates/partials/content-shortcode-exercise.php (21 issues)

1
<?php
2
/**
3
 * Template used to display post content on widgets and archive pages.
4
 *
5
 * @package lsx-health-plan
6
 */
0 ignored issues
show
There must be exactly one blank line after the file comment
Loading history...
7
global $shortcode_args;
8
9
$column_class = '4';
10
// Check for shortcode overrides.
11
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...
12
	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...
13
		$column_class = $shortcode_args['columns'];
14
		$column_class = \lsx_health_plan\functions\column_class( $column_class );
15
	}
16
}
17
18
lsx_entry_before();
19
20
$post_id        = get_the_id();
21
$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

21
$featured_image = get_the_post_thumbnail_url( /** @scrutinizer ignore-type */ $post_id, $image_size );
Loading history...
22
?>
23
<div class="col-xs-12 col-sm-6 col-md-<?php echo esc_attr( $column_class ); ?>">
24
	<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

24
	<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...
25
		<?php
26
		if ( isset( $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...
27
			echo wp_kses_post( lsx_health_plan_shortcode_exercise_button( $post_id, true ) );
0 ignored issues
show
It seems like $post_id can also be of type false; however, parameter $m of lsx_health_plan_shortcode_exercise_button() does only seem to accept 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

27
			echo wp_kses_post( lsx_health_plan_shortcode_exercise_button( /** @scrutinizer ignore-type */ $post_id, true ) );
Loading history...
lsx_health_plan_shortcod..._button($post_id, true) 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

27
			echo wp_kses_post( /** @scrutinizer ignore-type */ lsx_health_plan_shortcode_exercise_button( $post_id, true ) );
Loading history...
28
		}
29
30
		if ( 'item' === $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...
31
			?>
32
			<a href="<?php echo esc_url( get_permalink() ); ?>" class="exercise-link excerpt-<?php echo esc_html( $description ); ?>">
33
			<?php
34
		} else {
35
			?>
36
			<div class="exercise-link excerpt-<?php echo esc_html( $description ); ?>">
37
			<?php
38
		}
39
		?>
40
41
		<?php lsx_health_plan_exercise_title( '<h4 class="lsx-exercises-title">', '</h4>', false ); ?>
42
		<?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...
43
			<?php
44
			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...
45
				$excerpt = \lsx_health_plan\functions\hp_excerpt( $post_id );
46
				?>
47
				<p class="lsx-exercises-excerpt"><?php echo wp_kses_post( $excerpt ); ?></p>
48
			<?php } ?>
49
			<?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...
50
				<?php echo wp_kses_post( get_the_content() ); ?>
51
			<?php } ?>
52
		<?php } ?>
53
		<?php
54
		if ( isset( $link ) && ( 'item' === $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...
55
		?>
56
			</a>
57
		<?php } else { ?>
58
			</div>
59
		<?php } ?>
60
	</div>
61
</div>
62
<?php
63
lsx_entry_after();
64