lightspeeddevelopment /
lsx-health-plan
| 1 | <?php |
||||
| 2 | /** |
||||
| 3 | * Template used to display post content on single pages. |
||||
| 4 | * |
||||
| 5 | * @package lsx-health-plan |
||||
| 6 | */ |
||||
| 7 | |||||
| 8 | global $shortcode_args; |
||||
| 9 | |||||
| 10 | // Getting translated endpoint. |
||||
| 11 | $archive_workout = \lsx_health_plan\functions\get_option( 'endpoint_workout_archive', 'workout' ); |
||||
| 12 | $workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ); |
||||
| 13 | |||||
| 14 | $connected_articles = get_post_meta( get_the_ID(), ( $workout . '_connected_articles' ), true ); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
It seems like
get_the_ID() can also be of type false; however, parameter $post_id of get_post_meta() 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
Loading history...
|
|||||
| 15 | |||||
| 16 | ?> |
||||
| 17 | |||||
| 18 | <?php lsx_entry_before(); ?> |
||||
| 19 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
||||
| 20 | |||||
| 21 | <?php lsx_entry_top(); ?> |
||||
| 22 | |||||
| 23 | <div class="entry-meta"> |
||||
| 24 | <?php lsx_post_meta_single_bottom(); ?> |
||||
| 25 | </div><!-- .entry-meta --> |
||||
| 26 | <?php |
||||
| 27 | if ( is_singular( 'workout' ) ) { |
||||
|
0 ignored issues
–
show
|
|||||
| 28 | the_content(); |
||||
| 29 | } |
||||
| 30 | ?> |
||||
| 31 | <div class="entry-content"> |
||||
| 32 | <div class="single-plan-inner workout-content"> |
||||
| 33 | <?php |
||||
| 34 | if ( is_singular( 'workout' ) ) { ?> |
||||
|
0 ignored issues
–
show
|
|||||
| 35 | <div class="single-plan-section-title workout title-lined"> |
||||
| 36 | <?php lsx_get_svg_icon( 'work.svg' ); ?> |
||||
| 37 | <h2><?php the_title(); ?></h2> |
||||
| 38 | <?php if ( class_exists( 'LSX_Sharing' ) ) { |
||||
|
0 ignored issues
–
show
|
|||||
| 39 | lsx_content_sharing(); |
||||
| 40 | } ?> |
||||
|
0 ignored issues
–
show
|
|||||
| 41 | </div> |
||||
| 42 | <?php } else { ?> |
||||
| 43 | <div class="single-plan-section-title workout title-lined"> |
||||
| 44 | <?php lsx_get_svg_icon( 'work.svg' ); ?> |
||||
| 45 | <h2><?php esc_html_e( 'My Workout', 'lsx-health-plan' ); ?></h2> |
||||
| 46 | </div> |
||||
| 47 | <?php } ?> |
||||
| 48 | <?php lsx_health_plan_workout_box(); ?> |
||||
| 49 | <?php lsx_health_plan_workout_sets(); ?> |
||||
| 50 | </div> |
||||
| 51 | </div><!-- .entry-content --> |
||||
| 52 | |||||
| 53 | <?php lsx_entry_bottom(); ?> |
||||
| 54 | |||||
| 55 | </article><!-- #post-## --> |
||||
| 56 | <?php if ( is_singular( $workout ) ) { ?> |
||||
|
0 ignored issues
–
show
|
|||||
| 57 | <div class="back-plan-btn"> |
||||
| 58 | <a class="btn" href="/<?php echo $archive_workout; ?>"><?php esc_html_e( 'Back to workouts', 'lsx-health-plan' ); ?></a> |
||||
|
0 ignored issues
–
show
Are you sure
$archive_workout 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
Loading history...
|
|||||
| 59 | </div> |
||||
| 60 | <?php } ?> |
||||
| 61 | <?php |
||||
| 62 | if ( ! empty( $connected_articles ) ) { |
||||
|
0 ignored issues
–
show
|
|||||
| 63 | lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) ); |
||||
| 64 | } |
||||
| 65 |