1 | <?php |
||||
2 | /** |
||||
3 | * Template used to display post content on single pages. |
||||
4 | * |
||||
5 | * @package lsx-health-plan |
||||
6 | */ |
||||
7 | |||||
8 | // Getting translated endpoint. |
||||
9 | |||||
10 | $archive_meals = \lsx_health_plan\functions\get_option( 'endpoint_meal_archive', 'meals' ); |
||||
11 | $meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' ); |
||||
12 | |||||
13 | $connected_members = get_post_meta( get_the_ID(), ( $meal . '_connected_team_member' ), true ); |
||||
0 ignored issues
–
show
Bug
introduced
by
![]() Are you sure
$meal of type array|mixed can be used in concatenation ?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
14 | $connected_articles = get_post_meta( get_the_ID(), ( $meal . '_connected_articles' ), true ); |
||||
15 | |||||
16 | ?> |
||||
17 | |||||
18 | <?php lsx_entry_before(); ?> |
||||
19 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
||||
20 | <?php lsx_entry_top(); ?> |
||||
21 | |||||
22 | <div class="entry-meta"> |
||||
23 | <?php lsx_post_meta_single_bottom(); ?> |
||||
24 | </div><!-- .entry-meta --> |
||||
25 | |||||
26 | <div class="entry-content"> |
||||
27 | <div class="single-plan-inner meal-content"> |
||||
28 | <?php |
||||
29 | if ( is_singular( 'meal' ) ) { ?> |
||||
0 ignored issues
–
show
|
|||||
30 | <div class="single-plan-section-title meal-plan title-lined"> |
||||
31 | <?php lsx_get_svg_icon( 'meal.svg' ); ?> |
||||
32 | <h2><?php the_title(); ?></h2> |
||||
33 | <?php if ( class_exists( 'LSX_Sharing' ) ) { |
||||
0 ignored issues
–
show
|
|||||
34 | lsx_content_sharing(); |
||||
35 | } ?> |
||||
0 ignored issues
–
show
|
|||||
36 | </div> |
||||
37 | <?php } else { ?> |
||||
38 | <div class="single-plan-section-title meal-plan title-lined"> |
||||
39 | <?php lsx_get_svg_icon( 'meal.svg' ); ?> |
||||
40 | <h2><?php esc_html_e( 'My Meal Plan', 'lsx-health-plan' ); ?> <?php the_title(); ?></h2> |
||||
41 | </div> |
||||
42 | <?php } ?> |
||||
43 | |||||
44 | <?php require LSX_HEALTH_PLAN_PATH . 'templates/partials/meal-plans.php'; ?> |
||||
45 | </div> |
||||
46 | |||||
47 | </div><!-- .entry-content --> |
||||
48 | <?php lsx_entry_bottom(); ?> |
||||
49 | |||||
50 | </article><!-- #post-## --> |
||||
51 | |||||
52 | <div class="back-plan-btn"> |
||||
53 | <?php if ( is_single() && is_singular( 'meal' ) ) { ?> |
||||
0 ignored issues
–
show
|
|||||
54 | <a class="btn border-btn" href="/<?php echo $archive_meals; ?>"><?php esc_html_e( 'Back to meals', 'lsx-health-plan' ); ?></a> |
||||
0 ignored issues
–
show
Are you sure
$archive_meals of type array|mixed can be used in echo ?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
55 | <?php } ?> |
||||
56 | |||||
57 | <?php |
||||
58 | // Shoping list |
||||
0 ignored issues
–
show
|
|||||
59 | $shopping_list = get_post_meta( get_the_ID(), 'meal_shopping_list', true ); |
||||
60 | if ( ! empty( $shopping_list ) ) { |
||||
0 ignored issues
–
show
|
|||||
61 | ?> |
||||
62 | <a class="btn border-btn btn-shopping" href="<?php echo esc_url( get_page_link( $shopping_list ) ); ?>" target="_blank"><?php esc_html_e( 'Download Shopping List', 'lsx-health-plan' ); ?><i class="fa fa-download" aria-hidden="true"></i></a> |
||||
0 ignored issues
–
show
It seems like
$shopping_list can also be of type string ; however, parameter $post of get_page_link() 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
![]() |
|||||
63 | <?php |
||||
64 | } |
||||
65 | |||||
66 | ?> |
||||
67 | </div> |
||||
68 | |||||
69 | <?php |
||||
70 | if ( ! empty( $connected_articles ) ) { |
||||
0 ignored issues
–
show
|
|||||
71 | lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) ); |
||||
72 | } |
||||
73 |