Issues (4138)

templates/content-archive-recipe.php (1 issue)

1
<?php
2
/**
3
 * Template used to display post content on widgets and archive pages.
4
 *
5
 * @package lsx-health-plan
6
 */
7
global $shortcode_args;
8
?>
9
10
<?php lsx_entry_before(); ?>
11
12
<?php
13
$column_class = '4';
14
// Check for shortcode overrides.
15
if ( null !== $shortcode_args ) {
16
	if ( isset( $shortcode_args['columns'] ) ) {
17
		$column_class = $shortcode_args['columns'];
18
		$column_class = \lsx_health_plan\functions\column_class( $column_class );
19
	}
20
}
21
?>
22
23
<div class="col-xs-12 col-sm-6 col-md-<?php echo esc_attr( $column_class ); ?>">
24
	<article class="lsx-slot box-shadow">
25
		<?php lsx_entry_top(); ?>
26
27
		<?php lsx_hp_recipe_plan_meta(); ?>
28
29
		<div class="recipe-feature-img">
30
			<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 ignore-type  annotation

30
			<a href="<?php echo esc_url( /** @scrutinizer ignore-type */ get_permalink() ); ?>">
Loading history...
31
			<?php
32
			$featured_image = get_the_post_thumbnail();
33
			if ( ! empty( $featured_image ) && '' !== $featured_image ) {
34
				the_post_thumbnail( 'lsx-thumbnail-square', array(
35
					'class' => 'aligncenter',
36
				) );
37
			} else {
38
				?>
39
				<img loading="lazy" class="placeholder" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>">
40
				<?php
41
			}
42
			?>
43
			</a>
44
		</div>
45
		<div class="content-box white-bg">
46
			<?php lsx_health_plan_recipe_data(); ?>
47
			<a class="recipe-title-link" href="<?php echo esc_url( get_permalink() ); ?>">
48
				<?php the_title( '<h3 class="recipe-title">', '</h3>' ); ?>
49
			</a>
50
			<a href="<?php echo esc_url( get_permalink() ); ?>" class="btn border-btn"><?php esc_html_e( 'See Recipe', 'lsx-health-plan' ); ?></a>
51
		</div>
52
		<?php lsx_entry_bottom(); ?>
53
	</article>
54
</div>
55
56
<?php
57
lsx_entry_after();
58