@@ -16,40 +16,40 @@ discard block |
||
16 | 16 | $image_size = $args['image_size']; |
17 | 17 | |
18 | 18 | $query_array = array( |
19 | - 'orderby' => $args['orderby'], |
|
20 | - 'order' => $args['order'], |
|
21 | - 'post_type' => $args['post_type'], |
|
22 | - 'posts_per_page' => $limit, |
|
19 | + 'orderby' => $args['orderby'], |
|
20 | + 'order' => $args['order'], |
|
21 | + 'post_type' => $args['post_type'], |
|
22 | + 'posts_per_page' => $limit, |
|
23 | 23 | ); |
24 | 24 | |
25 | 25 | // If we are calling the exercises with the parent workout. |
26 | 26 | if ( false !== 'parent' && 'exercise' === $args['post_type'] ) { |
27 | - $items = \lsx_health_plan\functions\get_exercises_by_workout( $args['parent'] ); |
|
28 | - if ( ! empty( $items ) ) { |
|
29 | - $args['include'] = $items; |
|
30 | - } |
|
27 | + $items = \lsx_health_plan\functions\get_exercises_by_workout( $args['parent'] ); |
|
28 | + if ( ! empty( $items ) ) { |
|
29 | + $args['include'] = $items; |
|
30 | + } |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | if ( isset( $args['include'] ) && ( '' !== $args['include'] ) ) { |
34 | - if ( is_array( $args['include'] ) ) { |
|
35 | - $include = $args['include']; |
|
36 | - } else { |
|
37 | - $include = explode( ',', $args['include'] ); |
|
38 | - } |
|
39 | - $include_filter = $include; |
|
40 | - $query_array['post__in'] = $include_filter; |
|
41 | - $query_array['orderby'] = 'post__in'; |
|
34 | + if ( is_array( $args['include'] ) ) { |
|
35 | + $include = $args['include']; |
|
36 | + } else { |
|
37 | + $include = explode( ',', $args['include'] ); |
|
38 | + } |
|
39 | + $include_filter = $include; |
|
40 | + $query_array['post__in'] = $include_filter; |
|
41 | + $query_array['orderby'] = 'post__in'; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | if ( isset( $taxonomy ) && ( '' !== $taxonomy ) && isset( $term ) && ( '' !== $term ) ) { |
45 | - $taxonomy_filter = array( |
|
46 | - array( |
|
47 | - 'taxonomy' => $taxonomy, |
|
48 | - 'field' => 'slug', |
|
49 | - 'terms' => $term, |
|
50 | - ), |
|
51 | - ); |
|
52 | - $query_array['tax_query'] = $taxonomy_filter; |
|
45 | + $taxonomy_filter = array( |
|
46 | + array( |
|
47 | + 'taxonomy' => $taxonomy, |
|
48 | + 'field' => 'slug', |
|
49 | + 'terms' => $term, |
|
50 | + ), |
|
51 | + ); |
|
52 | + $query_array['tax_query'] = $taxonomy_filter; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | $exercises = new WP_Query( $query_array ); |
@@ -58,46 +58,46 @@ discard block |
||
58 | 58 | <div id="lsx-exercises-shortcode" class="daily-plan-block layout-<?php echo esc_html( $args['layout'] ); ?> columns-<?php echo esc_html( $args['columns'] ); ?> shortcode-type-<?php echo esc_html( $args['post_type'] ); ?>"> |
59 | 59 | <div class="lsx-exercises-shortcode" > |
60 | 60 | <?php |
61 | - if ( $exercises->have_posts() ) { |
|
62 | - while ( $exercises->have_posts() ) { |
|
63 | - $exercises->the_post(); |
|
64 | - switch ( $args['post_type'] ) { |
|
65 | - case 'workout': |
|
66 | - include LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-sets.php'; |
|
67 | - break; |
|
61 | + if ( $exercises->have_posts() ) { |
|
62 | + while ( $exercises->have_posts() ) { |
|
63 | + $exercises->the_post(); |
|
64 | + switch ( $args['post_type'] ) { |
|
65 | + case 'workout': |
|
66 | + include LSX_HEALTH_PLAN_PATH . 'templates/partials/workout-sets.php'; |
|
67 | + break; |
|
68 | 68 | |
69 | - case 'meal': |
|
70 | - include LSX_HEALTH_PLAN_PATH . 'templates/partials/meal-plans.php'; |
|
71 | - break; |
|
69 | + case 'meal': |
|
70 | + include LSX_HEALTH_PLAN_PATH . 'templates/partials/meal-plans.php'; |
|
71 | + break; |
|
72 | 72 | |
73 | - /*case 'exercise': |
|
73 | + /*case 'exercise': |
|
74 | 74 | include LSX_HEALTH_PLAN_PATH . 'templates/partials/content-shortcode-exercise.php'; |
75 | 75 | break;*/ |
76 | 76 | |
77 | - case 'exercise': |
|
78 | - case 'recipe': |
|
79 | - case 'tip': |
|
80 | - include LSX_HEALTH_PLAN_PATH . 'templates/content-archive-' . $args['post_type'] . '.php'; |
|
81 | - break; |
|
77 | + case 'exercise': |
|
78 | + case 'recipe': |
|
79 | + case 'tip': |
|
80 | + include LSX_HEALTH_PLAN_PATH . 'templates/content-archive-' . $args['post_type'] . '.php'; |
|
81 | + break; |
|
82 | 82 | |
83 | - default: |
|
84 | - include LSX_HEALTH_PLAN_PATH . 'templates/partials/content-default.php'; |
|
85 | - break; |
|
86 | - } |
|
87 | - } |
|
88 | - } |
|
89 | - wp_reset_postdata(); |
|
90 | - ?> |
|
83 | + default: |
|
84 | + include LSX_HEALTH_PLAN_PATH . 'templates/partials/content-default.php'; |
|
85 | + break; |
|
86 | + } |
|
87 | + } |
|
88 | + } |
|
89 | + wp_reset_postdata(); |
|
90 | + ?> |
|
91 | 91 | </div> |
92 | 92 | <?php |
93 | - if ( isset( $args['view_more'] ) && false !== $args['view_more'] ) { |
|
94 | - ?> |
|
93 | + if ( isset( $args['view_more'] ) && false !== $args['view_more'] ) { |
|
94 | + ?> |
|
95 | 95 | <div class="col-md-12"> |
96 | 96 | <a class="<?php echo esc_html( $link_class ); ?>" href="<?php echo esc_url( get_post_type_archive_link( $args['post_type'] ) ); ?>"><?php echo esc_html_e( 'Show More', 'lsx-health-plan' ); ?></a> |
97 | 97 | </div> |
98 | 98 | <?php |
99 | - } |
|
100 | - ?> |
|
99 | + } |
|
100 | + ?> |
|
101 | 101 | </div> |
102 | 102 | <?php |
103 | 103 | $shortcode_args = null; |
@@ -20,63 +20,63 @@ discard block |
||
20 | 20 | <?php } ?> |
21 | 21 | <tbody> |
22 | 22 | <?php |
23 | - if ( 1 >= (int) $serves ) { |
|
24 | - $serves = '1'; |
|
25 | - $serves_label = __( 'Person', 'lsx-health-plan' ); |
|
26 | - } else { |
|
27 | - $serves_label = __( 'People', 'lsx-health-plan' ); |
|
28 | - } |
|
29 | - ?> |
|
23 | + if ( 1 >= (int) $serves ) { |
|
24 | + $serves = '1'; |
|
25 | + $serves_label = __( 'Person', 'lsx-health-plan' ); |
|
26 | + } else { |
|
27 | + $serves_label = __( 'People', 'lsx-health-plan' ); |
|
28 | + } |
|
29 | + ?> |
|
30 | 30 | <tr class="serves"> |
31 | 31 | <td><?php esc_html_e( 'Serves:', 'lsx-health-plan' ); ?> </td> |
32 | 32 | <td> |
33 | 33 | <?php |
34 | - echo wp_kses_post( $serves ) . ' ' . esc_html( $serves_label ); |
|
35 | - ?> |
|
34 | + echo wp_kses_post( $serves ) . ' ' . esc_html( $serves_label ); |
|
35 | + ?> |
|
36 | 36 | </td> |
37 | 37 | </tr> |
38 | 38 | <?php |
39 | - if ( ! empty( $prep_time ) ) { |
|
40 | - ?> |
|
39 | + if ( ! empty( $prep_time ) ) { |
|
40 | + ?> |
|
41 | 41 | <tr class="prep-time"> |
42 | 42 | <td><?php esc_html_e( 'Prep time: ', 'lsx-health-plan' ); ?> </td> |
43 | 43 | <td> |
44 | 44 | <?php |
45 | - echo wp_kses_post( $prep_time ); |
|
46 | - ?> |
|
45 | + echo wp_kses_post( $prep_time ); |
|
46 | + ?> |
|
47 | 47 | </td> |
48 | 48 | </tr> |
49 | 49 | <?php |
50 | - } |
|
51 | - ?> |
|
50 | + } |
|
51 | + ?> |
|
52 | 52 | <?php |
53 | - if ( ! empty( $cooking_time ) ) { |
|
54 | - ?> |
|
53 | + if ( ! empty( $cooking_time ) ) { |
|
54 | + ?> |
|
55 | 55 | <tr class="cooking-time"> |
56 | 56 | <td><?php esc_html_e( 'Cooking time: ', 'lsx-health-plan' ); ?> </td> |
57 | 57 | <td> |
58 | 58 | <?php |
59 | - echo wp_kses_post( $cooking_time ); |
|
60 | - ?> |
|
59 | + echo wp_kses_post( $cooking_time ); |
|
60 | + ?> |
|
61 | 61 | </td> |
62 | 62 | </tr> |
63 | 63 | <?php |
64 | - } |
|
65 | - ?> |
|
64 | + } |
|
65 | + ?> |
|
66 | 66 | <?php |
67 | - if ( ! empty( $portion ) ) { |
|
68 | - ?> |
|
67 | + if ( ! empty( $portion ) ) { |
|
68 | + ?> |
|
69 | 69 | <tr class="portion-size"> |
70 | 70 | <td><?php esc_html_e( 'Portion size: ', 'lsx-health-plan' ); ?> </td> |
71 | 71 | <td> |
72 | 72 | <?php |
73 | - echo wp_kses_post( $portion ); |
|
74 | - ?> |
|
73 | + echo wp_kses_post( $portion ); |
|
74 | + ?> |
|
75 | 75 | </td> |
76 | 76 | </tr> |
77 | 77 | <?php |
78 | - } |
|
79 | - ?> |
|
78 | + } |
|
79 | + ?> |
|
80 | 80 | </tbody> |
81 | 81 | </table> |
82 | 82 | <?php } ?> |
@@ -89,75 +89,75 @@ discard block |
||
89 | 89 | </thead> |
90 | 90 | <tbody> |
91 | 91 | <?php |
92 | - if ( ! empty( $energy ) ) { |
|
93 | - ?> |
|
92 | + if ( ! empty( $energy ) ) { |
|
93 | + ?> |
|
94 | 94 | <tr class="energy"> |
95 | 95 | <td><?php esc_html_e( 'Energy: ', 'lsx-health-plan' ); ?> </td> |
96 | 96 | <td> |
97 | 97 | <?php |
98 | - echo wp_kses_post( $energy ); |
|
99 | - ?> |
|
98 | + echo wp_kses_post( $energy ); |
|
99 | + ?> |
|
100 | 100 | </td> |
101 | 101 | </tr> |
102 | 102 | <?php |
103 | - } |
|
104 | - ?> |
|
103 | + } |
|
104 | + ?> |
|
105 | 105 | <?php |
106 | - if ( ! empty( $protein ) ) { |
|
107 | - ?> |
|
106 | + if ( ! empty( $protein ) ) { |
|
107 | + ?> |
|
108 | 108 | <tr class="protein"> |
109 | 109 | <td><?php esc_html_e( 'Protein: ', 'lsx-health-plan' ); ?> </td> |
110 | 110 | <td> |
111 | 111 | <?php |
112 | - echo wp_kses_post( $protein ); |
|
113 | - ?> |
|
112 | + echo wp_kses_post( $protein ); |
|
113 | + ?> |
|
114 | 114 | </td> |
115 | 115 | </tr> |
116 | 116 | <?php |
117 | - } |
|
118 | - ?> |
|
117 | + } |
|
118 | + ?> |
|
119 | 119 | <?php |
120 | - if ( ! empty( $carbohydrates ) ) { |
|
121 | - ?> |
|
120 | + if ( ! empty( $carbohydrates ) ) { |
|
121 | + ?> |
|
122 | 122 | <tr class="carbohydrates"> |
123 | 123 | <td><?php esc_html_e( 'Carbohydrates: ', 'lsx-health-plan' ); ?> </td> |
124 | 124 | <td> |
125 | 125 | <?php |
126 | - echo wp_kses_post( $carbohydrates ); |
|
127 | - ?> |
|
126 | + echo wp_kses_post( $carbohydrates ); |
|
127 | + ?> |
|
128 | 128 | </td> |
129 | 129 | </tr> |
130 | 130 | <?php |
131 | - } |
|
132 | - ?> |
|
131 | + } |
|
132 | + ?> |
|
133 | 133 | <?php |
134 | - if ( ! empty( $fibre ) ) { |
|
135 | - ?> |
|
134 | + if ( ! empty( $fibre ) ) { |
|
135 | + ?> |
|
136 | 136 | <tr class="fibre"> |
137 | 137 | <td><?php esc_html_e( 'Fibre: ', 'lsx-health-plan' ); ?> </td> |
138 | 138 | <td> |
139 | 139 | <?php |
140 | - echo wp_kses_post( $fibre ); |
|
141 | - ?> |
|
140 | + echo wp_kses_post( $fibre ); |
|
141 | + ?> |
|
142 | 142 | </td> |
143 | 143 | </tr> |
144 | 144 | <?php |
145 | - } |
|
146 | - ?> |
|
145 | + } |
|
146 | + ?> |
|
147 | 147 | <?php |
148 | - if ( ! empty( $fat ) ) { |
|
149 | - ?> |
|
148 | + if ( ! empty( $fat ) ) { |
|
149 | + ?> |
|
150 | 150 | <tr class="fat"> |
151 | 151 | <td><?php esc_html_e( 'Fat: ', 'lsx-health-plan' ); ?> </td> |
152 | 152 | <td> |
153 | 153 | <?php |
154 | - echo wp_kses_post( $fat ); |
|
155 | - ?> |
|
154 | + echo wp_kses_post( $fat ); |
|
155 | + ?> |
|
156 | 156 | </td> |
157 | 157 | </tr> |
158 | 158 | <?php |
159 | - } |
|
160 | - ?> |
|
159 | + } |
|
160 | + ?> |
|
161 | 161 | </tbody> |
162 | 162 | </table> |
163 | 163 | <?php } ?> |
@@ -8,10 +8,10 @@ discard block |
||
8 | 8 | $section_key = get_query_var( 'section' ); |
9 | 9 | $endpoint_key = get_query_var( 'endpoint' ); |
10 | 10 | if ( '' !== $section_key && '' === $endpoint && \lsx_health_plan\functions\plan\has_sections() ) { |
11 | - $section_info = \lsx_health_plan\functions\plan\get_section_info( $section_key ); |
|
12 | - if ( isset( $section_info['description'] ) && '' !== $section_info['description'] ) { |
|
13 | - global $shortcode_args; |
|
14 | - ?> |
|
11 | + $section_info = \lsx_health_plan\functions\plan\get_section_info( $section_key ); |
|
12 | + if ( isset( $section_info['description'] ) && '' !== $section_info['description'] ) { |
|
13 | + global $shortcode_args; |
|
14 | + ?> |
|
15 | 15 | <?php lsx_entry_before(); ?> |
16 | 16 | |
17 | 17 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
@@ -25,15 +25,15 @@ discard block |
||
25 | 25 | <div class="entry-content"> |
26 | 26 | <div class="overview"> |
27 | 27 | <?php |
28 | - echo wp_kses_post( apply_filters( 'the_content', $section_info['description'] ) ); |
|
29 | - |
|
30 | - wp_link_pages( array( |
|
31 | - 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
|
32 | - 'after' => '</div></div>', |
|
33 | - 'link_before' => '<span>', |
|
34 | - 'link_after' => '</span>', |
|
35 | - ) ); |
|
36 | - ?> |
|
28 | + echo wp_kses_post( apply_filters( 'the_content', $section_info['description'] ) ); |
|
29 | + |
|
30 | + wp_link_pages( array( |
|
31 | + 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
|
32 | + 'after' => '</div></div>', |
|
33 | + 'link_before' => '<span>', |
|
34 | + 'link_after' => '</span>', |
|
35 | + ) ); |
|
36 | + ?> |
|
37 | 37 | </div> |
38 | 38 | </div><!-- .entry-content --> |
39 | 39 | <?php if ( null === $shortcode_args ) { ?> |
@@ -51,6 +51,6 @@ discard block |
||
51 | 51 | </article><!-- #post-## --> |
52 | 52 | |
53 | 53 | <?php |
54 | - } |
|
54 | + } |
|
55 | 55 | } |
56 | 56 | ?> |
@@ -26,13 +26,13 @@ discard block |
||
26 | 26 | <div class="entry-content"> |
27 | 27 | <div class="single-plan-inner meal-content"> |
28 | 28 | <?php |
29 | - if ( is_singular( 'meal' ) ) { ?> |
|
29 | + if ( is_singular( 'meal' ) ) { ?> |
|
30 | 30 | <div class="single-plan-section-title meal-plan title-lined"> |
31 | 31 | <?php lsx_get_svg_icon( 'meal.svg' ); ?> |
32 | 32 | <h2><?php the_title(); ?></h2> |
33 | 33 | <?php if ( class_exists( 'LSX_Sharing' ) ) { |
34 | - lsx_content_sharing(); |
|
35 | - } ?> |
|
34 | + lsx_content_sharing(); |
|
35 | + } ?> |
|
36 | 36 | </div> |
37 | 37 | <?php } else { ?> |
38 | 38 | <div class="single-plan-section-title meal-plan title-lined"> |
@@ -55,18 +55,18 @@ discard block |
||
55 | 55 | <?php } ?> |
56 | 56 | |
57 | 57 | <?php |
58 | - // Shoping list |
|
59 | - $shopping_list = get_post_meta( get_the_ID(), 'meal_shopping_list', true ); |
|
60 | - if ( ! empty( $shopping_list ) ) { |
|
61 | - ?> |
|
58 | + // Shoping list |
|
59 | + $shopping_list = get_post_meta( get_the_ID(), 'meal_shopping_list', true ); |
|
60 | + if ( ! empty( $shopping_list ) ) { |
|
61 | + ?> |
|
62 | 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> |
63 | 63 | <?php |
64 | - } |
|
64 | + } |
|
65 | 65 | |
66 | - ?> |
|
66 | + ?> |
|
67 | 67 | </div> |
68 | 68 | |
69 | 69 | <?php |
70 | 70 | if ( ! empty( $connected_articles ) ) { |
71 | - lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) ); |
|
71 | + lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) ); |
|
72 | 72 | } |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | |
12 | 12 | <?php |
13 | 13 | $args = array( |
14 | - 'post_parent' => get_the_ID(), |
|
15 | - 'post_type' => 'plan', |
|
14 | + 'post_parent' => get_the_ID(), |
|
15 | + 'post_type' => 'plan', |
|
16 | 16 | ); |
17 | 17 | |
18 | 18 | $plan_id = get_the_ID(); |
@@ -28,18 +28,18 @@ discard block |
||
28 | 28 | $small_description = get_post_meta( get_the_ID(), ( $plan . '_short_description' ), true ); |
29 | 29 | |
30 | 30 | if ( ! empty( $has_sections ) && empty( $is_section ) ) { |
31 | - $plan_type_class = 'parent-plan'; |
|
31 | + $plan_type_class = 'parent-plan'; |
|
32 | 32 | } |
33 | 33 | if ( ! empty( $has_sections ) && ! empty( $is_section ) ) { |
34 | - $plan_type_class = 'child-plan'; |
|
34 | + $plan_type_class = 'child-plan'; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | // Get the plan restrictions. |
38 | 38 | if ( function_exists( 'wc_memberships_is_post_content_restricted' ) && wc_memberships_is_post_content_restricted( get_the_ID() ) ) { |
39 | - $restricted = ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() ); |
|
39 | + $restricted = ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() ); |
|
40 | 40 | } |
41 | 41 | if ( false === $restricted ) { |
42 | - $round_progress = round( \lsx_health_plan\functions\get_progress( get_the_ID() ), 0 ); |
|
42 | + $round_progress = round( \lsx_health_plan\functions\get_progress( get_the_ID() ), 0 ); |
|
43 | 43 | } |
44 | 44 | ?> |
45 | 45 | |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | <?php } ?> |
60 | 60 | |
61 | 61 | <?php |
62 | - if ( ! empty( $has_sections ) ) { |
|
63 | - if ( false === $is_section ) { |
|
64 | - ?> |
|
62 | + if ( ! empty( $has_sections ) ) { |
|
63 | + if ( false === $is_section ) { |
|
64 | + ?> |
|
65 | 65 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
66 | 66 | <div class="entry-content"> |
67 | 67 | <div class="single-plan-inner main-plan-content"> |
@@ -69,47 +69,47 @@ discard block |
||
69 | 69 | <?php lsx_get_svg_icon( 'my-plan.svg' ); ?> |
70 | 70 | <h2><?php echo esc_html_e( 'Your Plan', 'lsx-health-plan' ); ?></h2> |
71 | 71 | <?php if ( class_exists( 'LSX_Sharing' ) ) { |
72 | - lsx_content_sharing(); |
|
73 | - } ?> |
|
72 | + lsx_content_sharing(); |
|
73 | + } ?> |
|
74 | 74 | </div> |
75 | 75 | <div class="plan"> |
76 | 76 | <div class="set-box set content-box entry-content"> |
77 | 77 | <div class="plan-top-content"> |
78 | 78 | <?php |
79 | - if ( $connected_members ) { |
|
80 | - echo wp_kses_post( lsx_hp_member_connected( $connected_members, $plan ) ); |
|
81 | - } |
|
82 | - if ( false === $restricted ) { |
|
83 | - echo wp_kses_post( '<span class="progress"><progress class="bar" value="' . $round_progress . '" max="100"> ' . $round_progress . '% </progress><span>' . $round_progress . '%</span></span>' ); |
|
84 | - } |
|
85 | - if ( $small_description ) { |
|
86 | - ?> |
|
79 | + if ( $connected_members ) { |
|
80 | + echo wp_kses_post( lsx_hp_member_connected( $connected_members, $plan ) ); |
|
81 | + } |
|
82 | + if ( false === $restricted ) { |
|
83 | + echo wp_kses_post( '<span class="progress"><progress class="bar" value="' . $round_progress . '" max="100"> ' . $round_progress . '% </progress><span>' . $round_progress . '%</span></span>' ); |
|
84 | + } |
|
85 | + if ( $small_description ) { |
|
86 | + ?> |
|
87 | 87 | <div class="the-content"> |
88 | 88 | <span><?php echo esc_html( $small_description ); ?></span> |
89 | 89 | </div> |
90 | 90 | <?php |
91 | 91 | |
92 | - } |
|
93 | - ?> |
|
92 | + } |
|
93 | + ?> |
|
94 | 94 | </div> |
95 | 95 | <?php |
96 | - if ( lsx_health_plan_has_tips() ) { |
|
97 | - echo wp_kses_post( do_shortcode( '[lsx_health_plan_featured_tips_block]' ) ); |
|
98 | - } ?> |
|
96 | + if ( lsx_health_plan_has_tips() ) { |
|
97 | + echo wp_kses_post( do_shortcode( '[lsx_health_plan_featured_tips_block]' ) ); |
|
98 | + } ?> |
|
99 | 99 | </div> |
100 | 100 | <div class="the-plan-content"> |
101 | 101 | <?php |
102 | - echo do_shortcode( '[lsx_health_plan_day_plan_block week_view="true" show_downloads="true" plan="' . get_the_ID() . '"]' ); |
|
102 | + echo do_shortcode( '[lsx_health_plan_day_plan_block week_view="true" show_downloads="true" plan="' . get_the_ID() . '"]' ); |
|
103 | 103 | |
104 | - ?> |
|
104 | + ?> |
|
105 | 105 | <div class="row status-plan-buttons main-plan-btn"> |
106 | 106 | <?php |
107 | - if ( function_exists( 'wc_get_page_id' ) ) { |
|
108 | - ?> |
|
107 | + if ( function_exists( 'wc_get_page_id' ) ) { |
|
108 | + ?> |
|
109 | 109 | <a class="btn border-btn" href="<?php echo wp_kses_post( get_permalink( wc_get_page_id( 'myaccount' ) ) ); ?>"><?php esc_html_e( 'My Plans', 'lsx-health-plan' ); ?></a> |
110 | 110 | <?php |
111 | - } |
|
112 | - ?> |
|
111 | + } |
|
112 | + ?> |
|
113 | 113 | </div> |
114 | 114 | </div> |
115 | 115 | </div> |
@@ -118,32 +118,32 @@ discard block |
||
118 | 118 | </div><!-- .entry-content --> |
119 | 119 | </article> |
120 | 120 | <?php |
121 | - } else { |
|
122 | - lsx_health_plan_single_nav(); |
|
123 | - lsx_health_plan_single_tabs(); |
|
124 | - } |
|
125 | - } |
|
126 | - ?> |
|
121 | + } else { |
|
122 | + lsx_health_plan_single_nav(); |
|
123 | + lsx_health_plan_single_tabs(); |
|
124 | + } |
|
125 | + } |
|
126 | + ?> |
|
127 | 127 | </div> |
128 | 128 | |
129 | 129 | <?php |
130 | - // Show the buttons on the single plan tabs. |
|
131 | - if ( ! empty( $has_sections ) && false !== $is_section ) { |
|
132 | - ?> |
|
130 | + // Show the buttons on the single plan tabs. |
|
131 | + if ( ! empty( $has_sections ) && false !== $is_section ) { |
|
132 | + ?> |
|
133 | 133 | <div class="row status-plan-buttons"> |
134 | 134 | <?php lsx_health_plan_day_button(); ?> |
135 | 135 | </div> |
136 | 136 | <?php |
137 | - } |
|
138 | - ?> |
|
137 | + } |
|
138 | + ?> |
|
139 | 139 | |
140 | 140 | <?php lsx_content_bottom(); ?> |
141 | 141 | |
142 | 142 | <?php |
143 | - if ( ! empty( $connected_articles ) ) { |
|
144 | - lsx_hp_single_related( $connected_articles, __( 'Latest articles', 'lsx-health-plan' ) ); |
|
145 | - } |
|
146 | - ?> |
|
143 | + if ( ! empty( $connected_articles ) ) { |
|
144 | + lsx_hp_single_related( $connected_articles, __( 'Latest articles', 'lsx-health-plan' ) ); |
|
145 | + } |
|
146 | + ?> |
|
147 | 147 | |
148 | 148 | |
149 | 149 | </main><!-- #main --> |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | $column_class = '4'; |
14 | 14 | // Check for shortcode overrides. |
15 | 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 | - } |
|
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 | 20 | } |
21 | 21 | ?> |
22 | 22 | |
@@ -29,17 +29,17 @@ discard block |
||
29 | 29 | <div class="recipe-feature-img"> |
30 | 30 | <a href="<?php echo esc_url( get_permalink() ); ?>"> |
31 | 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 | - ?> |
|
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 | 39 | <img loading="lazy" class="placeholder" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>"> |
40 | 40 | <?php |
41 | - } |
|
42 | - ?> |
|
41 | + } |
|
42 | + ?> |
|
43 | 43 | </a> |
44 | 44 | </div> |
45 | 45 | <div class="content-box white-bg"> |
@@ -8,148 +8,148 @@ |
||
8 | 8 | */ |
9 | 9 | class LSX_Team { |
10 | 10 | |
11 | - /** |
|
12 | - * Holds class instance |
|
13 | - * |
|
14 | - * @var object \lsx_health_plan\classes\LSX_Team() |
|
15 | - */ |
|
16 | - protected static $instance = null; |
|
11 | + /** |
|
12 | + * Holds class instance |
|
13 | + * |
|
14 | + * @var object \lsx_health_plan\classes\LSX_Team() |
|
15 | + */ |
|
16 | + protected static $instance = null; |
|
17 | 17 | |
18 | - /** |
|
19 | - * Constructor. |
|
20 | - */ |
|
21 | - public function __construct() { |
|
22 | - $this->default_types = array( |
|
23 | - \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' ), |
|
24 | - \lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ), |
|
25 | - \lsx_health_plan\functions\get_option( 'endpoint_recipe_single', 'recipe' ), |
|
26 | - \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ), |
|
27 | - \lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' ), |
|
28 | - ); |
|
29 | - add_action( 'wp_enqueue_scripts', array( $this, 'assets' ), 5 ); |
|
30 | - add_action( 'cmb2_admin_init', array( $this, 'related_team_metabox' ) ); |
|
31 | - add_action( 'cmb2_admin_init', array( $this, 'additional_single_team_metabox' ) ); |
|
32 | - add_action( 'lsx_entry_bottom', array( $this, 'hp_team_member_tabs' ) ); |
|
33 | - add_action( 'wp_head', array( $this, 'remove_archive_original_team_header' ), 99 ); |
|
34 | - } |
|
18 | + /** |
|
19 | + * Constructor. |
|
20 | + */ |
|
21 | + public function __construct() { |
|
22 | + $this->default_types = array( |
|
23 | + \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' ), |
|
24 | + \lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ), |
|
25 | + \lsx_health_plan\functions\get_option( 'endpoint_recipe_single', 'recipe' ), |
|
26 | + \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ), |
|
27 | + \lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' ), |
|
28 | + ); |
|
29 | + add_action( 'wp_enqueue_scripts', array( $this, 'assets' ), 5 ); |
|
30 | + add_action( 'cmb2_admin_init', array( $this, 'related_team_metabox' ) ); |
|
31 | + add_action( 'cmb2_admin_init', array( $this, 'additional_single_team_metabox' ) ); |
|
32 | + add_action( 'lsx_entry_bottom', array( $this, 'hp_team_member_tabs' ) ); |
|
33 | + add_action( 'wp_head', array( $this, 'remove_archive_original_team_header' ), 99 ); |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * Return an instance of this class. |
|
38 | - * |
|
39 | - * @since 1.0.0 |
|
40 | - * |
|
41 | - * @return object \lsx_health_plan\classes\LSX_Team() A single instance of this class. |
|
42 | - */ |
|
43 | - public static function get_instance() { |
|
44 | - // If the single instance hasn't been set, set it now. |
|
45 | - if ( null === self::$instance ) { |
|
46 | - self::$instance = new self(); |
|
47 | - } |
|
48 | - return self::$instance; |
|
49 | - } |
|
36 | + /** |
|
37 | + * Return an instance of this class. |
|
38 | + * |
|
39 | + * @since 1.0.0 |
|
40 | + * |
|
41 | + * @return object \lsx_health_plan\classes\LSX_Team() A single instance of this class. |
|
42 | + */ |
|
43 | + public static function get_instance() { |
|
44 | + // If the single instance hasn't been set, set it now. |
|
45 | + if ( null === self::$instance ) { |
|
46 | + self::$instance = new self(); |
|
47 | + } |
|
48 | + return self::$instance; |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * Load lsx team related css. |
|
53 | - * |
|
54 | - * @package lsx |
|
55 | - * @subpackage lsx-health-plan |
|
56 | - * |
|
57 | - */ |
|
58 | - public function assets() { |
|
59 | - wp_enqueue_style( 'lsx-health-plan-team', LSX_HEALTH_PLAN_URL . 'assets/css/lsx-health-plan-team.css', array(), LSX_HEALTH_PLAN_VER ); |
|
60 | - } |
|
51 | + /** |
|
52 | + * Load lsx team related css. |
|
53 | + * |
|
54 | + * @package lsx |
|
55 | + * @subpackage lsx-health-plan |
|
56 | + * |
|
57 | + */ |
|
58 | + public function assets() { |
|
59 | + wp_enqueue_style( 'lsx-health-plan-team', LSX_HEALTH_PLAN_URL . 'assets/css/lsx-health-plan-team.css', array(), LSX_HEALTH_PLAN_VER ); |
|
60 | + } |
|
61 | 61 | |
62 | - /** |
|
63 | - * Define the related team member metabox and field configurations. |
|
64 | - */ |
|
65 | - public function related_team_metabox() { |
|
66 | - foreach ( $this->default_types as $type => $default_type ) { |
|
67 | - $cmb = new_cmb2_box( |
|
68 | - array( |
|
69 | - 'id' => $default_type . '_related_team_member__metabox', |
|
70 | - 'title' => __( 'Related Team Member', 'lsx-health-plan' ), |
|
71 | - 'object_types' => array( $default_type ), // Post type. |
|
72 | - 'context' => 'normal', |
|
73 | - 'priority' => 'low', |
|
74 | - 'show_names' => true, |
|
75 | - ) |
|
76 | - ); |
|
62 | + /** |
|
63 | + * Define the related team member metabox and field configurations. |
|
64 | + */ |
|
65 | + public function related_team_metabox() { |
|
66 | + foreach ( $this->default_types as $type => $default_type ) { |
|
67 | + $cmb = new_cmb2_box( |
|
68 | + array( |
|
69 | + 'id' => $default_type . '_related_team_member__metabox', |
|
70 | + 'title' => __( 'Related Team Member', 'lsx-health-plan' ), |
|
71 | + 'object_types' => array( $default_type ), // Post type. |
|
72 | + 'context' => 'normal', |
|
73 | + 'priority' => 'low', |
|
74 | + 'show_names' => true, |
|
75 | + ) |
|
76 | + ); |
|
77 | 77 | |
78 | - $cmb->add_field( |
|
79 | - array( |
|
80 | - 'name' => __( 'Related Team Member', 'lsx-health-plan' ), |
|
81 | - 'desc' => __( 'Connect the related team member that applies to this ', 'lsx-health-plan' ) . $default_type, |
|
82 | - 'id' => $default_type . '_connected_team_member', |
|
83 | - 'type' => 'post_search_ajax', |
|
84 | - 'limit' => 4, // Limit selection to X items only (default 1). |
|
85 | - 'sortable' => true, // Allow selected items to be sortable (default false). |
|
86 | - 'query_args' => array( |
|
87 | - 'post_type' => array( 'team' ), |
|
88 | - 'post_status' => array( 'publish' ), |
|
89 | - 'posts_per_page' => -1, |
|
90 | - ), |
|
91 | - ) |
|
92 | - ); |
|
93 | - } |
|
78 | + $cmb->add_field( |
|
79 | + array( |
|
80 | + 'name' => __( 'Related Team Member', 'lsx-health-plan' ), |
|
81 | + 'desc' => __( 'Connect the related team member that applies to this ', 'lsx-health-plan' ) . $default_type, |
|
82 | + 'id' => $default_type . '_connected_team_member', |
|
83 | + 'type' => 'post_search_ajax', |
|
84 | + 'limit' => 4, // Limit selection to X items only (default 1). |
|
85 | + 'sortable' => true, // Allow selected items to be sortable (default false). |
|
86 | + 'query_args' => array( |
|
87 | + 'post_type' => array( 'team' ), |
|
88 | + 'post_status' => array( 'publish' ), |
|
89 | + 'posts_per_page' => -1, |
|
90 | + ), |
|
91 | + ) |
|
92 | + ); |
|
93 | + } |
|
94 | 94 | |
95 | - } |
|
95 | + } |
|
96 | 96 | |
97 | - /** |
|
98 | - * Adding additional custom fields to the single members, related with Health Plan. |
|
99 | - */ |
|
100 | - public function additional_single_team_metabox() { |
|
101 | - $cmb = new_cmb2_box( |
|
102 | - array( |
|
103 | - 'id' => 'lsx__team', |
|
104 | - 'title' => '', |
|
105 | - 'object_types' => array( 'team' ), // Post type. |
|
106 | - 'context' => 'normal', |
|
107 | - 'priority' => 'high', |
|
108 | - 'show_names' => true, |
|
109 | - ) |
|
110 | - ); |
|
97 | + /** |
|
98 | + * Adding additional custom fields to the single members, related with Health Plan. |
|
99 | + */ |
|
100 | + public function additional_single_team_metabox() { |
|
101 | + $cmb = new_cmb2_box( |
|
102 | + array( |
|
103 | + 'id' => 'lsx__team', |
|
104 | + 'title' => '', |
|
105 | + 'object_types' => array( 'team' ), // Post type. |
|
106 | + 'context' => 'normal', |
|
107 | + 'priority' => 'high', |
|
108 | + 'show_names' => true, |
|
109 | + ) |
|
110 | + ); |
|
111 | 111 | |
112 | - $cmb->add_field( |
|
113 | - array( |
|
114 | - 'name' => __( 'Team Member Experience', 'lsx-health-plan' ), |
|
115 | - 'desc' => __( 'Add additional experience to this team member', 'lsx-health-plan' ), |
|
116 | - 'id' => 'team_member_experience', |
|
117 | - 'type' => 'wysiwyg', |
|
118 | - ) |
|
119 | - ); |
|
112 | + $cmb->add_field( |
|
113 | + array( |
|
114 | + 'name' => __( 'Team Member Experience', 'lsx-health-plan' ), |
|
115 | + 'desc' => __( 'Add additional experience to this team member', 'lsx-health-plan' ), |
|
116 | + 'id' => 'team_member_experience', |
|
117 | + 'type' => 'wysiwyg', |
|
118 | + ) |
|
119 | + ); |
|
120 | 120 | |
121 | - $cmb->add_field( |
|
122 | - array( |
|
123 | - 'name' => __( 'Featured Plans', 'lsx-health-plan' ), |
|
124 | - 'desc' => __( 'Connect the related plans to this team member', 'lsx-health-plan' ), |
|
125 | - 'id' => 'connected_team_member_plan', |
|
126 | - 'type' => 'post_search_ajax', |
|
127 | - 'limit' => 3, |
|
128 | - 'sortable' => true, |
|
129 | - 'query_args' => array( |
|
130 | - 'post_type' => array( 'plan' ), |
|
131 | - 'post_status' => array( 'publish' ), |
|
132 | - 'posts_per_page' => -1, |
|
133 | - ), |
|
134 | - ) |
|
135 | - ); |
|
121 | + $cmb->add_field( |
|
122 | + array( |
|
123 | + 'name' => __( 'Featured Plans', 'lsx-health-plan' ), |
|
124 | + 'desc' => __( 'Connect the related plans to this team member', 'lsx-health-plan' ), |
|
125 | + 'id' => 'connected_team_member_plan', |
|
126 | + 'type' => 'post_search_ajax', |
|
127 | + 'limit' => 3, |
|
128 | + 'sortable' => true, |
|
129 | + 'query_args' => array( |
|
130 | + 'post_type' => array( 'plan' ), |
|
131 | + 'post_status' => array( 'publish' ), |
|
132 | + 'posts_per_page' => -1, |
|
133 | + ), |
|
134 | + ) |
|
135 | + ); |
|
136 | 136 | |
137 | - } |
|
137 | + } |
|
138 | 138 | |
139 | - /** |
|
140 | - * Adds custom tabs to the team member single pages. |
|
141 | - * |
|
142 | - * @return void |
|
143 | - */ |
|
144 | - public function hp_team_member_tabs() { |
|
145 | - if ( is_single() && is_singular( 'team' ) ) { |
|
146 | - require_once LSX_HEALTH_PLAN_PATH . '/includes/template-tags/team.php'; |
|
147 | - } |
|
148 | - } |
|
139 | + /** |
|
140 | + * Adds custom tabs to the team member single pages. |
|
141 | + * |
|
142 | + * @return void |
|
143 | + */ |
|
144 | + public function hp_team_member_tabs() { |
|
145 | + if ( is_single() && is_singular( 'team' ) ) { |
|
146 | + require_once LSX_HEALTH_PLAN_PATH . '/includes/template-tags/team.php'; |
|
147 | + } |
|
148 | + } |
|
149 | 149 | |
150 | - public function remove_archive_original_team_header() { |
|
151 | - if ( is_single() && is_singular( 'team' ) ) { |
|
152 | - remove_action( 'lsx_content_wrap_before', 'lsx_global_header' ); |
|
153 | - } |
|
154 | - } |
|
150 | + public function remove_archive_original_team_header() { |
|
151 | + if ( is_single() && is_singular( 'team' ) ) { |
|
152 | + remove_action( 'lsx_content_wrap_before', 'lsx_global_header' ); |
|
153 | + } |
|
154 | + } |
|
155 | 155 | } |
@@ -12,128 +12,128 @@ |
||
12 | 12 | */ |
13 | 13 | class Recipe { |
14 | 14 | |
15 | - /** |
|
16 | - * Holds class instance |
|
17 | - * |
|
18 | - * @since 1.0.0 |
|
19 | - * |
|
20 | - * @var object \lsx_health_plan\classes\admin\Recipe() |
|
21 | - */ |
|
22 | - protected static $instance = null; |
|
15 | + /** |
|
16 | + * Holds class instance |
|
17 | + * |
|
18 | + * @since 1.0.0 |
|
19 | + * |
|
20 | + * @var object \lsx_health_plan\classes\admin\Recipe() |
|
21 | + */ |
|
22 | + protected static $instance = null; |
|
23 | 23 | |
24 | - /** |
|
25 | - * Constructor |
|
26 | - */ |
|
27 | - public function __construct() { |
|
28 | - add_action( 'lsx_hp_settings_page_recipe_top', array( $this, 'settings' ), 1, 1 ); |
|
29 | - } |
|
24 | + /** |
|
25 | + * Constructor |
|
26 | + */ |
|
27 | + public function __construct() { |
|
28 | + add_action( 'lsx_hp_settings_page_recipe_top', array( $this, 'settings' ), 1, 1 ); |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * Return an instance of this class. |
|
33 | - * |
|
34 | - * @since 1.0.0 |
|
35 | - * |
|
36 | - * @return object \lsx_health_plan\classes\admin\Recipe() A single instance of this class. |
|
37 | - */ |
|
38 | - public static function get_instance() { |
|
39 | - // If the single instance hasn't been set, set it now. |
|
40 | - if ( null === self::$instance ) { |
|
41 | - self::$instance = new self(); |
|
42 | - } |
|
43 | - return self::$instance; |
|
44 | - } |
|
31 | + /** |
|
32 | + * Return an instance of this class. |
|
33 | + * |
|
34 | + * @since 1.0.0 |
|
35 | + * |
|
36 | + * @return object \lsx_health_plan\classes\admin\Recipe() A single instance of this class. |
|
37 | + */ |
|
38 | + public static function get_instance() { |
|
39 | + // If the single instance hasn't been set, set it now. |
|
40 | + if ( null === self::$instance ) { |
|
41 | + self::$instance = new self(); |
|
42 | + } |
|
43 | + return self::$instance; |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * Registers the general settings. |
|
48 | - * |
|
49 | - * @param object $cmb new_cmb2_box(). |
|
50 | - * @return void |
|
51 | - */ |
|
52 | - public function settings( $cmb ) { |
|
53 | - $cmb->add_field( |
|
54 | - array( |
|
55 | - 'name' => __( 'Disable Recipes', 'lsx-health-plan' ), |
|
56 | - 'id' => 'recipe_disabled', |
|
57 | - 'type' => 'checkbox', |
|
58 | - 'value' => 1, |
|
59 | - 'default' => 0, |
|
60 | - 'description' => __( 'Disable recipe post type if you are wanting a minimal site.', 'lsx-health-plan' ), |
|
61 | - ) |
|
62 | - ); |
|
46 | + /** |
|
47 | + * Registers the general settings. |
|
48 | + * |
|
49 | + * @param object $cmb new_cmb2_box(). |
|
50 | + * @return void |
|
51 | + */ |
|
52 | + public function settings( $cmb ) { |
|
53 | + $cmb->add_field( |
|
54 | + array( |
|
55 | + 'name' => __( 'Disable Recipes', 'lsx-health-plan' ), |
|
56 | + 'id' => 'recipe_disabled', |
|
57 | + 'type' => 'checkbox', |
|
58 | + 'value' => 1, |
|
59 | + 'default' => 0, |
|
60 | + 'description' => __( 'Disable recipe post type if you are wanting a minimal site.', 'lsx-health-plan' ), |
|
61 | + ) |
|
62 | + ); |
|
63 | 63 | |
64 | - $cmb->add_field( |
|
65 | - array( |
|
66 | - 'id' => 'recipe_archive_description', |
|
67 | - 'type' => 'wysiwyg', |
|
68 | - 'name' => __( 'Archive Description', 'lsx-health-plan' ), |
|
69 | - 'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ), |
|
70 | - 'options' => array( |
|
71 | - 'textarea_rows' => get_option('default_post_edit_rows', 6), |
|
72 | - ), |
|
73 | - ) |
|
74 | - ); |
|
64 | + $cmb->add_field( |
|
65 | + array( |
|
66 | + 'id' => 'recipe_archive_description', |
|
67 | + 'type' => 'wysiwyg', |
|
68 | + 'name' => __( 'Archive Description', 'lsx-health-plan' ), |
|
69 | + 'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ), |
|
70 | + 'options' => array( |
|
71 | + 'textarea_rows' => get_option('default_post_edit_rows', 6), |
|
72 | + ), |
|
73 | + ) |
|
74 | + ); |
|
75 | 75 | |
76 | - $cmb->add_field( |
|
77 | - array( |
|
78 | - 'name' => __( 'Recipes Intro', 'lsx-health-plan' ), |
|
79 | - 'id' => 'recipes_intro', |
|
80 | - 'type' => 'textarea_small', |
|
81 | - 'value' => '', |
|
82 | - 'default' => __( "Let's get cooking! Delicious and easy to follow recipes.", 'lsx-health-plan' ), |
|
83 | - ) |
|
84 | - ); |
|
76 | + $cmb->add_field( |
|
77 | + array( |
|
78 | + 'name' => __( 'Recipes Intro', 'lsx-health-plan' ), |
|
79 | + 'id' => 'recipes_intro', |
|
80 | + 'type' => 'textarea_small', |
|
81 | + 'value' => '', |
|
82 | + 'default' => __( "Let's get cooking! Delicious and easy to follow recipes.", 'lsx-health-plan' ), |
|
83 | + ) |
|
84 | + ); |
|
85 | 85 | |
86 | - $cmb->add_field( |
|
87 | - array( |
|
88 | - 'before_row' => '<h4><b><u>URL Slug Options</u></b></h4><p style="font-style: italic;">If you need to translate the custom slug for this custom post type, do so below.</p>', |
|
89 | - 'name' => __( 'Recipes Slug', 'lsx-health-plan' ), |
|
90 | - 'id' => 'endpoint_recipe', |
|
91 | - 'type' => 'input', |
|
92 | - 'value' => '', |
|
93 | - 'default' => 'recipe', |
|
94 | - ) |
|
95 | - ); |
|
86 | + $cmb->add_field( |
|
87 | + array( |
|
88 | + 'before_row' => '<h4><b><u>URL Slug Options</u></b></h4><p style="font-style: italic;">If you need to translate the custom slug for this custom post type, do so below.</p>', |
|
89 | + 'name' => __( 'Recipes Slug', 'lsx-health-plan' ), |
|
90 | + 'id' => 'endpoint_recipe', |
|
91 | + 'type' => 'input', |
|
92 | + 'value' => '', |
|
93 | + 'default' => 'recipe', |
|
94 | + ) |
|
95 | + ); |
|
96 | 96 | |
97 | - $cmb->add_field( |
|
98 | - array( |
|
99 | - 'before_row' => '<h4><b><u>Default Options</u></b></h4>', |
|
100 | - 'name' => __( 'Recipe', 'lsx-health-plan' ), |
|
101 | - 'description' => __( 'Set a default recipe.', 'lsx-health-plan' ), |
|
102 | - 'limit' => 1, |
|
103 | - 'id' => 'connected_recipes', |
|
104 | - 'type' => 'post_search_ajax', |
|
105 | - 'query_args' => array( |
|
106 | - 'post_type' => 'recipe', |
|
107 | - 'post_status' => array( 'publish' ), |
|
108 | - 'posts_per_page' => -1, |
|
109 | - ), |
|
110 | - ) |
|
111 | - ); |
|
112 | - if ( function_exists( 'download_monitor' ) ) { |
|
113 | - $page_url = 'https://wordpress.org/plugins/download-monitor/'; |
|
114 | - $plugin_name = 'Download Monitor'; |
|
115 | - $description = sprintf( |
|
116 | - /* translators: %s: The subscription info */ |
|
117 | - __( 'If you are using <a target="_blank" href="%1$s">%2$s</a> you can set a default download file for your recipe here.', 'lsx-search' ), |
|
118 | - $page_url, |
|
119 | - $plugin_name |
|
120 | - ); |
|
121 | - $cmb->add_field( |
|
122 | - array( |
|
123 | - 'name' => __( 'Default Recipe PDF', 'lsx-health-plan' ), |
|
124 | - 'description' => $description, |
|
125 | - 'id' => 'download_recipe', |
|
126 | - 'type' => 'post_search_ajax', |
|
127 | - 'limit' => 1, |
|
128 | - 'query_args' => array( |
|
129 | - 'post_type' => array( 'dlm_download' ), |
|
130 | - 'post_status' => array( 'publish' ), |
|
131 | - 'posts_per_page' => -1, |
|
132 | - ), |
|
133 | - 'after_row' => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ), |
|
134 | - ) |
|
135 | - ); |
|
136 | - } |
|
137 | - } |
|
97 | + $cmb->add_field( |
|
98 | + array( |
|
99 | + 'before_row' => '<h4><b><u>Default Options</u></b></h4>', |
|
100 | + 'name' => __( 'Recipe', 'lsx-health-plan' ), |
|
101 | + 'description' => __( 'Set a default recipe.', 'lsx-health-plan' ), |
|
102 | + 'limit' => 1, |
|
103 | + 'id' => 'connected_recipes', |
|
104 | + 'type' => 'post_search_ajax', |
|
105 | + 'query_args' => array( |
|
106 | + 'post_type' => 'recipe', |
|
107 | + 'post_status' => array( 'publish' ), |
|
108 | + 'posts_per_page' => -1, |
|
109 | + ), |
|
110 | + ) |
|
111 | + ); |
|
112 | + if ( function_exists( 'download_monitor' ) ) { |
|
113 | + $page_url = 'https://wordpress.org/plugins/download-monitor/'; |
|
114 | + $plugin_name = 'Download Monitor'; |
|
115 | + $description = sprintf( |
|
116 | + /* translators: %s: The subscription info */ |
|
117 | + __( 'If you are using <a target="_blank" href="%1$s">%2$s</a> you can set a default download file for your recipe here.', 'lsx-search' ), |
|
118 | + $page_url, |
|
119 | + $plugin_name |
|
120 | + ); |
|
121 | + $cmb->add_field( |
|
122 | + array( |
|
123 | + 'name' => __( 'Default Recipe PDF', 'lsx-health-plan' ), |
|
124 | + 'description' => $description, |
|
125 | + 'id' => 'download_recipe', |
|
126 | + 'type' => 'post_search_ajax', |
|
127 | + 'limit' => 1, |
|
128 | + 'query_args' => array( |
|
129 | + 'post_type' => array( 'dlm_download' ), |
|
130 | + 'post_status' => array( 'publish' ), |
|
131 | + 'posts_per_page' => -1, |
|
132 | + ), |
|
133 | + 'after_row' => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ), |
|
134 | + ) |
|
135 | + ); |
|
136 | + } |
|
137 | + } |
|
138 | 138 | } |
139 | 139 | Recipe::get_instance(); |
@@ -12,112 +12,112 @@ |
||
12 | 12 | */ |
13 | 13 | class Exercise { |
14 | 14 | |
15 | - /** |
|
16 | - * Holds class instance |
|
17 | - * |
|
18 | - * @since 1.0.0 |
|
19 | - * |
|
20 | - * @var object \lsx_health_plan\classes\admin\Exercise() |
|
21 | - */ |
|
22 | - protected static $instance = null; |
|
15 | + /** |
|
16 | + * Holds class instance |
|
17 | + * |
|
18 | + * @since 1.0.0 |
|
19 | + * |
|
20 | + * @var object \lsx_health_plan\classes\admin\Exercise() |
|
21 | + */ |
|
22 | + protected static $instance = null; |
|
23 | 23 | |
24 | - /** |
|
25 | - * Constructor |
|
26 | - */ |
|
27 | - public function __construct() { |
|
28 | - add_action( 'lsx_hp_settings_page_exercise_top', array( $this, 'settings' ), 1, 1 ); |
|
29 | - } |
|
24 | + /** |
|
25 | + * Constructor |
|
26 | + */ |
|
27 | + public function __construct() { |
|
28 | + add_action( 'lsx_hp_settings_page_exercise_top', array( $this, 'settings' ), 1, 1 ); |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * Return an instance of this class. |
|
33 | - * |
|
34 | - * @since 1.0.0 |
|
35 | - * |
|
36 | - * @return object \lsx_health_plan\classes\admin\Exercise() A single instance of this class. |
|
37 | - */ |
|
38 | - public static function get_instance() { |
|
39 | - // If the single instance hasn't been set, set it now. |
|
40 | - if ( null === self::$instance ) { |
|
41 | - self::$instance = new self(); |
|
42 | - } |
|
43 | - return self::$instance; |
|
44 | - } |
|
31 | + /** |
|
32 | + * Return an instance of this class. |
|
33 | + * |
|
34 | + * @since 1.0.0 |
|
35 | + * |
|
36 | + * @return object \lsx_health_plan\classes\admin\Exercise() A single instance of this class. |
|
37 | + */ |
|
38 | + public static function get_instance() { |
|
39 | + // If the single instance hasn't been set, set it now. |
|
40 | + if ( null === self::$instance ) { |
|
41 | + self::$instance = new self(); |
|
42 | + } |
|
43 | + return self::$instance; |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * Registers the general settings. |
|
48 | - * |
|
49 | - * @param object $cmb new_cmb2_box(). |
|
50 | - * @return void |
|
51 | - */ |
|
52 | - public function settings( $cmb ) { |
|
53 | - $cmb->add_field( |
|
54 | - array( |
|
55 | - 'name' => __( 'Exercises', 'lsx-health-plan' ), |
|
56 | - 'id' => 'exercise_enabled', |
|
57 | - 'type' => 'checkbox', |
|
58 | - 'value' => 1, |
|
59 | - 'default' => 0, |
|
60 | - 'description' => __( 'Enabling the exercise post type will automatically replace the Video post type.', 'lsx-health-plan' ), |
|
61 | - ) |
|
62 | - ); |
|
63 | - $cmb->add_field( |
|
64 | - array( |
|
65 | - 'id' => 'exercise_archive_description', |
|
66 | - 'type' => 'wysiwyg', |
|
67 | - 'name' => __( 'Archive Description', 'lsx-health-plan' ), |
|
68 | - 'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ), |
|
69 | - 'options' => array( |
|
70 | - 'textarea_rows' => get_option('default_post_edit_rows', 6), |
|
71 | - ), |
|
72 | - ) |
|
73 | - ); |
|
74 | - $cmb->add_field( |
|
75 | - array( |
|
76 | - 'before_row' => '<h4><b><u>URL Slug Options</u></b></h4><p style="font-style: italic;">If you need to translate the custom slug for this custom post type, do so below.</p>', |
|
77 | - 'name' => __( 'Single Exercise Slug', 'lsx-health-plan' ), |
|
78 | - 'id' => 'endpoint_exercise_single', |
|
79 | - 'type' => 'input', |
|
80 | - 'value' => '', |
|
81 | - 'default' => 'exercise', |
|
82 | - ) |
|
83 | - ); |
|
84 | - $cmb->add_field( |
|
85 | - array( |
|
86 | - 'name' => __( 'Archive Exercise Slug', 'lsx-health-plan' ), |
|
87 | - 'id' => 'endpoint_exercise_archive', |
|
88 | - 'type' => 'input', |
|
89 | - 'value' => '', |
|
90 | - 'default' => 'exercises', |
|
91 | - ) |
|
92 | - ); |
|
93 | - $cmb->add_field( |
|
94 | - array( |
|
95 | - 'name' => __( 'Exercise Type Slug', 'lsx-health-plan' ), |
|
96 | - 'id' => 'endpoint_exercise_type', |
|
97 | - 'type' => 'input', |
|
98 | - 'value' => '', |
|
99 | - 'default' => 'exercise-type', |
|
100 | - ) |
|
101 | - ); |
|
102 | - $cmb->add_field( |
|
103 | - array( |
|
104 | - 'name' => __( 'Equipment Slug', 'lsx-health-plan' ), |
|
105 | - 'id' => 'endpoint_exercise_equipment', |
|
106 | - 'type' => 'input', |
|
107 | - 'value' => '', |
|
108 | - 'default' => 'equipment', |
|
109 | - ) |
|
110 | - ); |
|
111 | - $cmb->add_field( |
|
112 | - array( |
|
113 | - 'name' => __( 'Muscle Group Slug', 'lsx-health-plan' ), |
|
114 | - 'id' => 'endpoint_exercise_musclegroup', |
|
115 | - 'type' => 'input', |
|
116 | - 'value' => '', |
|
117 | - 'default' => 'muscle-group', |
|
118 | - 'after_row' => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ), |
|
119 | - ) |
|
120 | - ); |
|
121 | - } |
|
46 | + /** |
|
47 | + * Registers the general settings. |
|
48 | + * |
|
49 | + * @param object $cmb new_cmb2_box(). |
|
50 | + * @return void |
|
51 | + */ |
|
52 | + public function settings( $cmb ) { |
|
53 | + $cmb->add_field( |
|
54 | + array( |
|
55 | + 'name' => __( 'Exercises', 'lsx-health-plan' ), |
|
56 | + 'id' => 'exercise_enabled', |
|
57 | + 'type' => 'checkbox', |
|
58 | + 'value' => 1, |
|
59 | + 'default' => 0, |
|
60 | + 'description' => __( 'Enabling the exercise post type will automatically replace the Video post type.', 'lsx-health-plan' ), |
|
61 | + ) |
|
62 | + ); |
|
63 | + $cmb->add_field( |
|
64 | + array( |
|
65 | + 'id' => 'exercise_archive_description', |
|
66 | + 'type' => 'wysiwyg', |
|
67 | + 'name' => __( 'Archive Description', 'lsx-health-plan' ), |
|
68 | + 'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ), |
|
69 | + 'options' => array( |
|
70 | + 'textarea_rows' => get_option('default_post_edit_rows', 6), |
|
71 | + ), |
|
72 | + ) |
|
73 | + ); |
|
74 | + $cmb->add_field( |
|
75 | + array( |
|
76 | + 'before_row' => '<h4><b><u>URL Slug Options</u></b></h4><p style="font-style: italic;">If you need to translate the custom slug for this custom post type, do so below.</p>', |
|
77 | + 'name' => __( 'Single Exercise Slug', 'lsx-health-plan' ), |
|
78 | + 'id' => 'endpoint_exercise_single', |
|
79 | + 'type' => 'input', |
|
80 | + 'value' => '', |
|
81 | + 'default' => 'exercise', |
|
82 | + ) |
|
83 | + ); |
|
84 | + $cmb->add_field( |
|
85 | + array( |
|
86 | + 'name' => __( 'Archive Exercise Slug', 'lsx-health-plan' ), |
|
87 | + 'id' => 'endpoint_exercise_archive', |
|
88 | + 'type' => 'input', |
|
89 | + 'value' => '', |
|
90 | + 'default' => 'exercises', |
|
91 | + ) |
|
92 | + ); |
|
93 | + $cmb->add_field( |
|
94 | + array( |
|
95 | + 'name' => __( 'Exercise Type Slug', 'lsx-health-plan' ), |
|
96 | + 'id' => 'endpoint_exercise_type', |
|
97 | + 'type' => 'input', |
|
98 | + 'value' => '', |
|
99 | + 'default' => 'exercise-type', |
|
100 | + ) |
|
101 | + ); |
|
102 | + $cmb->add_field( |
|
103 | + array( |
|
104 | + 'name' => __( 'Equipment Slug', 'lsx-health-plan' ), |
|
105 | + 'id' => 'endpoint_exercise_equipment', |
|
106 | + 'type' => 'input', |
|
107 | + 'value' => '', |
|
108 | + 'default' => 'equipment', |
|
109 | + ) |
|
110 | + ); |
|
111 | + $cmb->add_field( |
|
112 | + array( |
|
113 | + 'name' => __( 'Muscle Group Slug', 'lsx-health-plan' ), |
|
114 | + 'id' => 'endpoint_exercise_musclegroup', |
|
115 | + 'type' => 'input', |
|
116 | + 'value' => '', |
|
117 | + 'default' => 'muscle-group', |
|
118 | + 'after_row' => __( '<p style="font-style: italic;">If you have changed any URL slugs, please remember re-save your permalinks in Settings > Permalinks.</p>', 'lsx-health-plan' ), |
|
119 | + ) |
|
120 | + ); |
|
121 | + } |
|
122 | 122 | } |
123 | 123 | Exercise::get_instance(); |