@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | <?php lsx_content_wrap_before(); ?> |
11 | 11 | |
12 | 12 | <?php |
13 | - $page_id = get_the_ID(); |
|
14 | - $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id; |
|
13 | + $page_id = get_the_ID(); |
|
14 | + $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id; |
|
15 | 15 | ?> |
16 | 16 | |
17 | 17 | <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | |
21 | 21 | <!-- Begining restricted content --> |
22 | 22 | <?php |
23 | - if ( current_user_can( 'administrator', $page_id ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) { |
|
24 | - ?> |
|
23 | + if ( current_user_can( 'administrator', $page_id ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) { |
|
24 | + ?> |
|
25 | 25 | <main id="main" role="main"> |
26 | 26 | |
27 | 27 | <?php lsx_content_top(); ?> |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | <div class="row"> |
31 | 31 | <?php if ( have_posts() ) : ?> |
32 | 32 | <?php |
33 | - while ( have_posts() ) : |
|
34 | - the_post(); |
|
35 | - ?> |
|
33 | + while ( have_posts() ) : |
|
34 | + the_post(); |
|
35 | + ?> |
|
36 | 36 | |
37 | 37 | <?php include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-recipe.php'; ?> |
38 | 38 | |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | </main><!-- #main --> |
52 | 52 | |
53 | 53 | <?php |
54 | - } else { |
|
55 | - wp_redirect( $redirect ); |
|
56 | - exit; |
|
57 | - } |
|
58 | - ?> |
|
54 | + } else { |
|
55 | + wp_redirect( $redirect ); |
|
56 | + exit; |
|
57 | + } |
|
58 | + ?> |
|
59 | 59 | |
60 | 60 | <?php lsx_content_after(); ?> |
61 | 61 |
@@ -8,424 +8,424 @@ |
||
8 | 8 | */ |
9 | 9 | class Exercise { |
10 | 10 | |
11 | - /** |
|
12 | - * Holds class instance |
|
13 | - * |
|
14 | - * @since 1.0.0 |
|
15 | - * |
|
16 | - * @var object \lsx_health_plan\classes\Exercise() |
|
17 | - */ |
|
18 | - protected static $instance = null; |
|
19 | - |
|
20 | - /** |
|
21 | - * Holds post_type slug used as an index |
|
22 | - * |
|
23 | - * @since 1.0.0 |
|
24 | - * |
|
25 | - * @var string |
|
26 | - */ |
|
27 | - public $slug = 'exercise'; |
|
28 | - |
|
29 | - /** |
|
30 | - * Constructor |
|
31 | - */ |
|
32 | - public function __construct() { |
|
33 | - |
|
34 | - if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) { |
|
35 | - // Post Type and Taxonomies. |
|
36 | - add_action( 'init', array( $this, 'register_post_type' ) ); |
|
37 | - add_action( 'init', array( $this, 'exercise_type_taxonomy_setup' ) ); |
|
38 | - add_action( 'init', array( $this, 'equipment_taxonomy_setup' ) ); |
|
39 | - add_action( 'init', array( $this, 'muscle_group_taxonomy_setup' ) ); |
|
40 | - add_action( 'admin_menu', array( $this, 'register_menus' ) ); |
|
41 | - |
|
42 | - // Custom Fields. |
|
43 | - add_action( 'cmb2_admin_init', array( $this, 'exercise_details' ), 8 ); |
|
44 | - add_action( 'cmb2_admin_init', array( $this, 'gallery_metabox' ), 9 ); |
|
45 | - add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 ); |
|
46 | - |
|
47 | - // Template Redirects. |
|
48 | - add_filter( 'lsx_health_plan_archive_template', array( $this, 'enable_post_type' ), 10, 1 ); |
|
49 | - add_filter( 'lsx_health_plan_single_template', array( $this, 'enable_post_type' ), 10, 1 ); |
|
50 | - |
|
51 | - //Breadcrumbs |
|
52 | - add_filter( 'woocommerce_get_breadcrumb', array( $this, 'exercise_breadcrumb_filter' ), 30, 1 ); |
|
53 | - |
|
54 | - } |
|
55 | - |
|
56 | - } |
|
57 | - |
|
58 | - |
|
59 | - /** |
|
60 | - * Return an instance of this class. |
|
61 | - * |
|
62 | - * @since 1.0.0 |
|
63 | - * |
|
64 | - * @return object \lsx_health_plan\classes\Exercise() A single instance of this class. |
|
65 | - */ |
|
66 | - public static function get_instance() { |
|
67 | - // If the single instance hasn't been set, set it now. |
|
68 | - if ( null === self::$instance ) { |
|
69 | - self::$instance = new self(); |
|
70 | - } |
|
71 | - return self::$instance; |
|
72 | - } |
|
73 | - /** |
|
74 | - * Register the post type. |
|
75 | - */ |
|
76 | - public function register_post_type() { |
|
77 | - $labels = array( |
|
78 | - 'name' => esc_html__( 'Exercises', 'lsx-health-plan' ), |
|
79 | - 'singular_name' => esc_html__( 'Exercise', 'lsx-health-plan' ), |
|
80 | - 'add_new' => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ), |
|
81 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
82 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
83 | - 'new_item' => esc_html__( 'New', 'lsx-health-plan' ), |
|
84 | - 'all_items' => esc_html__( 'All Exercises', 'lsx-health-plan' ), |
|
85 | - 'view_item' => esc_html__( 'View', 'lsx-health-plan' ), |
|
86 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
87 | - 'not_found' => esc_html__( 'None found', 'lsx-health-plan' ), |
|
88 | - 'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ), |
|
89 | - 'parent_item_colon' => '', |
|
90 | - 'menu_name' => esc_html__( 'Exercises', 'lsx-health-plan' ), |
|
91 | - ); |
|
92 | - $args = array( |
|
93 | - 'labels' => $labels, |
|
94 | - 'public' => true, |
|
95 | - 'publicly_queryable' => true, |
|
96 | - 'show_ui' => true, |
|
97 | - 'show_in_menu' => false, |
|
98 | - 'show_in_rest' => true, |
|
99 | - 'menu_icon' => 'dashicons-universal-access', |
|
100 | - 'query_var' => true, |
|
101 | - 'rewrite' => array( |
|
102 | - 'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ), |
|
103 | - ), |
|
104 | - 'capability_type' => 'page', |
|
105 | - 'has_archive' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_archive', 'exercises' ), |
|
106 | - 'hierarchical' => false, |
|
107 | - 'menu_position' => null, |
|
108 | - 'supports' => array( |
|
109 | - 'title', |
|
110 | - 'thumbnail', |
|
111 | - 'editor', |
|
112 | - 'excerpt', |
|
113 | - 'custom-fields', |
|
114 | - ), |
|
115 | - ); |
|
116 | - register_post_type( 'exercise', $args ); |
|
117 | - } |
|
118 | - |
|
119 | - /** |
|
120 | - * Register the Exercise taxonomy. |
|
121 | - * |
|
122 | - * @return void |
|
123 | - */ |
|
124 | - public function exercise_type_taxonomy_setup() { |
|
125 | - $labels = array( |
|
126 | - 'name' => esc_html_x( 'Exercise Type', 'taxonomy general name', 'lsx-health-plan' ), |
|
127 | - 'singular_name' => esc_html_x( 'Exercise Type', 'taxonomy singular name', 'lsx-health-plan' ), |
|
128 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
129 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
130 | - 'parent_item' => esc_html__( 'Parent', 'lsx-health-plan' ), |
|
131 | - 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ), |
|
132 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
133 | - 'update_item' => esc_html__( 'Update', 'lsx-health-plan' ), |
|
134 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
135 | - 'new_item_name' => esc_html__( 'New Name', 'lsx-health-plan' ), |
|
136 | - 'menu_name' => esc_html__( 'Exercise Types', 'lsx-health-plan' ), |
|
137 | - ); |
|
138 | - |
|
139 | - $args = array( |
|
140 | - 'hierarchical' => true, |
|
141 | - 'labels' => $labels, |
|
142 | - 'show_ui' => true, |
|
143 | - 'show_admin_column' => true, |
|
144 | - 'query_var' => true, |
|
145 | - 'rewrite' => array( |
|
146 | - 'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_type', 'exercise-type' ), |
|
147 | - ), |
|
148 | - 'show_in_rest' => true, |
|
149 | - ); |
|
150 | - |
|
151 | - register_taxonomy( 'exercise-type', array( 'exercise' ), $args ); |
|
152 | - } |
|
153 | - |
|
154 | - /** |
|
155 | - * Register the Exercise taxonomy. |
|
156 | - * |
|
157 | - * @return void |
|
158 | - */ |
|
159 | - public function equipment_taxonomy_setup() { |
|
160 | - $labels = array( |
|
161 | - 'name' => esc_html_x( 'Equipment', 'taxonomy general name', 'lsx-health-plan' ), |
|
162 | - 'singular_name' => esc_html_x( 'Equipment', 'taxonomy singular name', 'lsx-health-plan' ), |
|
163 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
164 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
165 | - 'parent_item' => esc_html__( 'Parent', 'lsx-health-plan' ), |
|
166 | - 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ), |
|
167 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
168 | - 'update_item' => esc_html__( 'Update', 'lsx-health-plan' ), |
|
169 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
170 | - 'new_item_name' => esc_html__( 'New Name', 'lsx-health-plan' ), |
|
171 | - 'menu_name' => esc_html__( 'Equipment', 'lsx-health-plan' ), |
|
172 | - ); |
|
173 | - |
|
174 | - $args = array( |
|
175 | - 'hierarchical' => true, |
|
176 | - 'labels' => $labels, |
|
177 | - 'show_ui' => true, |
|
178 | - 'show_admin_column' => true, |
|
179 | - 'query_var' => true, |
|
180 | - 'rewrite' => array( |
|
181 | - 'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_equipment', 'equipment' ), |
|
182 | - ), |
|
183 | - 'show_in_rest' => true, |
|
184 | - ); |
|
185 | - |
|
186 | - register_taxonomy( 'equipment', array( 'exercise' ), $args ); |
|
187 | - } |
|
188 | - |
|
189 | - /** |
|
190 | - * Register the Muscle Group taxonomy. |
|
191 | - * |
|
192 | - * @return void |
|
193 | - */ |
|
194 | - public function muscle_group_taxonomy_setup() { |
|
195 | - $labels = array( |
|
196 | - 'name' => esc_html_x( 'Muscle Groups', 'taxonomy general name', 'lsx-health-plan' ), |
|
197 | - 'singular_name' => esc_html_x( 'Muscle Group', 'taxonomy singular name', 'lsx-health-plan' ), |
|
198 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
199 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
200 | - 'parent_item' => esc_html__( 'Parent', 'lsx-health-plan' ), |
|
201 | - 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ), |
|
202 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
203 | - 'update_item' => esc_html__( 'Update', 'lsx-health-plan' ), |
|
204 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
205 | - 'new_item_name' => esc_html__( 'New Name', 'lsx-health-plan' ), |
|
206 | - 'menu_name' => esc_html__( 'Muscle Groups', 'lsx-health-plan' ), |
|
207 | - ); |
|
208 | - |
|
209 | - $args = array( |
|
210 | - 'hierarchical' => true, |
|
211 | - 'labels' => $labels, |
|
212 | - 'show_ui' => true, |
|
213 | - 'show_admin_column' => true, |
|
214 | - 'query_var' => true, |
|
215 | - 'rewrite' => array( |
|
216 | - 'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_muscle_group', 'muscle-group' ), |
|
217 | - ), |
|
218 | - 'show_in_rest' => true, |
|
219 | - ); |
|
220 | - |
|
221 | - register_taxonomy( 'muscle-group', array( 'exercise' ), $args ); |
|
222 | - } |
|
223 | - |
|
224 | - /** |
|
225 | - * Registers the Recipes under the Meals Post type menu. |
|
226 | - * |
|
227 | - * @return void |
|
228 | - */ |
|
229 | - public function register_menus() { |
|
230 | - add_submenu_page( 'edit.php?post_type=workout', esc_html__( 'Exercises', 'lsx-health-plan' ), esc_html__( 'Exercises', 'lsx-health-plan' ), 'edit_posts', 'edit.php?post_type=exercise' ); |
|
231 | - add_submenu_page( 'edit.php?post_type=workout', esc_html__( 'Exercise Types', 'lsx-health-plan' ), esc_html__( 'Exercise Types', 'lsx-health-plan' ), 'edit_posts', 'edit-tags.php?taxonomy=exercise-type&post_type=exercise' ); |
|
232 | - add_submenu_page( 'edit.php?post_type=workout', esc_html__( 'Equipment', 'lsx-health-plan' ), esc_html__( 'Equipment', 'lsx-health-plan' ), 'edit_posts', 'edit-tags.php?taxonomy=equipment&post_type=exercise' ); |
|
233 | - add_submenu_page( 'edit.php?post_type=workout', esc_html__( 'Muscle Groups', 'lsx-health-plan' ), esc_html__( 'Muscle Groups', 'lsx-health-plan' ), 'edit_posts', 'edit-tags.php?taxonomy=muscle-group&post_type=exercise' ); |
|
234 | - } |
|
235 | - |
|
236 | - /** |
|
237 | - * Adds the post type to the different arrays. |
|
238 | - * |
|
239 | - * @param array $post_types |
|
240 | - * @return array |
|
241 | - */ |
|
242 | - public function enable_post_type( $post_types = array() ) { |
|
243 | - $post_types[] = $this->slug; |
|
244 | - return $post_types; |
|
245 | - } |
|
246 | - |
|
247 | - /** |
|
248 | - * Enables the Bi Directional relationships |
|
249 | - * |
|
250 | - * @param array $connections |
|
251 | - * @return void |
|
252 | - */ |
|
253 | - public function enable_connections( $connections = array() ) { |
|
254 | - $connections['exercise']['connected_workouts'] = 'connected_exercises'; |
|
255 | - $connections['workout']['connected_exercises'] = 'connected_workouts'; |
|
256 | - return $connections; |
|
257 | - } |
|
258 | - |
|
259 | - /** |
|
260 | - * Define the metabox and field configurations. |
|
261 | - */ |
|
262 | - public function gallery_metabox() { |
|
263 | - $cmb = new_cmb2_box( |
|
264 | - array( |
|
265 | - 'id' => $this->slug . '_gallery_details_metabox', |
|
266 | - 'title' => __( 'Exercise Gallery', 'lsx-health-plan' ), |
|
267 | - 'object_types' => array( $this->slug ), |
|
268 | - 'context' => 'normal', |
|
269 | - 'priority' => 'low', |
|
270 | - 'show_names' => true, |
|
271 | - ) |
|
272 | - ); |
|
273 | - |
|
274 | - $cmb->add_field( |
|
275 | - array( |
|
276 | - 'name' => __( 'Layout', 'lsx-health-plan' ), |
|
277 | - 'id' => $this->slug . '_gallery_layout', |
|
278 | - 'type' => 'radio', |
|
279 | - 'options' => array( |
|
280 | - 'slider' => __( 'Slider', 'lsx-health-plan' ) . ' {#}', // {#} gets replaced by row number |
|
281 | - 'grid' => __( 'Grid', 'lsx-health-plan' ), |
|
282 | - ), |
|
283 | - 'default' => 'grid', |
|
284 | - ) |
|
285 | - ); |
|
286 | - |
|
287 | - $cmb->add_field( |
|
288 | - array( |
|
289 | - 'name' => __( 'Grid Columns', 'lsx-health-plan' ), |
|
290 | - 'id' => $this->slug . '_gallery_columns', |
|
291 | - 'type' => 'text', |
|
292 | - 'default' => '1', |
|
293 | - ) |
|
294 | - ); |
|
295 | - |
|
296 | - // Repeatable group. |
|
297 | - $gallery_group = $cmb->add_field( |
|
298 | - array( |
|
299 | - 'id' => $this->slug . '_gallery', |
|
300 | - 'type' => 'group', |
|
301 | - 'options' => array( |
|
302 | - 'group_title' => __( 'Gallery', 'lsx-health-plan' ) . ' {#}', // {#} gets replaced by row number |
|
303 | - 'add_button' => __( 'Add Item', 'lsx-health-plan' ), |
|
304 | - 'remove_button' => __( 'Remove Item', 'lsx-health-plan' ), |
|
305 | - 'sortable' => true, |
|
306 | - ), |
|
307 | - 'classes' => 'lsx-admin-row', |
|
308 | - ) |
|
309 | - ); |
|
310 | - |
|
311 | - // Title. |
|
312 | - $cmb->add_group_field( |
|
313 | - $gallery_group, |
|
314 | - array( |
|
315 | - 'name' => __( 'Image', 'lsx-health-plan' ), |
|
316 | - 'id' => $this->slug . '_gallery_image', |
|
317 | - 'type' => 'file', |
|
318 | - 'text' => array( |
|
319 | - 'add_upload_file_text' => __( 'Add File', 'lsx-health-plan' ), |
|
320 | - ), |
|
321 | - 'desc' => __( 'Upload an image a minimum of 800px x 600px in size.', 'lsx-health-plan' ), |
|
322 | - 'query_args' => array( |
|
323 | - 'type' => array( |
|
324 | - 'image/gif', |
|
325 | - 'image/jpeg', |
|
326 | - 'image/png', |
|
327 | - ), |
|
328 | - ), |
|
329 | - 'preview_size' => 'lsx-thumbnail-wide', |
|
330 | - ) |
|
331 | - ); |
|
332 | - |
|
333 | - // Title. |
|
334 | - $cmb->add_group_field( |
|
335 | - $gallery_group, |
|
336 | - array( |
|
337 | - 'name' => __( 'oEmbed', 'lsx-health-plan' ), |
|
338 | - 'id' => $this->slug . '_gallery_embed', |
|
339 | - 'type' => 'text', |
|
340 | - 'desc' => __( 'Drop in the embed url for your video from YouTube, Vimeo or DailyMotion, e.g: "https://www.youtube.com/watch?v=9xwazD5SyVg". A full list of supports formats can be found at <a href="https://make.wordpress.org/support/user-manual/content/media/adding-media-to-your-pages-and-posts/embedding-media-from-other-sites/">WordPress</a>', 'lsx-health-plan' ), |
|
341 | - ) |
|
342 | - ); |
|
343 | - |
|
344 | - $cmb->add_group_field( |
|
345 | - $gallery_group, |
|
346 | - array( |
|
347 | - 'name' => __( 'External Media', 'lsx-health-plan' ), |
|
348 | - 'id' => $this->slug . '_gallery_external', |
|
349 | - 'type' => 'textarea_code', |
|
350 | - 'desc' => __( 'Drop in the iFrame embed code from Giphy in this field, i.e: <iframe src="https://giphy.com/embed/3o7527Rn1HxXWqgxuo" width="480" height="270" frameborder="0" class="giphy-embed" allowfullscreen></iframe>', 'lsx-health-plan' ), |
|
351 | - ) |
|
352 | - ); |
|
353 | - } |
|
354 | - |
|
355 | - /** |
|
356 | - * Registers the general settings for the exercise. |
|
357 | - * |
|
358 | - * @return void |
|
359 | - */ |
|
360 | - public function exercise_details() { |
|
361 | - $cmb = new_cmb2_box( |
|
362 | - array( |
|
363 | - 'id' => $this->slug . '_general_details_metabox', |
|
364 | - 'title' => __( 'Details', 'lsx-health-plan' ), |
|
365 | - 'object_types' => array( $this->slug ), |
|
366 | - 'context' => 'normal', |
|
367 | - 'priority' => 'high', |
|
368 | - 'show_names' => true, |
|
369 | - ) |
|
370 | - ); |
|
371 | - |
|
372 | - $cmb->add_field( |
|
373 | - array( |
|
374 | - 'name' => __( 'Side', 'lsx-health-plan' ), |
|
375 | - 'id' => $this->slug . '_side', |
|
376 | - 'type' => 'select', |
|
377 | - 'options' => array( |
|
378 | - '' => __( 'Select', 'lsx-health-plan' ), |
|
379 | - 'left' => __( 'Left', 'lsx-health-plan' ), |
|
380 | - 'right' => __( 'Right', 'lsx-health-plan' ), |
|
381 | - ), |
|
382 | - 'desc' => __( 'Select which side this exercise uses. ', 'lsx-health-plan' ), |
|
383 | - ) |
|
384 | - ); |
|
385 | - } |
|
386 | - |
|
387 | - /** |
|
388 | - * Holds the array for the single exercise breadcrumbs. |
|
389 | - * |
|
390 | - * @var array $crumbs |
|
391 | - * @return array |
|
392 | - */ |
|
393 | - public function exercise_breadcrumb_filter( $crumbs ) { |
|
394 | - $exercise = \lsx_health_plan\functions\get_option( 'endpoint_exercise', 'exercise' ); |
|
395 | - $exercises = \lsx_health_plan\functions\get_option( 'endpoint_exercise_archive', 'exercise' ); |
|
396 | - $url = get_post_type_archive_link( $exercise ); |
|
397 | - |
|
398 | - if ( is_singular( 'exercise' ) ) { |
|
399 | - $exercise_name = get_the_title(); |
|
400 | - $term_obj_list = get_the_terms( get_the_ID(), 'exercise-type' ); |
|
401 | - $exercise_type = $term_obj_list[0]->name; |
|
402 | - $exercise_type_url = get_term_link( $term_obj_list[0]->term_id ); |
|
11 | + /** |
|
12 | + * Holds class instance |
|
13 | + * |
|
14 | + * @since 1.0.0 |
|
15 | + * |
|
16 | + * @var object \lsx_health_plan\classes\Exercise() |
|
17 | + */ |
|
18 | + protected static $instance = null; |
|
19 | + |
|
20 | + /** |
|
21 | + * Holds post_type slug used as an index |
|
22 | + * |
|
23 | + * @since 1.0.0 |
|
24 | + * |
|
25 | + * @var string |
|
26 | + */ |
|
27 | + public $slug = 'exercise'; |
|
28 | + |
|
29 | + /** |
|
30 | + * Constructor |
|
31 | + */ |
|
32 | + public function __construct() { |
|
33 | + |
|
34 | + if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) { |
|
35 | + // Post Type and Taxonomies. |
|
36 | + add_action( 'init', array( $this, 'register_post_type' ) ); |
|
37 | + add_action( 'init', array( $this, 'exercise_type_taxonomy_setup' ) ); |
|
38 | + add_action( 'init', array( $this, 'equipment_taxonomy_setup' ) ); |
|
39 | + add_action( 'init', array( $this, 'muscle_group_taxonomy_setup' ) ); |
|
40 | + add_action( 'admin_menu', array( $this, 'register_menus' ) ); |
|
41 | + |
|
42 | + // Custom Fields. |
|
43 | + add_action( 'cmb2_admin_init', array( $this, 'exercise_details' ), 8 ); |
|
44 | + add_action( 'cmb2_admin_init', array( $this, 'gallery_metabox' ), 9 ); |
|
45 | + add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 ); |
|
46 | + |
|
47 | + // Template Redirects. |
|
48 | + add_filter( 'lsx_health_plan_archive_template', array( $this, 'enable_post_type' ), 10, 1 ); |
|
49 | + add_filter( 'lsx_health_plan_single_template', array( $this, 'enable_post_type' ), 10, 1 ); |
|
50 | + |
|
51 | + //Breadcrumbs |
|
52 | + add_filter( 'woocommerce_get_breadcrumb', array( $this, 'exercise_breadcrumb_filter' ), 30, 1 ); |
|
53 | + |
|
54 | + } |
|
55 | + |
|
56 | + } |
|
57 | + |
|
58 | + |
|
59 | + /** |
|
60 | + * Return an instance of this class. |
|
61 | + * |
|
62 | + * @since 1.0.0 |
|
63 | + * |
|
64 | + * @return object \lsx_health_plan\classes\Exercise() A single instance of this class. |
|
65 | + */ |
|
66 | + public static function get_instance() { |
|
67 | + // If the single instance hasn't been set, set it now. |
|
68 | + if ( null === self::$instance ) { |
|
69 | + self::$instance = new self(); |
|
70 | + } |
|
71 | + return self::$instance; |
|
72 | + } |
|
73 | + /** |
|
74 | + * Register the post type. |
|
75 | + */ |
|
76 | + public function register_post_type() { |
|
77 | + $labels = array( |
|
78 | + 'name' => esc_html__( 'Exercises', 'lsx-health-plan' ), |
|
79 | + 'singular_name' => esc_html__( 'Exercise', 'lsx-health-plan' ), |
|
80 | + 'add_new' => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ), |
|
81 | + 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
82 | + 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
83 | + 'new_item' => esc_html__( 'New', 'lsx-health-plan' ), |
|
84 | + 'all_items' => esc_html__( 'All Exercises', 'lsx-health-plan' ), |
|
85 | + 'view_item' => esc_html__( 'View', 'lsx-health-plan' ), |
|
86 | + 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
87 | + 'not_found' => esc_html__( 'None found', 'lsx-health-plan' ), |
|
88 | + 'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ), |
|
89 | + 'parent_item_colon' => '', |
|
90 | + 'menu_name' => esc_html__( 'Exercises', 'lsx-health-plan' ), |
|
91 | + ); |
|
92 | + $args = array( |
|
93 | + 'labels' => $labels, |
|
94 | + 'public' => true, |
|
95 | + 'publicly_queryable' => true, |
|
96 | + 'show_ui' => true, |
|
97 | + 'show_in_menu' => false, |
|
98 | + 'show_in_rest' => true, |
|
99 | + 'menu_icon' => 'dashicons-universal-access', |
|
100 | + 'query_var' => true, |
|
101 | + 'rewrite' => array( |
|
102 | + 'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ), |
|
103 | + ), |
|
104 | + 'capability_type' => 'page', |
|
105 | + 'has_archive' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_archive', 'exercises' ), |
|
106 | + 'hierarchical' => false, |
|
107 | + 'menu_position' => null, |
|
108 | + 'supports' => array( |
|
109 | + 'title', |
|
110 | + 'thumbnail', |
|
111 | + 'editor', |
|
112 | + 'excerpt', |
|
113 | + 'custom-fields', |
|
114 | + ), |
|
115 | + ); |
|
116 | + register_post_type( 'exercise', $args ); |
|
117 | + } |
|
118 | + |
|
119 | + /** |
|
120 | + * Register the Exercise taxonomy. |
|
121 | + * |
|
122 | + * @return void |
|
123 | + */ |
|
124 | + public function exercise_type_taxonomy_setup() { |
|
125 | + $labels = array( |
|
126 | + 'name' => esc_html_x( 'Exercise Type', 'taxonomy general name', 'lsx-health-plan' ), |
|
127 | + 'singular_name' => esc_html_x( 'Exercise Type', 'taxonomy singular name', 'lsx-health-plan' ), |
|
128 | + 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
129 | + 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
130 | + 'parent_item' => esc_html__( 'Parent', 'lsx-health-plan' ), |
|
131 | + 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ), |
|
132 | + 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
133 | + 'update_item' => esc_html__( 'Update', 'lsx-health-plan' ), |
|
134 | + 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
135 | + 'new_item_name' => esc_html__( 'New Name', 'lsx-health-plan' ), |
|
136 | + 'menu_name' => esc_html__( 'Exercise Types', 'lsx-health-plan' ), |
|
137 | + ); |
|
138 | + |
|
139 | + $args = array( |
|
140 | + 'hierarchical' => true, |
|
141 | + 'labels' => $labels, |
|
142 | + 'show_ui' => true, |
|
143 | + 'show_admin_column' => true, |
|
144 | + 'query_var' => true, |
|
145 | + 'rewrite' => array( |
|
146 | + 'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_type', 'exercise-type' ), |
|
147 | + ), |
|
148 | + 'show_in_rest' => true, |
|
149 | + ); |
|
150 | + |
|
151 | + register_taxonomy( 'exercise-type', array( 'exercise' ), $args ); |
|
152 | + } |
|
153 | + |
|
154 | + /** |
|
155 | + * Register the Exercise taxonomy. |
|
156 | + * |
|
157 | + * @return void |
|
158 | + */ |
|
159 | + public function equipment_taxonomy_setup() { |
|
160 | + $labels = array( |
|
161 | + 'name' => esc_html_x( 'Equipment', 'taxonomy general name', 'lsx-health-plan' ), |
|
162 | + 'singular_name' => esc_html_x( 'Equipment', 'taxonomy singular name', 'lsx-health-plan' ), |
|
163 | + 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
164 | + 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
165 | + 'parent_item' => esc_html__( 'Parent', 'lsx-health-plan' ), |
|
166 | + 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ), |
|
167 | + 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
168 | + 'update_item' => esc_html__( 'Update', 'lsx-health-plan' ), |
|
169 | + 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
170 | + 'new_item_name' => esc_html__( 'New Name', 'lsx-health-plan' ), |
|
171 | + 'menu_name' => esc_html__( 'Equipment', 'lsx-health-plan' ), |
|
172 | + ); |
|
173 | + |
|
174 | + $args = array( |
|
175 | + 'hierarchical' => true, |
|
176 | + 'labels' => $labels, |
|
177 | + 'show_ui' => true, |
|
178 | + 'show_admin_column' => true, |
|
179 | + 'query_var' => true, |
|
180 | + 'rewrite' => array( |
|
181 | + 'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_equipment', 'equipment' ), |
|
182 | + ), |
|
183 | + 'show_in_rest' => true, |
|
184 | + ); |
|
185 | + |
|
186 | + register_taxonomy( 'equipment', array( 'exercise' ), $args ); |
|
187 | + } |
|
188 | + |
|
189 | + /** |
|
190 | + * Register the Muscle Group taxonomy. |
|
191 | + * |
|
192 | + * @return void |
|
193 | + */ |
|
194 | + public function muscle_group_taxonomy_setup() { |
|
195 | + $labels = array( |
|
196 | + 'name' => esc_html_x( 'Muscle Groups', 'taxonomy general name', 'lsx-health-plan' ), |
|
197 | + 'singular_name' => esc_html_x( 'Muscle Group', 'taxonomy singular name', 'lsx-health-plan' ), |
|
198 | + 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
199 | + 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
200 | + 'parent_item' => esc_html__( 'Parent', 'lsx-health-plan' ), |
|
201 | + 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ), |
|
202 | + 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
203 | + 'update_item' => esc_html__( 'Update', 'lsx-health-plan' ), |
|
204 | + 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
205 | + 'new_item_name' => esc_html__( 'New Name', 'lsx-health-plan' ), |
|
206 | + 'menu_name' => esc_html__( 'Muscle Groups', 'lsx-health-plan' ), |
|
207 | + ); |
|
208 | + |
|
209 | + $args = array( |
|
210 | + 'hierarchical' => true, |
|
211 | + 'labels' => $labels, |
|
212 | + 'show_ui' => true, |
|
213 | + 'show_admin_column' => true, |
|
214 | + 'query_var' => true, |
|
215 | + 'rewrite' => array( |
|
216 | + 'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_muscle_group', 'muscle-group' ), |
|
217 | + ), |
|
218 | + 'show_in_rest' => true, |
|
219 | + ); |
|
220 | + |
|
221 | + register_taxonomy( 'muscle-group', array( 'exercise' ), $args ); |
|
222 | + } |
|
223 | + |
|
224 | + /** |
|
225 | + * Registers the Recipes under the Meals Post type menu. |
|
226 | + * |
|
227 | + * @return void |
|
228 | + */ |
|
229 | + public function register_menus() { |
|
230 | + add_submenu_page( 'edit.php?post_type=workout', esc_html__( 'Exercises', 'lsx-health-plan' ), esc_html__( 'Exercises', 'lsx-health-plan' ), 'edit_posts', 'edit.php?post_type=exercise' ); |
|
231 | + add_submenu_page( 'edit.php?post_type=workout', esc_html__( 'Exercise Types', 'lsx-health-plan' ), esc_html__( 'Exercise Types', 'lsx-health-plan' ), 'edit_posts', 'edit-tags.php?taxonomy=exercise-type&post_type=exercise' ); |
|
232 | + add_submenu_page( 'edit.php?post_type=workout', esc_html__( 'Equipment', 'lsx-health-plan' ), esc_html__( 'Equipment', 'lsx-health-plan' ), 'edit_posts', 'edit-tags.php?taxonomy=equipment&post_type=exercise' ); |
|
233 | + add_submenu_page( 'edit.php?post_type=workout', esc_html__( 'Muscle Groups', 'lsx-health-plan' ), esc_html__( 'Muscle Groups', 'lsx-health-plan' ), 'edit_posts', 'edit-tags.php?taxonomy=muscle-group&post_type=exercise' ); |
|
234 | + } |
|
235 | + |
|
236 | + /** |
|
237 | + * Adds the post type to the different arrays. |
|
238 | + * |
|
239 | + * @param array $post_types |
|
240 | + * @return array |
|
241 | + */ |
|
242 | + public function enable_post_type( $post_types = array() ) { |
|
243 | + $post_types[] = $this->slug; |
|
244 | + return $post_types; |
|
245 | + } |
|
246 | + |
|
247 | + /** |
|
248 | + * Enables the Bi Directional relationships |
|
249 | + * |
|
250 | + * @param array $connections |
|
251 | + * @return void |
|
252 | + */ |
|
253 | + public function enable_connections( $connections = array() ) { |
|
254 | + $connections['exercise']['connected_workouts'] = 'connected_exercises'; |
|
255 | + $connections['workout']['connected_exercises'] = 'connected_workouts'; |
|
256 | + return $connections; |
|
257 | + } |
|
258 | + |
|
259 | + /** |
|
260 | + * Define the metabox and field configurations. |
|
261 | + */ |
|
262 | + public function gallery_metabox() { |
|
263 | + $cmb = new_cmb2_box( |
|
264 | + array( |
|
265 | + 'id' => $this->slug . '_gallery_details_metabox', |
|
266 | + 'title' => __( 'Exercise Gallery', 'lsx-health-plan' ), |
|
267 | + 'object_types' => array( $this->slug ), |
|
268 | + 'context' => 'normal', |
|
269 | + 'priority' => 'low', |
|
270 | + 'show_names' => true, |
|
271 | + ) |
|
272 | + ); |
|
273 | + |
|
274 | + $cmb->add_field( |
|
275 | + array( |
|
276 | + 'name' => __( 'Layout', 'lsx-health-plan' ), |
|
277 | + 'id' => $this->slug . '_gallery_layout', |
|
278 | + 'type' => 'radio', |
|
279 | + 'options' => array( |
|
280 | + 'slider' => __( 'Slider', 'lsx-health-plan' ) . ' {#}', // {#} gets replaced by row number |
|
281 | + 'grid' => __( 'Grid', 'lsx-health-plan' ), |
|
282 | + ), |
|
283 | + 'default' => 'grid', |
|
284 | + ) |
|
285 | + ); |
|
286 | + |
|
287 | + $cmb->add_field( |
|
288 | + array( |
|
289 | + 'name' => __( 'Grid Columns', 'lsx-health-plan' ), |
|
290 | + 'id' => $this->slug . '_gallery_columns', |
|
291 | + 'type' => 'text', |
|
292 | + 'default' => '1', |
|
293 | + ) |
|
294 | + ); |
|
295 | + |
|
296 | + // Repeatable group. |
|
297 | + $gallery_group = $cmb->add_field( |
|
298 | + array( |
|
299 | + 'id' => $this->slug . '_gallery', |
|
300 | + 'type' => 'group', |
|
301 | + 'options' => array( |
|
302 | + 'group_title' => __( 'Gallery', 'lsx-health-plan' ) . ' {#}', // {#} gets replaced by row number |
|
303 | + 'add_button' => __( 'Add Item', 'lsx-health-plan' ), |
|
304 | + 'remove_button' => __( 'Remove Item', 'lsx-health-plan' ), |
|
305 | + 'sortable' => true, |
|
306 | + ), |
|
307 | + 'classes' => 'lsx-admin-row', |
|
308 | + ) |
|
309 | + ); |
|
310 | + |
|
311 | + // Title. |
|
312 | + $cmb->add_group_field( |
|
313 | + $gallery_group, |
|
314 | + array( |
|
315 | + 'name' => __( 'Image', 'lsx-health-plan' ), |
|
316 | + 'id' => $this->slug . '_gallery_image', |
|
317 | + 'type' => 'file', |
|
318 | + 'text' => array( |
|
319 | + 'add_upload_file_text' => __( 'Add File', 'lsx-health-plan' ), |
|
320 | + ), |
|
321 | + 'desc' => __( 'Upload an image a minimum of 800px x 600px in size.', 'lsx-health-plan' ), |
|
322 | + 'query_args' => array( |
|
323 | + 'type' => array( |
|
324 | + 'image/gif', |
|
325 | + 'image/jpeg', |
|
326 | + 'image/png', |
|
327 | + ), |
|
328 | + ), |
|
329 | + 'preview_size' => 'lsx-thumbnail-wide', |
|
330 | + ) |
|
331 | + ); |
|
332 | + |
|
333 | + // Title. |
|
334 | + $cmb->add_group_field( |
|
335 | + $gallery_group, |
|
336 | + array( |
|
337 | + 'name' => __( 'oEmbed', 'lsx-health-plan' ), |
|
338 | + 'id' => $this->slug . '_gallery_embed', |
|
339 | + 'type' => 'text', |
|
340 | + 'desc' => __( 'Drop in the embed url for your video from YouTube, Vimeo or DailyMotion, e.g: "https://www.youtube.com/watch?v=9xwazD5SyVg". A full list of supports formats can be found at <a href="https://make.wordpress.org/support/user-manual/content/media/adding-media-to-your-pages-and-posts/embedding-media-from-other-sites/">WordPress</a>', 'lsx-health-plan' ), |
|
341 | + ) |
|
342 | + ); |
|
343 | + |
|
344 | + $cmb->add_group_field( |
|
345 | + $gallery_group, |
|
346 | + array( |
|
347 | + 'name' => __( 'External Media', 'lsx-health-plan' ), |
|
348 | + 'id' => $this->slug . '_gallery_external', |
|
349 | + 'type' => 'textarea_code', |
|
350 | + 'desc' => __( 'Drop in the iFrame embed code from Giphy in this field, i.e: <iframe src="https://giphy.com/embed/3o7527Rn1HxXWqgxuo" width="480" height="270" frameborder="0" class="giphy-embed" allowfullscreen></iframe>', 'lsx-health-plan' ), |
|
351 | + ) |
|
352 | + ); |
|
353 | + } |
|
354 | + |
|
355 | + /** |
|
356 | + * Registers the general settings for the exercise. |
|
357 | + * |
|
358 | + * @return void |
|
359 | + */ |
|
360 | + public function exercise_details() { |
|
361 | + $cmb = new_cmb2_box( |
|
362 | + array( |
|
363 | + 'id' => $this->slug . '_general_details_metabox', |
|
364 | + 'title' => __( 'Details', 'lsx-health-plan' ), |
|
365 | + 'object_types' => array( $this->slug ), |
|
366 | + 'context' => 'normal', |
|
367 | + 'priority' => 'high', |
|
368 | + 'show_names' => true, |
|
369 | + ) |
|
370 | + ); |
|
371 | + |
|
372 | + $cmb->add_field( |
|
373 | + array( |
|
374 | + 'name' => __( 'Side', 'lsx-health-plan' ), |
|
375 | + 'id' => $this->slug . '_side', |
|
376 | + 'type' => 'select', |
|
377 | + 'options' => array( |
|
378 | + '' => __( 'Select', 'lsx-health-plan' ), |
|
379 | + 'left' => __( 'Left', 'lsx-health-plan' ), |
|
380 | + 'right' => __( 'Right', 'lsx-health-plan' ), |
|
381 | + ), |
|
382 | + 'desc' => __( 'Select which side this exercise uses. ', 'lsx-health-plan' ), |
|
383 | + ) |
|
384 | + ); |
|
385 | + } |
|
386 | + |
|
387 | + /** |
|
388 | + * Holds the array for the single exercise breadcrumbs. |
|
389 | + * |
|
390 | + * @var array $crumbs |
|
391 | + * @return array |
|
392 | + */ |
|
393 | + public function exercise_breadcrumb_filter( $crumbs ) { |
|
394 | + $exercise = \lsx_health_plan\functions\get_option( 'endpoint_exercise', 'exercise' ); |
|
395 | + $exercises = \lsx_health_plan\functions\get_option( 'endpoint_exercise_archive', 'exercise' ); |
|
396 | + $url = get_post_type_archive_link( $exercise ); |
|
397 | + |
|
398 | + if ( is_singular( 'exercise' ) ) { |
|
399 | + $exercise_name = get_the_title(); |
|
400 | + $term_obj_list = get_the_terms( get_the_ID(), 'exercise-type' ); |
|
401 | + $exercise_type = $term_obj_list[0]->name; |
|
402 | + $exercise_type_url = get_term_link( $term_obj_list[0]->term_id ); |
|
403 | 403 | |
404 | - $crumbs[1] = array( |
|
405 | - 0 => $exercises, |
|
406 | - 1 => $url, |
|
407 | - ); |
|
408 | - $crumbs[2] = array( |
|
409 | - 0 => $exercise_type, |
|
410 | - 1 => $exercise_type_url, |
|
411 | - ); |
|
412 | - $crumbs[3] = array( |
|
413 | - 0 => $exercise_name, |
|
414 | - ); |
|
415 | - } |
|
416 | - if ( is_tax( 'exercise-type' ) || is_tax( 'muscle-group' ) || is_tax( 'equipment' ) ) { |
|
417 | - $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); |
|
418 | - |
|
419 | - $single_term_title = str_replace( '-', ' ', $term->taxonomy ) . ': ' . $term->name; |
|
420 | - |
|
421 | - $crumbs[1] = array( |
|
422 | - 0 => $exercises, |
|
423 | - 1 => $url, |
|
424 | - ); |
|
425 | - $crumbs[2] = array( |
|
426 | - 0 => $single_term_title, |
|
427 | - ); |
|
428 | - } |
|
429 | - return $crumbs; |
|
430 | - } |
|
404 | + $crumbs[1] = array( |
|
405 | + 0 => $exercises, |
|
406 | + 1 => $url, |
|
407 | + ); |
|
408 | + $crumbs[2] = array( |
|
409 | + 0 => $exercise_type, |
|
410 | + 1 => $exercise_type_url, |
|
411 | + ); |
|
412 | + $crumbs[3] = array( |
|
413 | + 0 => $exercise_name, |
|
414 | + ); |
|
415 | + } |
|
416 | + if ( is_tax( 'exercise-type' ) || is_tax( 'muscle-group' ) || is_tax( 'equipment' ) ) { |
|
417 | + $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); |
|
418 | + |
|
419 | + $single_term_title = str_replace( '-', ' ', $term->taxonomy ) . ': ' . $term->name; |
|
420 | + |
|
421 | + $crumbs[1] = array( |
|
422 | + 0 => $exercises, |
|
423 | + 1 => $url, |
|
424 | + ); |
|
425 | + $crumbs[2] = array( |
|
426 | + 0 => $single_term_title, |
|
427 | + ); |
|
428 | + } |
|
429 | + return $crumbs; |
|
430 | + } |
|
431 | 431 | } |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | <?php lsx_content_wrap_before(); ?> |
11 | 11 | |
12 | 12 | <?php |
13 | - $page_id = get_the_ID(); |
|
14 | - $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id; |
|
13 | + $page_id = get_the_ID(); |
|
14 | + $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id; |
|
15 | 15 | ?> |
16 | 16 | |
17 | 17 | <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | |
21 | 21 | <!-- Begining restricted content --> |
22 | 22 | <?php |
23 | - if ( current_user_can( 'administrator', $page_id ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) { |
|
24 | - ?> |
|
23 | + if ( current_user_can( 'administrator', $page_id ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) { |
|
24 | + ?> |
|
25 | 25 | <main id="main" role="main"> |
26 | 26 | |
27 | 27 | <?php lsx_content_top(); ?> |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | <div class="row"> |
31 | 31 | <?php if ( have_posts() ) : ?> |
32 | 32 | <?php |
33 | - while ( have_posts() ) : |
|
34 | - the_post(); |
|
35 | - ?> |
|
33 | + while ( have_posts() ) : |
|
34 | + the_post(); |
|
35 | + ?> |
|
36 | 36 | |
37 | 37 | <?php include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-workout.php'; ?> |
38 | 38 | |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | </main><!-- #main --> |
52 | 52 | |
53 | 53 | <?php |
54 | - } else { |
|
55 | - wp_redirect( $redirect ); |
|
56 | - exit; |
|
57 | - } |
|
58 | - ?> |
|
54 | + } else { |
|
55 | + wp_redirect( $redirect ); |
|
56 | + exit; |
|
57 | + } |
|
58 | + ?> |
|
59 | 59 | |
60 | 60 | <?php lsx_content_after(); ?> |
61 | 61 |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | <?php lsx_content_wrap_before(); ?> |
11 | 11 | |
12 | 12 | <?php |
13 | - $page_id = get_the_ID(); |
|
14 | - $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id; |
|
13 | + $page_id = get_the_ID(); |
|
14 | + $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id; |
|
15 | 15 | ?> |
16 | 16 | |
17 | 17 | <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | |
21 | 21 | <!-- Begining restricted content --> |
22 | 22 | <?php |
23 | - if ( current_user_can( 'administrator', $page_id ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) { |
|
24 | - ?> |
|
23 | + if ( current_user_can( 'administrator', $page_id ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) { |
|
24 | + ?> |
|
25 | 25 | <main id="main" role="main"> |
26 | 26 | |
27 | 27 | <?php lsx_content_top(); ?> |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | <div class="row"> |
31 | 31 | <?php if ( have_posts() ) : ?> |
32 | 32 | <?php |
33 | - while ( have_posts() ) : |
|
34 | - the_post(); |
|
35 | - ?> |
|
33 | + while ( have_posts() ) : |
|
34 | + the_post(); |
|
35 | + ?> |
|
36 | 36 | |
37 | 37 | <?php include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-exercise.php'; ?> |
38 | 38 | |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | </main><!-- #main --> |
52 | 52 | |
53 | 53 | <?php |
54 | - } else { |
|
55 | - wp_redirect( $redirect ); |
|
56 | - exit; |
|
57 | - } |
|
58 | - ?> |
|
54 | + } else { |
|
55 | + wp_redirect( $redirect ); |
|
56 | + exit; |
|
57 | + } |
|
58 | + ?> |
|
59 | 59 | |
60 | 60 | <?php lsx_content_after(); ?> |
61 | 61 |
@@ -26,24 +26,24 @@ discard block |
||
26 | 26 | |
27 | 27 | <div class="entry-content"> |
28 | 28 | <?php |
29 | - wp_link_pages( |
|
30 | - 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 | - ?> |
|
29 | + wp_link_pages( |
|
30 | + 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 | + ?> |
|
38 | 38 | <div class="single-plan-inner workout-content"> |
39 | 39 | <?php |
40 | - if ( is_singular( 'workout' ) ) { ?> |
|
40 | + if ( is_singular( 'workout' ) ) { ?> |
|
41 | 41 | <div class="single-plan-section-title workout title-lined"> |
42 | 42 | <?php lsx_get_svg_icon( 'work.svg' ); ?> |
43 | 43 | <h2><?php the_title(); ?></h2> |
44 | 44 | <?php if ( class_exists( 'LSX_Sharing' ) ) { |
45 | - lsx_content_sharing(); |
|
46 | - } ?> |
|
45 | + lsx_content_sharing(); |
|
46 | + } ?> |
|
47 | 47 | </div> |
48 | 48 | <?php } else { ?> |
49 | 49 | <div class="single-plan-section-title workout title-lined"> |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | </div> |
53 | 53 | <?php } ?> |
54 | 54 | <?php |
55 | - if ( lsx_health_plan_has_warmup() && ( ! is_singular( 'workout' ) ) ) { |
|
56 | - ?> |
|
55 | + if ( lsx_health_plan_has_warmup() && ( ! is_singular( 'workout' ) ) ) { |
|
56 | + ?> |
|
57 | 57 | <div class="workout-instructions"> |
58 | 58 | <div class="row"> |
59 | 59 | <div class="col-md-12"> |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | </div> |
66 | 66 | </div> |
67 | 67 | <?php |
68 | - } |
|
69 | - ?> |
|
68 | + } |
|
69 | + ?> |
|
70 | 70 | |
71 | 71 | <?php lsx_health_plan_workout_sets(); ?> |
72 | 72 | </div> |
@@ -82,5 +82,5 @@ discard block |
||
82 | 82 | <?php } ?> |
83 | 83 | <?php |
84 | 84 | if ( ! empty( $connected_articles ) ) { |
85 | - lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) ); |
|
85 | + lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) ); |
|
86 | 86 | } |
@@ -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 | } |
@@ -8,10 +8,10 @@ discard block |
||
8 | 8 | |
9 | 9 | $warm_up = get_post_meta( get_the_ID(), 'plan_warmup', true ); |
10 | 10 | if ( false === $warm_up || '' === $warm_up ) { |
11 | - $options = \lsx_health_plan\functions\get_option( 'all' ); |
|
12 | - if ( isset( $options['plan_warmup'] ) && '' !== $options['plan_warmup'] && ! empty( $options['plan_warmup'] ) ) { |
|
13 | - $warm_up = $options['plan_warmup']; |
|
14 | - } |
|
11 | + $options = \lsx_health_plan\functions\get_option( 'all' ); |
|
12 | + if ( isset( $options['plan_warmup'] ) && '' !== $options['plan_warmup'] && ! empty( $options['plan_warmup'] ) ) { |
|
13 | + $warm_up = $options['plan_warmup']; |
|
14 | + } |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | ?> |
@@ -19,25 +19,25 @@ discard block |
||
19 | 19 | <?php |
20 | 20 | |
21 | 21 | if ( false !== $warm_up && '' !== $warm_up ) { |
22 | - if ( ! is_array( $warm_up ) ) { |
|
23 | - $warm_up = array( $warm_up ); |
|
24 | - } |
|
22 | + if ( ! is_array( $warm_up ) ) { |
|
23 | + $warm_up = array( $warm_up ); |
|
24 | + } |
|
25 | 25 | |
26 | - $warmup_type = array( 'page', 'workout', 'exercise' ); |
|
27 | - $warmup_query = new WP_Query( |
|
28 | - array( |
|
29 | - 'post__in' => $warm_up, |
|
30 | - 'post_type' => $warmup_type, |
|
31 | - ) |
|
32 | - ); |
|
26 | + $warmup_type = array( 'page', 'workout', 'exercise' ); |
|
27 | + $warmup_query = new WP_Query( |
|
28 | + array( |
|
29 | + 'post__in' => $warm_up, |
|
30 | + 'post_type' => $warmup_type, |
|
31 | + ) |
|
32 | + ); |
|
33 | 33 | |
34 | - if ( $warmup_query->have_posts() ) { |
|
35 | - while ( $warmup_query->have_posts() ) { |
|
36 | - $warmup_query->the_post(); |
|
37 | - lsx_entry_before(); |
|
38 | - if ( 'workout' === get_post_type() ) { |
|
39 | - $connected_workouts = array( get_the_ID() ); |
|
40 | - ?> |
|
34 | + if ( $warmup_query->have_posts() ) { |
|
35 | + while ( $warmup_query->have_posts() ) { |
|
36 | + $warmup_query->the_post(); |
|
37 | + lsx_entry_before(); |
|
38 | + if ( 'workout' === get_post_type() ) { |
|
39 | + $connected_workouts = array( get_the_ID() ); |
|
40 | + ?> |
|
41 | 41 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
42 | 42 | <?php lsx_entry_top(); ?> |
43 | 43 | <div class="entry-content"> |
@@ -47,14 +47,14 @@ discard block |
||
47 | 47 | <h2><?php esc_html_e( 'Warm Up', 'lsx-health-plan' ); ?></h2> |
48 | 48 | </div> |
49 | 49 | <?php |
50 | - the_content(); |
|
51 | - wp_link_pages( array( |
|
52 | - 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
|
53 | - 'after' => '</div></div>', |
|
54 | - 'link_before' => '<span>', |
|
55 | - 'link_after' => '</span>', |
|
56 | - ) ); |
|
57 | - ?> |
|
50 | + the_content(); |
|
51 | + wp_link_pages( array( |
|
52 | + 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
|
53 | + 'after' => '</div></div>', |
|
54 | + 'link_before' => '<span>', |
|
55 | + 'link_after' => '</span>', |
|
56 | + ) ); |
|
57 | + ?> |
|
58 | 58 | </div> |
59 | 59 | </div><!-- .entry-content --> |
60 | 60 | <?php lsx_entry_bottom(); ?> |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | <?php } ?> |
70 | 70 | </article><!-- #post-## --> |
71 | 71 | <?php |
72 | - lsx_health_plan_workout_sets(); |
|
73 | - } else { |
|
74 | - ?> |
|
72 | + lsx_health_plan_workout_sets(); |
|
73 | + } else { |
|
74 | + ?> |
|
75 | 75 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
76 | 76 | <?php lsx_entry_top(); ?> |
77 | 77 | <div class="entry-content"> |
@@ -81,24 +81,24 @@ discard block |
||
81 | 81 | <h2><?php esc_html_e( 'Warm Up', 'lsx-health-plan' ); ?></h2> |
82 | 82 | </div> |
83 | 83 | <?php |
84 | - the_content(); |
|
85 | - wp_link_pages( array( |
|
86 | - 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
|
87 | - 'after' => '</div></div>', |
|
88 | - 'link_before' => '<span>', |
|
89 | - 'link_after' => '</span>', |
|
90 | - ) ); |
|
91 | - ?> |
|
84 | + the_content(); |
|
85 | + wp_link_pages( array( |
|
86 | + 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
|
87 | + 'after' => '</div></div>', |
|
88 | + 'link_before' => '<span>', |
|
89 | + 'link_after' => '</span>', |
|
90 | + ) ); |
|
91 | + ?> |
|
92 | 92 | </div> |
93 | 93 | </div><!-- .entry-content --> |
94 | 94 | <?php lsx_entry_bottom(); ?> |
95 | 95 | </article><!-- #post-## --> |
96 | 96 | <?php |
97 | - } |
|
97 | + } |
|
98 | 98 | |
99 | - } |
|
100 | - wp_reset_postdata(); |
|
101 | - } |
|
99 | + } |
|
100 | + wp_reset_postdata(); |
|
101 | + } |
|
102 | 102 | } |
103 | 103 | ?> |
104 | 104 | </div> |
@@ -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 --> |