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
Coding Style
introduced
by
![]() |
|||||||
7 | global $shortcode_args; |
||||||
8 | |||||||
9 | $column_class = '4'; |
||||||
10 | // Check for shortcode overrides. |
||||||
11 | if ( null !== $shortcode_args ) { |
||||||
0 ignored issues
–
show
|
|||||||
12 | if ( isset( $shortcode_args['columns'] ) ) { |
||||||
0 ignored issues
–
show
|
|||||||
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
![]() |
|||||||
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
![]() |
|||||||
25 | <?php |
||||||
26 | if ( isset( $link ) && ( 'modal' === $link ) ) { |
||||||
0 ignored issues
–
show
|
|||||||
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
![]() 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
![]() |
|||||||
28 | } |
||||||
29 | |||||||
30 | if ( 'item' === $link ) { |
||||||
0 ignored issues
–
show
|
|||||||
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
|
|||||||
43 | <?php |
||||||
44 | if ( 'excerpt' === $description ) { |
||||||
0 ignored issues
–
show
|
|||||||
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
|
|||||||
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
|
|||||||
55 | ?> |
||||||
56 | </a> |
||||||
57 | <?php } else { ?> |
||||||
58 | </div> |
||||||
59 | <?php } ?> |
||||||
60 | </div> |
||||||
61 | </div> |
||||||
62 | <?php |
||||||
63 | lsx_entry_after(); |
||||||
64 |