1 | <?php |
||
2 | /** |
||
3 | * Template used to display single planf top nav. |
||
4 | * |
||
5 | * @package lsx-health-plan |
||
6 | */ |
||
7 | |||
8 | $plan_link = get_permalink(); |
||
9 | $current_section = get_query_var( 'section', false ); |
||
10 | if ( '' !== $current_section ) { |
||
11 | $plan_link = \lsx_health_plan\functions\plan\get_permalink( get_the_ID(), $current_section ); |
||
12 | } |
||
13 | |||
14 | if ( false !== $current_section && \lsx_health_plan\functions\plan\has_sections() ) { |
||
15 | $section_info = \lsx_health_plan\functions\plan\get_section_info( $current_section ); |
||
16 | if ( empty( $section_info ) || ( isset( $section_info['rest_day_enabled'] ) && ! empty( $section_info['rest_day_enabled'] ) && ! lsx_health_plan_has_meal() ) ) { |
||
17 | return; |
||
18 | } |
||
19 | } |
||
20 | |||
21 | ?> |
||
22 | <div id="single-plan-nav"> |
||
23 | <ul class="nav nav-pills"> |
||
24 | <li class="<?php lsx_health_plan_nav_class( '' ); ?>"><a class="overview-tab" href="<?php echo esc_attr( $plan_link ); ?>"><?php lsx_get_svg_icon( 'eye.svg' ); ?> <?php esc_html_e( 'Overview', 'lsx-health-plan' ); ?></a></li> |
||
25 | <?php |
||
26 | if ( lsx_health_plan_has_warmup() ) { |
||
27 | $warm_up = \lsx_health_plan\functions\get_option( 'endpoint_warm_up', false ); |
||
28 | if ( false === $warm_up ) { |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
29 | $warm_up = 'warm-up'; |
||
30 | } |
||
31 | ?> |
||
32 | <li class="<?php lsx_health_plan_nav_class( 'warm-up' ); ?>"><a class="warm-up-tab" href="<?php echo esc_attr( $plan_link ); ?><?php echo esc_attr( $warm_up ); ?>/"><?php lsx_get_svg_icon( 'warm.svg' ); ?> <?php esc_html_e( 'Warm-up', 'lsx-health-plan' ); ?></a></li> |
||
33 | <?php |
||
34 | } |
||
35 | if ( lsx_health_plan_has_workout() ) { |
||
36 | $workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', false ); |
||
37 | if ( false === $workout ) { |
||
0 ignored issues
–
show
|
|||
38 | $workout = 'workout'; |
||
39 | } |
||
40 | ?> |
||
41 | <li class="<?php lsx_health_plan_nav_class( 'workout' ); ?>"><a class="workout-tab" href="<?php echo esc_attr( $plan_link ); ?><?php echo esc_attr( $workout ); ?>/"><?php lsx_get_svg_icon( 'work.svg' ); ?> <?php esc_html_e( 'Workout', 'lsx-health-plan' ); ?></a></li> |
||
42 | <?php |
||
43 | } |
||
44 | if ( lsx_health_plan_has_meal() ) { |
||
45 | $meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', false ); |
||
46 | if ( false === $meal ) { |
||
47 | $meal = 'meal'; |
||
48 | } |
||
49 | ?> |
||
50 | <li class="<?php lsx_health_plan_nav_class( 'meal' ); ?>"><a class="meal-plan-tab" href="<?php echo esc_attr( $plan_link ); ?><?php echo esc_attr( $meal ); ?>/"><?php lsx_get_svg_icon( 'meal.svg' ); ?> <?php esc_html_e( 'Meal Plan', 'lsx-health-plan' ); ?></a></li> |
||
51 | <?php |
||
52 | } |
||
53 | ?> |
||
54 | </ul> |
||
55 | </div> |
||
56 |