lightspeeddevelopment /
lsx-health-plan
| 1 | <?php |
||||
| 2 | /** |
||||
| 3 | * Template used to display post content on widgets and archive pages. |
||||
| 4 | * |
||||
| 5 | * @package lsx-health-plan |
||||
| 6 | */ |
||||
| 7 | |||||
| 8 | $featured = get_post_meta( get_the_ID(), 'workout_featured_workout', true ); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 9 | ?> |
||||
| 10 | |||||
| 11 | <?php lsx_entry_before(); ?> |
||||
| 12 | |||||
| 13 | <div class="col-xs-12 col-sm-6 col-md-4"> |
||||
| 14 | <article class="lsx-slot box-shadow"> |
||||
| 15 | <?php lsx_entry_top(); ?> |
||||
| 16 | |||||
| 17 | <?php lsx_hp_exercise_plan_meta(); ?> |
||||
| 18 | |||||
| 19 | <div class="workout-feature-img"> |
||||
| 20 | <?php if ( $featured ) { ?> |
||||
|
0 ignored issues
–
show
|
|||||
| 21 | <span class="featured-workout"><?php lsx_get_svg_icon( 'icon-featured.svg' ); ?></span> |
||||
| 22 | <?php } ?> |
||||
| 23 | <a href="<?php echo esc_url( get_permalink() ); ?>"> |
||||
|
0 ignored issues
–
show
It seems like
get_permalink() 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
Loading history...
|
|||||
| 24 | <?php |
||||
| 25 | $featured_image = get_the_post_thumbnail(); |
||||
| 26 | if ( ! empty( $featured_image ) && '' !== $featured_image ) { |
||||
|
0 ignored issues
–
show
|
|||||
| 27 | the_post_thumbnail( 'lsx-thumbnail-square', array( |
||||
|
0 ignored issues
–
show
|
|||||
| 28 | 'class' => 'aligncenter', |
||||
| 29 | ) ); |
||||
|
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
Loading history...
|
|||||
| 30 | } else { |
||||
| 31 | ?> |
||||
| 32 | <img loading="lazy" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>"> |
||||
| 33 | <?php |
||||
| 34 | } |
||||
| 35 | ?> |
||||
| 36 | </a> |
||||
| 37 | </div> |
||||
| 38 | <div class="content-box workout-content-box white-bg"> |
||||
| 39 | <a href="<?php echo esc_url( get_permalink() ); ?>"> |
||||
| 40 | <?php the_title( '<h3 class="workout-title">', '</h3>' ); ?> |
||||
| 41 | </a> |
||||
| 42 | <?php |
||||
| 43 | if ( ! has_excerpt() ) { |
||||
|
0 ignored issues
–
show
|
|||||
| 44 | $content = wp_trim_words( get_the_content(), 20 ); |
||||
| 45 | $content = '<p>' . $content . '</p>'; |
||||
| 46 | } else { |
||||
| 47 | $content = apply_filters( 'the_excerpt', get_the_excerpt() ); |
||||
| 48 | } |
||||
|
0 ignored issues
–
show
|
|||||
| 49 | echo wp_kses_post( $content ); |
||||
| 50 | ?> |
||||
| 51 | <a href="<?php echo esc_url( get_permalink() ); ?>" class="btn border-btn"><?php esc_html_e( 'See workout', 'lsx-health-plan' ); ?></a> |
||||
| 52 | </div> |
||||
| 53 | <?php lsx_entry_bottom(); ?> |
||||
| 54 | </article> |
||||
| 55 | </div> |
||||
| 56 | |||||
| 57 | <?php |
||||
| 58 | lsx_entry_after(); |
||||
| 59 |