@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | * @return void |
12 | 12 | */ |
13 | 13 | function lsx_hp_plan_archive_filters() { |
14 | - if ( is_post_type_archive( 'plan' ) && function_exists( 'wc_get_page_id' ) && false === apply_filters( 'lsx_hp_disable_plan_archive_filters', false ) ) { |
|
15 | - ?> |
|
14 | + if ( is_post_type_archive( 'plan' ) && function_exists( 'wc_get_page_id' ) && false === apply_filters( 'lsx_hp_disable_plan_archive_filters', false ) ) { |
|
15 | + ?> |
|
16 | 16 | <div id="type-nav"> |
17 | 17 | <ul class="nav nav-pills lsx-type-nav-filter"> |
18 | 18 | <li class="active"><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter="*"><?php esc_html_e( 'All', 'lsx-health-plan' ); ?></a></li> |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | </ul> |
23 | 23 | </div> |
24 | 24 | <?php |
25 | - } |
|
25 | + } |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -31,27 +31,27 @@ discard block |
||
31 | 31 | * @return string |
32 | 32 | */ |
33 | 33 | function lsx_hp_plan_get_classes() { |
34 | - $classes = 'filter-free'; |
|
35 | - if ( \lsx_health_plan\functions\woocommerce\plan_has_products() ) { |
|
36 | - $products = \lsx_health_plan\functions\woocommerce\get_plan_products(); |
|
37 | - $linked_product = wc_get_product( $products[0] ); |
|
38 | - $price = $linked_product->get_price( 'raw' ); |
|
39 | - if ( empty( $price ) ) { |
|
40 | - $classes = 'filter-free'; |
|
41 | - } else { |
|
42 | - $classes = 'filter-paid'; |
|
43 | - } |
|
34 | + $classes = 'filter-free'; |
|
35 | + if ( \lsx_health_plan\functions\woocommerce\plan_has_products() ) { |
|
36 | + $products = \lsx_health_plan\functions\woocommerce\get_plan_products(); |
|
37 | + $linked_product = wc_get_product( $products[0] ); |
|
38 | + $price = $linked_product->get_price( 'raw' ); |
|
39 | + if ( empty( $price ) ) { |
|
40 | + $classes = 'filter-free'; |
|
41 | + } else { |
|
42 | + $classes = 'filter-paid'; |
|
43 | + } |
|
44 | 44 | |
45 | - $featured = get_post_meta( get_the_ID(), 'plan_featured_plan', true ); |
|
46 | - if ( false !== $featured && '' !== $featured ) { |
|
47 | - $classes .= ' filter-featured'; |
|
48 | - } |
|
49 | - } |
|
50 | - return $classes; |
|
45 | + $featured = get_post_meta( get_the_ID(), 'plan_featured_plan', true ); |
|
46 | + if ( false !== $featured && '' !== $featured ) { |
|
47 | + $classes .= ' filter-featured'; |
|
48 | + } |
|
49 | + } |
|
50 | + return $classes; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | function lsx_health_plan_back_to_plan_button() { |
54 | - ?> |
|
54 | + ?> |
|
55 | 55 | <div class="back-plan-btn"> |
56 | 56 | <a class="btn" href="<?php the_permalink(); ?>"><?php esc_html_e( 'Back To Plan', 'lsx-health-plan' ); ?></a> |
57 | 57 | </div> |
@@ -11,14 +11,14 @@ discard block |
||
11 | 11 | * @return void |
12 | 12 | */ |
13 | 13 | function lsx_hp_plan_archive_filters() { |
14 | - if ( is_post_type_archive( 'plan' ) && function_exists( 'wc_get_page_id' ) && false === apply_filters( 'lsx_hp_disable_plan_archive_filters', false ) ) { |
|
14 | + if (is_post_type_archive('plan') && function_exists('wc_get_page_id') && false === apply_filters('lsx_hp_disable_plan_archive_filters', false)) { |
|
15 | 15 | ?> |
16 | 16 | <div id="type-nav"> |
17 | 17 | <ul class="nav nav-pills lsx-type-nav-filter"> |
18 | - <li class="active"><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter="*"><?php esc_html_e( 'All', 'lsx-health-plan' ); ?></a></li> |
|
19 | - <li><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter=".filter-free"><?php esc_html_e( 'Free', 'lsx-health-plan' ); ?></a></li> |
|
20 | - <li><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter=".filter-paid"><?php esc_html_e( 'Paid', 'lsx-health-plan' ); ?></a></li> |
|
21 | - <li><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter=".filter-featured"><?php esc_html_e( 'Featured', 'lsx-health-plan' ); ?></a></li> |
|
18 | + <li class="active"><a href="<?php echo empty($group_selected) ? '#' : esc_url(get_post_type_archive_link('plan')); ?>" data-filter="*"><?php esc_html_e('All', 'lsx-health-plan'); ?></a></li> |
|
19 | + <li><a href="<?php echo empty($group_selected) ? '#' : esc_url(get_post_type_archive_link('plan')); ?>" data-filter=".filter-free"><?php esc_html_e('Free', 'lsx-health-plan'); ?></a></li> |
|
20 | + <li><a href="<?php echo empty($group_selected) ? '#' : esc_url(get_post_type_archive_link('plan')); ?>" data-filter=".filter-paid"><?php esc_html_e('Paid', 'lsx-health-plan'); ?></a></li> |
|
21 | + <li><a href="<?php echo empty($group_selected) ? '#' : esc_url(get_post_type_archive_link('plan')); ?>" data-filter=".filter-featured"><?php esc_html_e('Featured', 'lsx-health-plan'); ?></a></li> |
|
22 | 22 | </ul> |
23 | 23 | </div> |
24 | 24 | <?php |
@@ -32,18 +32,18 @@ discard block |
||
32 | 32 | */ |
33 | 33 | function lsx_hp_plan_get_classes() { |
34 | 34 | $classes = 'filter-free'; |
35 | - if ( \lsx_health_plan\functions\woocommerce\plan_has_products() ) { |
|
35 | + if (\lsx_health_plan\functions\woocommerce\plan_has_products()) { |
|
36 | 36 | $products = \lsx_health_plan\functions\woocommerce\get_plan_products(); |
37 | - $linked_product = wc_get_product( $products[0] ); |
|
38 | - $price = $linked_product->get_price( 'raw' ); |
|
39 | - if ( empty( $price ) ) { |
|
37 | + $linked_product = wc_get_product($products[0]); |
|
38 | + $price = $linked_product->get_price('raw'); |
|
39 | + if (empty($price)) { |
|
40 | 40 | $classes = 'filter-free'; |
41 | 41 | } else { |
42 | 42 | $classes = 'filter-paid'; |
43 | 43 | } |
44 | 44 | |
45 | - $featured = get_post_meta( get_the_ID(), 'plan_featured_plan', true ); |
|
46 | - if ( false !== $featured && '' !== $featured ) { |
|
45 | + $featured = get_post_meta(get_the_ID(), 'plan_featured_plan', true); |
|
46 | + if (false !== $featured && '' !== $featured) { |
|
47 | 47 | $classes .= ' filter-featured'; |
48 | 48 | } |
49 | 49 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | function lsx_health_plan_back_to_plan_button() { |
54 | 54 | ?> |
55 | 55 | <div class="back-plan-btn"> |
56 | - <a class="btn" href="<?php the_permalink(); ?>"><?php esc_html_e( 'Back To Plan', 'lsx-health-plan' ); ?></a> |
|
56 | + <a class="btn" href="<?php the_permalink(); ?>"><?php esc_html_e('Back To Plan', 'lsx-health-plan'); ?></a> |
|
57 | 57 | </div> |
58 | 58 | <?php |
59 | 59 | } |