@@ -8,9 +8,9 @@ discard block |
||
8 | 8 | global $shortcode_args; |
9 | 9 | |
10 | 10 | // Getting translated endpoint. |
11 | -$workout = \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ); |
|
11 | +$workout = \lsx_health_plan\functions\get_option('endpoint_workout', 'workout'); |
|
12 | 12 | |
13 | -$connected_articles = get_post_meta( get_the_ID(), ( $workout . '_connected_articles' ), true ); |
|
13 | +$connected_articles = get_post_meta(get_the_ID(), ($workout . '_connected_articles'), true); |
|
14 | 14 | |
15 | 15 | ?> |
16 | 16 | |
@@ -36,26 +36,26 @@ discard block |
||
36 | 36 | ?> |
37 | 37 | <div class="single-plan-inner workout-content"> |
38 | 38 | <?php |
39 | - if ( is_singular( 'workout' ) ) { ?> |
|
39 | + if (is_singular('workout')) { ?> |
|
40 | 40 | <div class="single-plan-section-title workout title-lined"> |
41 | - <?php lsx_get_svg_icon( 'work.svg' ); ?> |
|
41 | + <?php lsx_get_svg_icon('work.svg'); ?> |
|
42 | 42 | <h2><?php the_title(); ?></h2> |
43 | 43 | </div> |
44 | 44 | <?php } else { ?> |
45 | 45 | <div class="single-plan-section-title workout title-lined"> |
46 | - <?php lsx_get_svg_icon( 'work.svg' ); ?> |
|
47 | - <h2><?php esc_html_e( 'My Workout', 'lsx-health-plan' ); ?></h2> |
|
46 | + <?php lsx_get_svg_icon('work.svg'); ?> |
|
47 | + <h2><?php esc_html_e('My Workout', 'lsx-health-plan'); ?></h2> |
|
48 | 48 | </div> |
49 | 49 | <?php } ?> |
50 | 50 | <?php |
51 | - if ( lsx_health_plan_has_warmup() && ( ! is_singular( 'workout' ) ) ) { |
|
51 | + if (lsx_health_plan_has_warmup() && ( ! is_singular('workout'))) { |
|
52 | 52 | ?> |
53 | 53 | <div class="workout-instructions"> |
54 | 54 | <div class="row"> |
55 | 55 | <div class="col-md-12"> |
56 | 56 | <div class="content-intro"> |
57 | - <h3><?php esc_html_e( "Don't forget your warm up!", 'lsx-health-plan' ); ?></h3> |
|
58 | - <p><?php esc_html_e( 'Be sure to do the warm-up before every workout session.', 'lsx-health-plan' ); ?></p> |
|
57 | + <h3><?php esc_html_e("Don't forget your warm up!", 'lsx-health-plan'); ?></h3> |
|
58 | + <p><?php esc_html_e('Be sure to do the warm-up before every workout session.', 'lsx-health-plan'); ?></p> |
|
59 | 59 | </div> |
60 | 60 | </div> |
61 | 61 | </div> |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | </article><!-- #post-## --> |
74 | 74 | |
75 | 75 | <?php |
76 | -if ( ! empty( $connected_articles ) ) { |
|
77 | - lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) ); |
|
76 | +if ( ! empty($connected_articles)) { |
|
77 | + lsx_hp_single_related($connected_articles, __('Related articles', 'lsx-health-plan')); |
|
78 | 78 | } |
79 | 79 | ?> |
80 | 80 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | <?php lsx_content_wrap_before(); ?> |
11 | 11 | |
12 | -<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
12 | +<div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
13 | 13 | |
14 | 14 | <?php lsx_content_before(); ?> |
15 | 15 | |
@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | |
21 | 21 | <div class="post-wrapper plan-archive-plan archive-plan"> |
22 | 22 | <div class="row lsx-plan-row"> |
23 | - <?php if ( have_posts() ) : ?> |
|
23 | + <?php if (have_posts()) : ?> |
|
24 | 24 | <?php |
25 | 25 | |
26 | 26 | $count = 0; |
27 | 27 | |
28 | - while ( have_posts() ) : |
|
28 | + while (have_posts()) : |
|
29 | 29 | the_post(); |
30 | 30 | ?> |
31 | 31 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | <?php else : ?> |
37 | 37 | |
38 | - <?php get_template_part( 'partials/content', 'none' ); ?> |
|
38 | + <?php get_template_part('partials/content', 'none'); ?> |
|
39 | 39 | |
40 | 40 | <?php endif; ?> |
41 | 41 | </div> |
@@ -33,9 +33,12 @@ |
||
33 | 33 | |
34 | 34 | <?php endwhile; ?> |
35 | 35 | |
36 | - <?php else : ?> |
|
36 | + <?php else { |
|
37 | + : ?> |
|
37 | 38 | |
38 | - <?php get_template_part( 'partials/content', 'none' ); ?> |
|
39 | + <?php get_template_part( 'partials/content', 'none' ); |
|
40 | +} |
|
41 | +?> |
|
39 | 42 | |
40 | 43 | <?php endif; ?> |
41 | 44 | </div> |
@@ -19,41 +19,41 @@ discard block |
||
19 | 19 | <?php |
20 | 20 | //the_content(); |
21 | 21 | |
22 | - wp_link_pages( array( |
|
22 | + wp_link_pages(array( |
|
23 | 23 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
24 | 24 | 'after' => '</div></div>', |
25 | 25 | 'link_before' => '<span>', |
26 | 26 | 'link_after' => '</span>', |
27 | - ) ); |
|
27 | + )); |
|
28 | 28 | ?> |
29 | 29 | <div class="single-plan-inner recipes-content"> |
30 | 30 | <div class="single-plan-section-title recipes-plan title-lined"> |
31 | - <?php lsx_get_svg_icon( 'recipes.svg' ); ?> |
|
32 | - <h2><?php esc_html_e( 'Recipes', 'lsx-health-plan' ); ?> <span class="blue-title"><?php the_title(); ?></span></h2> |
|
31 | + <?php lsx_get_svg_icon('recipes.svg'); ?> |
|
32 | + <h2><?php esc_html_e('Recipes', 'lsx-health-plan'); ?> <span class="blue-title"><?php the_title(); ?></span></h2> |
|
33 | 33 | </div> |
34 | 34 | <div class="recipes"> |
35 | 35 | <div class="row eating-row"> |
36 | 36 | <?php |
37 | - $connected_recipes = get_post_meta( get_the_ID(), 'connected_recipes', true ); |
|
38 | - if ( empty( $connected_recipes ) ) { |
|
39 | - $options = \lsx_health_plan\functions\get_option( 'all' ); |
|
40 | - if ( isset( $options['connected_recipes'] ) && '' !== $options['connected_recipes'] && ! empty( $options['connected_recipes'] ) ) { |
|
37 | + $connected_recipes = get_post_meta(get_the_ID(), 'connected_recipes', true); |
|
38 | + if (empty($connected_recipes)) { |
|
39 | + $options = \lsx_health_plan\functions\get_option('all'); |
|
40 | + if (isset($options['connected_recipes']) && '' !== $options['connected_recipes'] && ! empty($options['connected_recipes'])) { |
|
41 | 41 | $connected_recipes = $options['connected_recipes']; |
42 | - if ( ! array( $connected_recipes ) ) { |
|
43 | - $connected_recipes = array( $connected_recipes ); |
|
42 | + if ( ! array($connected_recipes)) { |
|
43 | + $connected_recipes = array($connected_recipes); |
|
44 | 44 | } |
45 | 45 | } |
46 | 46 | } |
47 | - $args = array( |
|
47 | + $args = array( |
|
48 | 48 | 'orderby' => 'date', |
49 | 49 | 'order' => 'DESC', |
50 | 50 | 'post_type' => 'recipe', |
51 | 51 | 'post__in' => $connected_recipes, |
52 | 52 | ); |
53 | - $recipes = new WP_Query( $args ); |
|
53 | + $recipes = new WP_Query($args); |
|
54 | 54 | |
55 | - if ( $recipes->have_posts() ) { |
|
56 | - while ( $recipes->have_posts() ) { |
|
55 | + if ($recipes->have_posts()) { |
|
56 | + while ($recipes->have_posts()) { |
|
57 | 57 | $recipes->the_post(); |
58 | 58 | $post_id = get_the_id(); |
59 | 59 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | <div class="content-box box-shadow"> |
63 | 63 | <h3 class="recipe-title title-lined"><?php the_title(); ?></h3> |
64 | 64 | <?php lsx_health_plan_recipe_data(); ?> |
65 | - <a href="<?php echo esc_url( get_permalink() ); ?>" class="btn btn-full"><?php esc_html_e( 'View Recipe', 'lsx-health-plan' ); ?></a> |
|
65 | + <a href="<?php echo esc_url(get_permalink()); ?>" class="btn btn-full"><?php esc_html_e('View Recipe', 'lsx-health-plan'); ?></a> |
|
66 | 66 | </div> |
67 | 67 | </div> |
68 | 68 | <?php |
@@ -12,31 +12,31 @@ discard block |
||
12 | 12 | <?php |
13 | 13 | $column_class = '4'; |
14 | 14 | // Check for shortcode overrides. |
15 | -if ( null !== $shortcode_args ) { |
|
16 | - if ( isset( $shortcode_args['columns'] ) ) { |
|
15 | +if (null !== $shortcode_args) { |
|
16 | + if (isset($shortcode_args['columns'])) { |
|
17 | 17 | $column_class = $shortcode_args['columns']; |
18 | - $column_class = \lsx_health_plan\functions\column_class( $column_class ); |
|
18 | + $column_class = \lsx_health_plan\functions\column_class($column_class); |
|
19 | 19 | } |
20 | 20 | } |
21 | 21 | ?> |
22 | 22 | |
23 | -<div class="col-xs-12 col-sm-6 col-md-<?php echo esc_attr( $column_class ); ?>"> |
|
23 | +<div class="col-xs-12 col-sm-6 col-md-<?php echo esc_attr($column_class); ?>"> |
|
24 | 24 | <article class="lsx-slot box-shadow"> |
25 | 25 | <?php lsx_entry_top(); ?> |
26 | 26 | |
27 | 27 | <?php lsx_hp_recipe_plan_meta(); ?> |
28 | 28 | |
29 | 29 | <div class="recipe-feature-img"> |
30 | - <a href="<?php echo esc_url( get_permalink() ); ?>"> |
|
30 | + <a href="<?php echo esc_url(get_permalink()); ?>"> |
|
31 | 31 | <?php |
32 | 32 | $featured_image = get_the_post_thumbnail(); |
33 | - if ( ! empty( $featured_image ) && '' !== $featured_image ) { |
|
34 | - the_post_thumbnail( 'lsx-thumbnail-square', array( |
|
33 | + if ( ! empty($featured_image) && '' !== $featured_image) { |
|
34 | + the_post_thumbnail('lsx-thumbnail-square', array( |
|
35 | 35 | 'class' => 'aligncenter', |
36 | - ) ); |
|
36 | + )); |
|
37 | 37 | } else { |
38 | 38 | ?> |
39 | - <img loading="lazy" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>"> |
|
39 | + <img loading="lazy" src="<?php echo esc_attr(plugin_dir_url(__FILE__) . '../assets/images/placeholder.jpg'); ?>"> |
|
40 | 40 | <?php |
41 | 41 | } |
42 | 42 | ?> |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | <div class="content-box white-bg"> |
46 | 46 | <?php lsx_health_plan_recipe_data(); ?> |
47 | 47 | <h3 class="recipe-title"><?php the_title(); ?></h3> |
48 | - <a href="<?php echo esc_url( get_permalink() ); ?>" class="btn border-btn"><?php esc_html_e( 'View Recipe', 'lsx-health-plan' ); ?></a> |
|
48 | + <a href="<?php echo esc_url(get_permalink()); ?>" class="btn border-btn"><?php esc_html_e('View Recipe', 'lsx-health-plan'); ?></a> |
|
49 | 49 | </div> |
50 | 50 | <?php lsx_entry_bottom(); ?> |
51 | 51 | </article> |
@@ -10,13 +10,13 @@ discard block |
||
10 | 10 | $muscle_group = lsx_health_plan_muscle_group_equipment(); |
11 | 11 | |
12 | 12 | // Getting translated endpoint. |
13 | -$exercise = \lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ); |
|
13 | +$exercise = \lsx_health_plan\functions\get_option('endpoint_exercise_single', 'exercise'); |
|
14 | 14 | |
15 | -$connected_members = get_post_meta( get_the_ID(), ( $exercise . '_connected_team_member' ), true ); |
|
16 | -$connected_articles = get_post_meta( get_the_ID(), ( $exercise . '_connected_articles' ), true ); |
|
15 | +$connected_members = get_post_meta(get_the_ID(), ($exercise . '_connected_team_member'), true); |
|
16 | +$connected_articles = get_post_meta(get_the_ID(), ($exercise . '_connected_articles'), true); |
|
17 | 17 | |
18 | 18 | $sharing = 'sharing-disabled'; |
19 | -if ( class_exists( 'LSX_Sharing' ) || ( function_exists( 'sharing_display' ) || class_exists( 'Jetpack_Likes' ) ) ) : |
|
19 | +if (class_exists('LSX_Sharing') || (function_exists('sharing_display') || class_exists('Jetpack_Likes'))) : |
|
20 | 20 | $sharing = 'sharing-enabled'; |
21 | 21 | endif; |
22 | 22 | |
@@ -34,51 +34,51 @@ discard block |
||
34 | 34 | |
35 | 35 | <div id="single-exercise" class="entry-content"> |
36 | 36 | |
37 | - <div class="exercise-title-section title-lined <?php echo esc_html( $sharing ); ?>"> |
|
38 | - <?php if ( class_exists( 'LSX_Sharing' ) || ( function_exists( 'sharing_display' ) || class_exists( 'Jetpack_Likes' ) ) ) : ?> |
|
37 | + <div class="exercise-title-section title-lined <?php echo esc_html($sharing); ?>"> |
|
38 | + <?php if (class_exists('LSX_Sharing') || (function_exists('sharing_display') || class_exists('Jetpack_Likes'))) : ?> |
|
39 | 39 | |
40 | 40 | <?php |
41 | - if ( class_exists( 'LSX_Sharing' ) ) { |
|
41 | + if (class_exists('LSX_Sharing')) { |
|
42 | 42 | lsx_content_sharing(); |
43 | 43 | } else { |
44 | - if ( function_exists( 'sharing_display' ) ) { |
|
45 | - sharing_display( '', true ); |
|
44 | + if (function_exists('sharing_display')) { |
|
45 | + sharing_display('', true); |
|
46 | 46 | } |
47 | 47 | |
48 | - if ( class_exists( 'Jetpack_Likes' ) ) { |
|
48 | + if (class_exists('Jetpack_Likes')) { |
|
49 | 49 | $custom_likes = new Jetpack_Likes(); |
50 | - echo wp_kses_post( $custom_likes->post_likes( '' ) ); |
|
50 | + echo wp_kses_post($custom_likes->post_likes('')); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | ?> |
54 | 54 | <?php endif ?> |
55 | 55 | |
56 | - <?php lsx_health_plan_exercise_title( '<h2>', '</h2>' ); ?> |
|
56 | + <?php lsx_health_plan_exercise_title('<h2>', '</h2>'); ?> |
|
57 | 57 | </div> |
58 | - <?php echo wp_kses_post( lsx_hp_member_connected( $connected_members, 'exercise' ) ); ?> |
|
58 | + <?php echo wp_kses_post(lsx_hp_member_connected($connected_members, 'exercise')); ?> |
|
59 | 59 | <div class="row"> |
60 | 60 | <div class="col-md-6 exercise-image lsx-hp-shadow"> |
61 | 61 | |
62 | 62 | <?php |
63 | 63 | $lsx_hp = lsx_health_plan(); |
64 | 64 | |
65 | - if ( $lsx_hp->frontend->gallery->has_gallery( get_the_ID() ) ) { |
|
65 | + if ($lsx_hp->frontend->gallery->has_gallery(get_the_ID())) { |
|
66 | 66 | lsx_health_plan_gallery(); |
67 | 67 | } else { |
68 | 68 | $featured_image = get_the_post_thumbnail(); |
69 | - if ( ! empty( $featured_image ) && '' !== $featured_image ) { |
|
70 | - the_post_thumbnail( 'large', array( |
|
69 | + if ( ! empty($featured_image) && '' !== $featured_image) { |
|
70 | + the_post_thumbnail('large', array( |
|
71 | 71 | 'class' => 'aligncenter', |
72 | - ) ); |
|
72 | + )); |
|
73 | 73 | } else { |
74 | 74 | ?> |
75 | - <img loading="lazy" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>"> |
|
75 | + <img loading="lazy" src="<?php echo esc_attr(plugin_dir_url(__FILE__) . '../assets/images/placeholder.jpg'); ?>"> |
|
76 | 76 | <?php |
77 | 77 | } |
78 | 78 | } |
79 | 79 | ?> |
80 | 80 | |
81 | - <?php if ( ( ! empty( $exercise_type ) ) || ( ! empty( $equipment ) ) || ( ! empty( $muscle_group ) ) ) { ?> |
|
81 | + <?php if (( ! empty($exercise_type)) || ( ! empty($equipment)) || ( ! empty($muscle_group))) { ?> |
|
82 | 82 | <div class="exercise-data"> |
83 | 83 | <?php lsx_health_plan_exercise_data(); ?> |
84 | 84 | </div> |
@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | </div> |
87 | 87 | <div class="col-md-6 exercise-content"> |
88 | 88 | <?php the_content(); ?> |
89 | - <?php echo do_shortcode( '[lsx_health_plan_featured_tips_block]' ); ?> |
|
89 | + <?php echo do_shortcode('[lsx_health_plan_featured_tips_block]'); ?> |
|
90 | 90 | <div class="back-plan-btn"> |
91 | 91 | <?php |
92 | - if ( function_exists( 'wc_get_page_id' ) ) { |
|
92 | + if (function_exists('wc_get_page_id')) { |
|
93 | 93 | ?> |
94 | - <a class="btn" href="<?php echo wp_kses_post( get_permalink( wc_get_page_id( 'myaccount' ) ) ); ?>"><?php esc_html_e( 'Smashed it! Back to my exercises', 'lsx-health-plan' ); ?></a> |
|
94 | + <a class="btn" href="<?php echo wp_kses_post(get_permalink(wc_get_page_id('myaccount'))); ?>"><?php esc_html_e('Smashed it! Back to my exercises', 'lsx-health-plan'); ?></a> |
|
95 | 95 | <?php |
96 | 96 | } |
97 | 97 | ?> |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | </article><!-- #post-## --> |
106 | 106 | |
107 | 107 | <?php |
108 | -if ( ! empty( $connected_articles ) ) { |
|
109 | - lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) ); |
|
108 | +if ( ! empty($connected_articles)) { |
|
109 | + lsx_hp_single_related($connected_articles, __('Related articles', 'lsx-health-plan')); |
|
110 | 110 | } |
111 | 111 | ?> |
112 | 112 |
@@ -6,16 +6,16 @@ discard block |
||
6 | 6 | */ |
7 | 7 | global $shortcode_args; |
8 | 8 | |
9 | -$this_post_type = get_post_type( get_the_ID() ); |
|
9 | +$this_post_type = get_post_type(get_the_ID()); |
|
10 | 10 | |
11 | -$connected_tips = get_post_meta( get_the_ID(), ( $this_post_type . '_connected_tips' ), true ); |
|
11 | +$connected_tips = get_post_meta(get_the_ID(), ($this_post_type . '_connected_tips'), true); |
|
12 | 12 | |
13 | 13 | // Check for any shortcode overrides. |
14 | -if ( null !== $shortcode_args && isset( $shortcode_args['include'] ) ) { |
|
15 | - $connected_tips = array( get_the_ID() ); |
|
14 | +if (null !== $shortcode_args && isset($shortcode_args['include'])) { |
|
15 | + $connected_tips = array(get_the_ID()); |
|
16 | 16 | } |
17 | 17 | |
18 | -if ( ! empty( $connected_tips ) ) { |
|
18 | +if ( ! empty($connected_tips)) { |
|
19 | 19 | $args = array( |
20 | 20 | 'orderby' => 'date', |
21 | 21 | 'order' => 'ASC', |
@@ -25,15 +25,15 @@ discard block |
||
25 | 25 | ); |
26 | 26 | } |
27 | 27 | |
28 | -if ( ! empty( $args ) ) { |
|
29 | - $tips = new WP_Query( $args ); |
|
28 | +if ( ! empty($args)) { |
|
29 | + $tips = new WP_Query($args); |
|
30 | 30 | |
31 | 31 | ?> |
32 | 32 | <div id="lsx-tips-shortcode" class="daily-plan-block"> |
33 | 33 | <div class="lsx-tips-shortcode lsx-tips-slider slick-slider slick-dotted" > |
34 | 34 | <?php |
35 | - if ( $tips->have_posts() ) { |
|
36 | - while ( $tips->have_posts() ) { |
|
35 | + if ($tips->have_posts()) { |
|
36 | + while ($tips->have_posts()) { |
|
37 | 37 | $tips->the_post(); |
38 | 38 | include LSX_HEALTH_PLAN_PATH . 'templates/content-archive-tip.php'; |
39 | 39 | } |
@@ -6,10 +6,10 @@ discard block |
||
6 | 6 | */ |
7 | 7 | global $group_name, $connected_workouts, $shortcode_args; |
8 | 8 | |
9 | -$warm_up = get_post_meta( get_the_ID(), 'plan_warmup', true ); |
|
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'] ) ) { |
|
9 | +$warm_up = get_post_meta(get_the_ID(), 'plan_warmup', true); |
|
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 | 13 | $warm_up = $options['plan_warmup']; |
14 | 14 | } |
15 | 15 | } |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | <div class="warmup-container"> |
19 | 19 | <?php |
20 | 20 | |
21 | -if ( false !== $warm_up && '' !== $warm_up ) { |
|
22 | - if ( ! is_array( $warm_up ) ) { |
|
23 | - $warm_up = array( $warm_up ); |
|
21 | +if (false !== $warm_up && '' !== $warm_up) { |
|
22 | + if ( ! is_array($warm_up)) { |
|
23 | + $warm_up = array($warm_up); |
|
24 | 24 | } |
25 | 25 | |
26 | - $warmup_type = array( 'page', 'workout', 'exercise' ); |
|
26 | + $warmup_type = array('page', 'workout', 'exercise'); |
|
27 | 27 | $warmup_query = new WP_Query( |
28 | 28 | array( |
29 | 29 | 'post__in' => $warm_up, |
@@ -31,38 +31,38 @@ discard block |
||
31 | 31 | ) |
32 | 32 | ); |
33 | 33 | |
34 | - if ( $warmup_query->have_posts() ) { |
|
35 | - while ( $warmup_query->have_posts() ) { |
|
34 | + if ($warmup_query->have_posts()) { |
|
35 | + while ($warmup_query->have_posts()) { |
|
36 | 36 | $warmup_query->the_post(); |
37 | 37 | lsx_entry_before(); |
38 | - if ( 'workout' === get_post_type() ) { |
|
39 | - $connected_workouts = array( get_the_ID() ); |
|
38 | + if ('workout' === get_post_type()) { |
|
39 | + $connected_workouts = array(get_the_ID()); |
|
40 | 40 | ?> |
41 | 41 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
42 | 42 | <?php lsx_entry_top(); ?> |
43 | 43 | <div class="entry-content"> |
44 | 44 | <div class="single-plan-inner warmup-content"> |
45 | 45 | <div class="single-plan-section-title warmup-plan title-lined"> |
46 | - <?php lsx_get_svg_icon( 'warm.svg' ); ?> |
|
47 | - <h2><?php esc_html_e( 'Warm Up', 'lsx-health-plan' ); ?></h2> |
|
46 | + <?php lsx_get_svg_icon('warm.svg'); ?> |
|
47 | + <h2><?php esc_html_e('Warm Up', 'lsx-health-plan'); ?></h2> |
|
48 | 48 | </div> |
49 | 49 | <?php |
50 | 50 | the_content(); |
51 | - wp_link_pages( array( |
|
51 | + wp_link_pages(array( |
|
52 | 52 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
53 | 53 | 'after' => '</div></div>', |
54 | 54 | 'link_before' => '<span>', |
55 | 55 | 'link_after' => '</span>', |
56 | - ) ); |
|
56 | + )); |
|
57 | 57 | ?> |
58 | 58 | </div> |
59 | 59 | </div><!-- .entry-content --> |
60 | 60 | <?php lsx_entry_bottom(); ?> |
61 | - <?php if ( null === $shortcode_args ) { ?> |
|
61 | + <?php if (null === $shortcode_args) { ?> |
|
62 | 62 | <div class="tip-row extras-box"> |
63 | - <?php if ( post_type_exists( 'tip' ) && lsx_health_plan_has_tips() ) { ?> |
|
63 | + <?php if (post_type_exists('tip') && lsx_health_plan_has_tips()) { ?> |
|
64 | 64 | <div class="tip-right"> |
65 | - <?php echo do_shortcode( '[lsx_health_plan_featured_tips_block tab="warm-up"]' ); ?> |
|
65 | + <?php echo do_shortcode('[lsx_health_plan_featured_tips_block tab="warm-up"]'); ?> |
|
66 | 66 | </div> |
67 | 67 | <?php } ?> |
68 | 68 | </div> |
@@ -77,17 +77,17 @@ discard block |
||
77 | 77 | <div class="entry-content"> |
78 | 78 | <div class="single-plan-inner warmup-content"> |
79 | 79 | <div class="single-plan-section-title warmup-plan title-lined"> |
80 | - <?php lsx_get_svg_icon( 'warm.svg' ); ?> |
|
81 | - <h2><?php esc_html_e( 'Warm Up', 'lsx-health-plan' ); ?></h2> |
|
80 | + <?php lsx_get_svg_icon('warm.svg'); ?> |
|
81 | + <h2><?php esc_html_e('Warm Up', 'lsx-health-plan'); ?></h2> |
|
82 | 82 | </div> |
83 | 83 | <?php |
84 | 84 | the_content(); |
85 | - wp_link_pages( array( |
|
85 | + wp_link_pages(array( |
|
86 | 86 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
87 | 87 | 'after' => '</div></div>', |
88 | 88 | 'link_before' => '<span>', |
89 | 89 | 'link_after' => '</span>', |
90 | - ) ); |
|
90 | + )); |
|
91 | 91 | ?> |
92 | 92 | </div> |
93 | 93 | </div><!-- .entry-content --> |
@@ -37,14 +37,14 @@ discard block |
||
37 | 37 | * Contructor |
38 | 38 | */ |
39 | 39 | public function __construct() { |
40 | - add_filter( 'cmb2_enqueue_css', array( $this, 'disable_cmb2_styles' ), 1, 1 ); |
|
41 | - add_action( 'cmb2_before_form', array( $this, 'generate_navigation' ), 10, 4 ); |
|
42 | - add_action( 'cmb2_before_title_field_row', array( $this, 'output_tab_open_div' ), 10, 1 ); |
|
43 | - add_action( 'cmb2_after_tab_closing_field_row', array( $this, 'output_tab_closing_div' ), 10, 1 ); |
|
44 | - add_action( 'cmb2_render_tab_closing', array( $this, 'cmb2_render_callback_for_tab_closing' ), 10, 5 ); |
|
45 | - add_filter( 'cmb2_sanitize_tab_closing', array( $this, 'cmb2_sanitize_tab_closing_callback' ), 10, 2 ); |
|
46 | - add_action( 'cmb2_after_form', array( $this, 'navigation_js' ), 10, 4 ); |
|
47 | - add_filter( 'cmb2_options_page_redirect_url', array( $this, 'add_tab_argument' ), 10, 1 ); |
|
40 | + add_filter('cmb2_enqueue_css', array($this, 'disable_cmb2_styles'), 1, 1); |
|
41 | + add_action('cmb2_before_form', array($this, 'generate_navigation'), 10, 4); |
|
42 | + add_action('cmb2_before_title_field_row', array($this, 'output_tab_open_div'), 10, 1); |
|
43 | + add_action('cmb2_after_tab_closing_field_row', array($this, 'output_tab_closing_div'), 10, 1); |
|
44 | + add_action('cmb2_render_tab_closing', array($this, 'cmb2_render_callback_for_tab_closing'), 10, 5); |
|
45 | + add_filter('cmb2_sanitize_tab_closing', array($this, 'cmb2_sanitize_tab_closing_callback'), 10, 2); |
|
46 | + add_action('cmb2_after_form', array($this, 'navigation_js'), 10, 4); |
|
47 | + add_filter('cmb2_options_page_redirect_url', array($this, 'add_tab_argument'), 10, 1); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public static function get_instance() { |
58 | 58 | // If the single instance hasn't been set, set it now. |
59 | - if ( null == self::$instance ) { |
|
59 | + if (null == self::$instance) { |
|
60 | 60 | self::$instance = new self(); |
61 | 61 | } |
62 | 62 | return self::$instance; |
@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | * |
68 | 68 | * @return bool $enabled Whether to enable (enqueue) styles. |
69 | 69 | */ |
70 | - public function disable_cmb2_styles( $enabled ) { |
|
71 | - if ( is_admin() ) { |
|
70 | + public function disable_cmb2_styles($enabled) { |
|
71 | + if (is_admin()) { |
|
72 | 72 | $current_screen = get_current_screen(); |
73 | - if ( is_object( $current_screen ) && 'plan_page_lsx_videos_options' === $current_screen->id ) { |
|
73 | + if (is_object($current_screen) && 'plan_page_lsx_videos_options' === $current_screen->id) { |
|
74 | 74 | $enabled = false; |
75 | 75 | } |
76 | 76 | } |
@@ -86,14 +86,14 @@ discard block |
||
86 | 86 | * @param object $cmb2_obj |
87 | 87 | * @return void |
88 | 88 | */ |
89 | - public function generate_navigation( $cmb_id, $object_id, $object_type, $cmb2_obj ) { |
|
90 | - if ( 'lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type ) { |
|
89 | + public function generate_navigation($cmb_id, $object_id, $object_type, $cmb2_obj) { |
|
90 | + if ('lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type) { |
|
91 | 91 | $this->navigation = array(); |
92 | 92 | $this->is_options_page = true; |
93 | - if ( isset( $cmb2_obj->meta_box['fields'] ) && ! empty( $cmb2_obj->meta_box['fields'] ) ) { |
|
94 | - foreach ( $cmb2_obj->meta_box['fields'] as $field_index => $field ) { |
|
95 | - if ( 'title' === $field['type'] ) { |
|
96 | - $this->navigation[ $field_index ] = $field['name']; |
|
93 | + if (isset($cmb2_obj->meta_box['fields']) && ! empty($cmb2_obj->meta_box['fields'])) { |
|
94 | + foreach ($cmb2_obj->meta_box['fields'] as $field_index => $field) { |
|
95 | + if ('title' === $field['type']) { |
|
96 | + $this->navigation[$field_index] = $field['name']; |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | } |
@@ -107,32 +107,32 @@ discard block |
||
107 | 107 | * @return void |
108 | 108 | */ |
109 | 109 | public function output_navigation() { |
110 | - if ( ! empty( $this->navigation ) ) { |
|
110 | + if ( ! empty($this->navigation)) { |
|
111 | 111 | ?> |
112 | 112 | <div class="wp-filter hide-if-no-js"> |
113 | 113 | <ul class="filter-links"> |
114 | 114 | <?php |
115 | 115 | $first_tab = true; |
116 | - $total = count( $this->navigation ); |
|
116 | + $total = count($this->navigation); |
|
117 | 117 | $count = 0; |
118 | 118 | $separator = ' |'; |
119 | 119 | $selected_tab = ''; |
120 | - if ( isset( $_GET['cmb_tab'] ) && '' !== $_GET['cmb_tab'] ) { |
|
121 | - $selected_tab = sanitize_text_field( $_GET['cmb_tab'] ); |
|
120 | + if (isset($_GET['cmb_tab']) && '' !== $_GET['cmb_tab']) { |
|
121 | + $selected_tab = sanitize_text_field($_GET['cmb_tab']); |
|
122 | 122 | $selected_tab = 'settings_' . $selected_tab; |
123 | 123 | } |
124 | - foreach ( $this->navigation as $key => $label ) { |
|
124 | + foreach ($this->navigation as $key => $label) { |
|
125 | 125 | $count++; |
126 | 126 | $current_css = ''; |
127 | - if ( ( true === $first_tab && '' === $selected_tab ) || $key === $selected_tab ) { |
|
127 | + if ((true === $first_tab && '' === $selected_tab) || $key === $selected_tab) { |
|
128 | 128 | $first_tab = false; |
129 | 129 | $current_css = 'current'; |
130 | 130 | } |
131 | - if ( $count === $total ) { |
|
131 | + if ($count === $total) { |
|
132 | 132 | $separator = ''; |
133 | 133 | } |
134 | 134 | ?> |
135 | - <li><a href="#" class="<?php echo esc_attr( $current_css ); ?>" data-sort="<?php echo esc_attr( $key ); ?>_tab"><?php echo esc_attr( $label ); ?></a><?php echo esc_attr( $separator ); ?></li> |
|
135 | + <li><a href="#" class="<?php echo esc_attr($current_css); ?>" data-sort="<?php echo esc_attr($key); ?>_tab"><?php echo esc_attr($label); ?></a><?php echo esc_attr($separator); ?></li> |
|
136 | 136 | <?php |
137 | 137 | } |
138 | 138 | ?> |
@@ -148,10 +148,10 @@ discard block |
||
148 | 148 | * @param object $field CMB2_Field(); |
149 | 149 | * @return void |
150 | 150 | */ |
151 | - public function output_tab_open_div( $field ) { |
|
152 | - if ( true === $this->is_options_page && isset( $field->args['type'] ) && 'title' === $field->args['type'] ) { |
|
151 | + public function output_tab_open_div($field) { |
|
152 | + if (true === $this->is_options_page && isset($field->args['type']) && 'title' === $field->args['type']) { |
|
153 | 153 | ?> |
154 | - <div id="<?php echo esc_attr( $field->args['id'] ); ?>_tab" class="tab tab-nav hidden"> |
|
154 | + <div id="<?php echo esc_attr($field->args['id']); ?>_tab" class="tab tab-nav hidden"> |
|
155 | 155 | <?php |
156 | 156 | } |
157 | 157 | } |
@@ -162,19 +162,19 @@ discard block |
||
162 | 162 | * @param object $field CMB2_Field(); |
163 | 163 | * @return void |
164 | 164 | */ |
165 | - public function output_tab_closing_div( $field ) { |
|
166 | - if ( true === $this->is_options_page && isset( $field->args['type'] ) && 'tab_closing' === $field->args['type'] ) { |
|
165 | + public function output_tab_closing_div($field) { |
|
166 | + if (true === $this->is_options_page && isset($field->args['type']) && 'tab_closing' === $field->args['type']) { |
|
167 | 167 | ?> |
168 | 168 | </div> |
169 | 169 | <?php |
170 | 170 | } |
171 | 171 | } |
172 | 172 | |
173 | - public function cmb2_render_callback_for_tab_closing( $field, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
173 | + public function cmb2_render_callback_for_tab_closing($field, $escaped_value, $object_id, $object_type, $field_type_object) { |
|
174 | 174 | return; |
175 | 175 | } |
176 | 176 | |
177 | - public function cmb2_sanitize_tab_closing_callback( $override_value, $value ) { |
|
177 | + public function cmb2_sanitize_tab_closing_callback($override_value, $value) { |
|
178 | 178 | return ''; |
179 | 179 | } |
180 | 180 | |
@@ -187,8 +187,8 @@ discard block |
||
187 | 187 | * @param object $cmb2_obj |
188 | 188 | * @return void |
189 | 189 | */ |
190 | - public function navigation_js( $cmb_id, $object_id, $object_type, $cmb2_obj ) { |
|
191 | - if ( 'lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type ) { |
|
190 | + public function navigation_js($cmb_id, $object_id, $object_type, $cmb2_obj) { |
|
191 | + if ('lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type) { |
|
192 | 192 | ?> |
193 | 193 | <script> |
194 | 194 | var LSX_HP_CMB2 = Object.create( null ); |
@@ -270,14 +270,14 @@ discard block |
||
270 | 270 | * @param string $url |
271 | 271 | * @return void |
272 | 272 | */ |
273 | - public function add_tab_argument( $url ) { |
|
274 | - if ( isset( $_POST['cmb_tab'] ) && '' !== $_POST['cmb_tab'] ) { // @codingStandardsIgnoreLine |
|
275 | - $tab_selection = sanitize_text_field( $_POST['cmb_tab'] ); // @codingStandardsIgnoreLine |
|
276 | - $tab_selection = str_replace( array( 'settings_', '_tab' ), '', $tab_selection ); // @codingStandardsIgnoreLine |
|
277 | - if ( 'single' !== $tab_selection ) { |
|
278 | - $url = add_query_arg( 'cmb_tab', $tab_selection, $url ); |
|
273 | + public function add_tab_argument($url) { |
|
274 | + if (isset($_POST['cmb_tab']) && '' !== $_POST['cmb_tab']) { // @codingStandardsIgnoreLine |
|
275 | + $tab_selection = sanitize_text_field($_POST['cmb_tab']); // @codingStandardsIgnoreLine |
|
276 | + $tab_selection = str_replace(array('settings_', '_tab'), '', $tab_selection); // @codingStandardsIgnoreLine |
|
277 | + if ('single' !== $tab_selection) { |
|
278 | + $url = add_query_arg('cmb_tab', $tab_selection, $url); |
|
279 | 279 | } else { |
280 | - $url = remove_query_arg( 'cmb_tab', $url ); |
|
280 | + $url = remove_query_arg('cmb_tab', $url); |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 | return $url; |
@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | * Contructor |
54 | 54 | */ |
55 | 55 | public function __construct() { |
56 | - add_action( 'cmb2_admin_init', array( $this, 'register_settings_page' ) ); |
|
57 | - add_action( 'lsx_hp_settings_page', array( $this, 'general_settings' ), 1, 1 ); |
|
58 | - add_action( 'lsx_hp_settings_page', array( $this, 'global_defaults' ), 3, 1 ); |
|
59 | - add_action( 'lsx_hp_settings_page', array( $this, 'global_downloads' ), 5, 1 ); |
|
60 | - add_action( 'lsx_hp_settings_page', array( $this, 'stat_disable' ), 6, 1 ); |
|
61 | - add_action( 'lsx_hp_settings_page', array( $this, 'endpoint_translations' ), 7, 1 ); |
|
62 | - add_action( 'lsx_hp_settings_page', array( $this, 'exercise_translations' ), 7, 1 ); |
|
63 | - add_action( 'lsx_hp_settings_page', array( $this, 'post_type_toggles' ), 9, 1 ); |
|
56 | + add_action('cmb2_admin_init', array($this, 'register_settings_page')); |
|
57 | + add_action('lsx_hp_settings_page', array($this, 'general_settings'), 1, 1); |
|
58 | + add_action('lsx_hp_settings_page', array($this, 'global_defaults'), 3, 1); |
|
59 | + add_action('lsx_hp_settings_page', array($this, 'global_downloads'), 5, 1); |
|
60 | + add_action('lsx_hp_settings_page', array($this, 'stat_disable'), 6, 1); |
|
61 | + add_action('lsx_hp_settings_page', array($this, 'endpoint_translations'), 7, 1); |
|
62 | + add_action('lsx_hp_settings_page', array($this, 'exercise_translations'), 7, 1); |
|
63 | + add_action('lsx_hp_settings_page', array($this, 'post_type_toggles'), 9, 1); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public static function get_instance() { |
74 | 74 | // If the single instance hasn't been set, set it now. |
75 | - if ( null === self::$instance ) { |
|
75 | + if (null === self::$instance) { |
|
76 | 76 | self::$instance = new self(); |
77 | 77 | } |
78 | 78 | return self::$instance; |
@@ -85,124 +85,124 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function set_vars() { |
87 | 87 | |
88 | - $this->default_types = array( |
|
88 | + $this->default_types = array( |
|
89 | 89 | 'page' => array( |
90 | - 'title' => __( 'Warm Up', 'lsx-health-plan' ), |
|
91 | - 'description' => __( 'Set a default warm up routine.', 'lsx-health-plan' ), |
|
90 | + 'title' => __('Warm Up', 'lsx-health-plan'), |
|
91 | + 'description' => __('Set a default warm up routine.', 'lsx-health-plan'), |
|
92 | 92 | 'limit' => 1, |
93 | 93 | 'id' => 'plan_warmup', |
94 | 94 | ), |
95 | 95 | ); |
96 | 96 | $this->download_types = array( |
97 | 97 | 'page' => array( |
98 | - 'title' => __( 'Warm Up', 'lsx-health-plan' ), |
|
99 | - 'description' => __( 'Set a default warm up routine.', 'lsx-health-plan' ), |
|
98 | + 'title' => __('Warm Up', 'lsx-health-plan'), |
|
99 | + 'description' => __('Set a default warm up routine.', 'lsx-health-plan'), |
|
100 | 100 | 'limit' => 1, |
101 | 101 | ), |
102 | 102 | ); |
103 | - $this->endpoints = array( |
|
103 | + $this->endpoints = array( |
|
104 | 104 | 'endpoint_warm_up' => array( |
105 | - 'title' => __( 'Warm Up Endpoint', 'lsx-health-plan' ), |
|
105 | + 'title' => __('Warm Up Endpoint', 'lsx-health-plan'), |
|
106 | 106 | 'default' => 'warm-up', |
107 | 107 | ), |
108 | 108 | ); |
109 | 109 | |
110 | - if ( post_type_exists( 'meal' ) ) { |
|
111 | - $this->download_types['meal'] = array( |
|
112 | - 'title' => __( 'Meal Plan', 'lsx-health-plan' ), |
|
113 | - 'description' => __( 'Set a default meal plan.', 'lsx-health-plan' ), |
|
110 | + if (post_type_exists('meal')) { |
|
111 | + $this->download_types['meal'] = array( |
|
112 | + 'title' => __('Meal Plan', 'lsx-health-plan'), |
|
113 | + 'description' => __('Set a default meal plan.', 'lsx-health-plan'), |
|
114 | 114 | ); |
115 | - $this->default_types['meal'] = array( |
|
116 | - 'title' => __( 'Meal Plan', 'lsx-health-plan' ), |
|
117 | - 'description' => __( 'Set a default meal plan.', 'lsx-health-plan' ), |
|
115 | + $this->default_types['meal'] = array( |
|
116 | + 'title' => __('Meal Plan', 'lsx-health-plan'), |
|
117 | + 'description' => __('Set a default meal plan.', 'lsx-health-plan'), |
|
118 | 118 | 'id' => 'connected_meals', |
119 | 119 | ); |
120 | 120 | $this->endpoints['endpoint_meal'] = array( |
121 | - 'title' => __( 'Meal Endpoint', 'lsx-health-plan' ), |
|
121 | + 'title' => __('Meal Endpoint', 'lsx-health-plan'), |
|
122 | 122 | 'default' => 'meal', |
123 | - 'description' => __( 'Define the tab slug which shows on the single plan page.', 'lsx-health-plan' ), |
|
123 | + 'description' => __('Define the tab slug which shows on the single plan page.', 'lsx-health-plan'), |
|
124 | 124 | ); |
125 | 125 | $this->endpoints['endpoint_meal_archive'] = array( |
126 | - 'title' => __( 'Meals Archive Endpoint', 'lsx-health-plan' ), |
|
126 | + 'title' => __('Meals Archive Endpoint', 'lsx-health-plan'), |
|
127 | 127 | 'default' => 'meals', |
128 | 128 | ); |
129 | 129 | $this->endpoints['meal_single_slug'] = array( |
130 | - 'title' => __( 'Single Meal Slug', 'lsx-health-plan' ), |
|
130 | + 'title' => __('Single Meal Slug', 'lsx-health-plan'), |
|
131 | 131 | 'default' => 'meal', |
132 | 132 | ); |
133 | 133 | } |
134 | - if ( post_type_exists( 'recipe' ) ) { |
|
134 | + if (post_type_exists('recipe')) { |
|
135 | 135 | $this->download_types['recipe'] = array( |
136 | - 'title' => __( 'Recipe', 'lsx-health-plan' ), |
|
137 | - 'description' => __( 'Set a default recipe.', 'lsx-health-plan' ), |
|
136 | + 'title' => __('Recipe', 'lsx-health-plan'), |
|
137 | + 'description' => __('Set a default recipe.', 'lsx-health-plan'), |
|
138 | 138 | ); |
139 | 139 | $this->default_types['recipe'] = array( |
140 | - 'title' => __( 'Recipe', 'lsx-health-plan' ), |
|
141 | - 'description' => __( 'Set a default recipe.', 'lsx-health-plan' ), |
|
140 | + 'title' => __('Recipe', 'lsx-health-plan'), |
|
141 | + 'description' => __('Set a default recipe.', 'lsx-health-plan'), |
|
142 | 142 | 'id' => 'connected_recipes', |
143 | 143 | ); |
144 | 144 | $this->endpoints['endpoint_recipe'] = array( |
145 | - 'title' => __( 'Recipes Endpoint', 'lsx-health-plan' ), |
|
145 | + 'title' => __('Recipes Endpoint', 'lsx-health-plan'), |
|
146 | 146 | 'default' => 'recipe', |
147 | 147 | ); |
148 | 148 | } |
149 | - if ( post_type_exists( 'workout' ) ) { |
|
149 | + if (post_type_exists('workout')) { |
|
150 | 150 | $this->download_types['workout'] = array( |
151 | - 'title' => __( 'Workout', 'lsx-health-plan' ), |
|
152 | - 'description' => __( 'Set a default workout routine PDF.', 'lsx-health-plan' ), |
|
151 | + 'title' => __('Workout', 'lsx-health-plan'), |
|
152 | + 'description' => __('Set a default workout routine PDF.', 'lsx-health-plan'), |
|
153 | 153 | ); |
154 | 154 | $this->default_types['workout'] = array( |
155 | - 'title' => __( 'Workout', 'lsx-health-plan' ), |
|
156 | - 'description' => __( 'Set a default workout routine.', 'lsx-health-plan' ), |
|
155 | + 'title' => __('Workout', 'lsx-health-plan'), |
|
156 | + 'description' => __('Set a default workout routine.', 'lsx-health-plan'), |
|
157 | 157 | 'id' => 'connected_workouts', |
158 | 158 | ); |
159 | 159 | $this->endpoints['endpoint_workout_archive'] = array( |
160 | - 'title' => __( 'Workouts Archive Endpoint', 'lsx-health-plan' ), |
|
160 | + 'title' => __('Workouts Archive Endpoint', 'lsx-health-plan'), |
|
161 | 161 | 'default' => '', |
162 | 162 | ); |
163 | 163 | $this->endpoints['endpoint_workout'] = array( |
164 | - 'title' => __( 'Single Workout Endpoint', 'lsx-health-plan' ), |
|
164 | + 'title' => __('Single Workout Endpoint', 'lsx-health-plan'), |
|
165 | 165 | 'default' => 'workout', |
166 | 166 | ); |
167 | 167 | } |
168 | 168 | |
169 | 169 | $this->endpoints['login_slug'] = array( |
170 | - 'title' => __( 'Login Slug', 'lsx-health-plan' ), |
|
170 | + 'title' => __('Login Slug', 'lsx-health-plan'), |
|
171 | 171 | 'default' => 'login', |
172 | 172 | ); |
173 | 173 | $this->endpoints['my_plan_slug'] = array( |
174 | - 'title' => __( 'My Plan Slug', 'lsx-health-plan' ), |
|
174 | + 'title' => __('My Plan Slug', 'lsx-health-plan'), |
|
175 | 175 | 'default' => 'my-plan', |
176 | 176 | ); |
177 | 177 | $this->endpoints['plan_single_slug'] = array( |
178 | - 'title' => __( 'Single Plan Slug', 'lsx-health-plan' ), |
|
178 | + 'title' => __('Single Plan Slug', 'lsx-health-plan'), |
|
179 | 179 | 'default' => 'plan', |
180 | 180 | ); |
181 | 181 | $this->endpoints['endpoint_plan_archive'] = array( |
182 | - 'title' => __( 'Plans Archive Endpoint', 'lsx-health-plan' ), |
|
182 | + 'title' => __('Plans Archive Endpoint', 'lsx-health-plan'), |
|
183 | 183 | 'default' => 'plans', |
184 | 184 | ); |
185 | 185 | |
186 | - if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) { |
|
186 | + if (false !== \lsx_health_plan\functions\get_option('exercise_enabled', false)) { |
|
187 | 187 | $this->endpoints['exercise'] = array( |
188 | 188 | 'exercise_single' => array( |
189 | - 'title' => __( 'Single Exercise Slug', 'lsx-health-plan' ), |
|
189 | + 'title' => __('Single Exercise Slug', 'lsx-health-plan'), |
|
190 | 190 | 'default' => 'exercise', |
191 | 191 | ), |
192 | 192 | 'exercise_archive' => array( |
193 | - 'title' => __( 'Archive Exercise Slug', 'lsx-health-plan' ), |
|
193 | + 'title' => __('Archive Exercise Slug', 'lsx-health-plan'), |
|
194 | 194 | 'default' => 'exercises', |
195 | 195 | ), |
196 | 196 | 'exercise_type' => array( |
197 | - 'title' => __( 'Exercise Type Slug', 'lsx-health-plan' ), |
|
197 | + 'title' => __('Exercise Type Slug', 'lsx-health-plan'), |
|
198 | 198 | 'default' => 'exercise-type', |
199 | 199 | ), |
200 | 200 | 'exercise_equipment' => array( |
201 | - 'title' => __( 'Equipment Slug', 'lsx-health-plan' ), |
|
201 | + 'title' => __('Equipment Slug', 'lsx-health-plan'), |
|
202 | 202 | 'default' => 'equipment', |
203 | 203 | ), |
204 | 204 | 'exercise_musclegroup' => array( |
205 | - 'title' => __( 'Muscle Group Slug', 'lsx-health-plan' ), |
|
205 | + 'title' => __('Muscle Group Slug', 'lsx-health-plan'), |
|
206 | 206 | 'default' => 'muscle-group', |
207 | 207 | ), |
208 | 208 | ); |
@@ -217,14 +217,14 @@ discard block |
||
217 | 217 | $cmb = new_cmb2_box( |
218 | 218 | array( |
219 | 219 | 'id' => $this->screen_id, |
220 | - 'title' => esc_html__( 'Settings', 'lsx-health-plan' ), |
|
221 | - 'object_types' => array( 'options-page' ), |
|
220 | + 'title' => esc_html__('Settings', 'lsx-health-plan'), |
|
221 | + 'object_types' => array('options-page'), |
|
222 | 222 | 'option_key' => 'lsx_health_plan_options', // The option key and admin menu page slug. |
223 | 223 | 'parent_slug' => 'edit.php?post_type=plan', // Make options page a submenu item of the themes menu. |
224 | 224 | 'capability' => 'manage_options', // Cap required to view options-page. |
225 | 225 | ) |
226 | 226 | ); |
227 | - do_action( 'lsx_hp_settings_page', $cmb ); |
|
227 | + do_action('lsx_hp_settings_page', $cmb); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
@@ -233,25 +233,25 @@ discard block |
||
233 | 233 | * @param object $cmb new_cmb2_box(). |
234 | 234 | * @return void |
235 | 235 | */ |
236 | - public function general_settings( $cmb ) { |
|
236 | + public function general_settings($cmb) { |
|
237 | 237 | $cmb->add_field( |
238 | 238 | array( |
239 | 239 | 'id' => 'settings_general_title', |
240 | 240 | 'type' => 'title', |
241 | - 'name' => __( 'General', 'lsx-health-plan' ), |
|
242 | - 'default' => __( 'General', 'lsx-health-plan' ), |
|
241 | + 'name' => __('General', 'lsx-health-plan'), |
|
242 | + 'default' => __('General', 'lsx-health-plan'), |
|
243 | 243 | ) |
244 | 244 | ); |
245 | 245 | $cmb->add_field( |
246 | 246 | array( |
247 | - 'name' => __( 'Membership Product', 'lsx-health-plan' ), |
|
247 | + 'name' => __('Membership Product', 'lsx-health-plan'), |
|
248 | 248 | 'id' => 'membership_product', |
249 | 249 | 'type' => 'post_search_ajax', |
250 | 250 | 'limit' => 1, |
251 | 251 | 'sortable' => false, |
252 | 252 | 'query_args' => array( |
253 | - 'post_type' => array( 'product' ), |
|
254 | - 'post_status' => array( 'publish' ), |
|
253 | + 'post_type' => array('product'), |
|
254 | + 'post_status' => array('publish'), |
|
255 | 255 | 'posts_per_page' => -1, |
256 | 256 | ), |
257 | 257 | ) |
@@ -259,43 +259,43 @@ discard block |
||
259 | 259 | |
260 | 260 | $cmb->add_field( |
261 | 261 | array( |
262 | - 'name' => __( 'Your Warm-up Intro', 'lsx-health-plan' ), |
|
262 | + 'name' => __('Your Warm-up Intro', 'lsx-health-plan'), |
|
263 | 263 | 'id' => 'warmup_intro', |
264 | 264 | 'type' => 'textarea_small', |
265 | 265 | 'value' => '', |
266 | - 'default' => __( "Don't forget your warm-up! It's a vital part of your daily workout routine.", 'lsx-health-plan' ), |
|
266 | + 'default' => __("Don't forget your warm-up! It's a vital part of your daily workout routine.", 'lsx-health-plan'), |
|
267 | 267 | ) |
268 | 268 | ); |
269 | - if ( post_type_exists( 'workout' ) ) { |
|
269 | + if (post_type_exists('workout')) { |
|
270 | 270 | $cmb->add_field( |
271 | 271 | array( |
272 | - 'name' => __( 'Your Workout Intro', 'lsx-health-plan' ), |
|
272 | + 'name' => __('Your Workout Intro', 'lsx-health-plan'), |
|
273 | 273 | 'id' => 'workout_intro', |
274 | 274 | 'type' => 'textarea_small', |
275 | 275 | 'value' => '', |
276 | - 'default' => __( "Let's do this! Smash your daily workout and reach your fitness goals.", 'lsx-health-plan' ), |
|
276 | + 'default' => __("Let's do this! Smash your daily workout and reach your fitness goals.", 'lsx-health-plan'), |
|
277 | 277 | ) |
278 | 278 | ); |
279 | 279 | } |
280 | - if ( post_type_exists( 'meal' ) ) { |
|
280 | + if (post_type_exists('meal')) { |
|
281 | 281 | $cmb->add_field( |
282 | 282 | array( |
283 | - 'name' => __( 'Your Meal Plan Intro', 'lsx-health-plan' ), |
|
283 | + 'name' => __('Your Meal Plan Intro', 'lsx-health-plan'), |
|
284 | 284 | 'id' => 'meal_plan_intro', |
285 | 285 | 'type' => 'textarea_small', |
286 | 286 | 'value' => '', |
287 | - 'default' => __( 'Get the right mix of nutrients to keep muscles strong & healthy.', 'lsx-health-plan' ), |
|
287 | + 'default' => __('Get the right mix of nutrients to keep muscles strong & healthy.', 'lsx-health-plan'), |
|
288 | 288 | ) |
289 | 289 | ); |
290 | 290 | } |
291 | - if ( post_type_exists( 'recipe' ) ) { |
|
291 | + if (post_type_exists('recipe')) { |
|
292 | 292 | $cmb->add_field( |
293 | 293 | array( |
294 | - 'name' => __( 'Recipes Intro', 'lsx-health-plan' ), |
|
294 | + 'name' => __('Recipes Intro', 'lsx-health-plan'), |
|
295 | 295 | 'id' => 'recipes_intro', |
296 | 296 | 'type' => 'textarea_small', |
297 | 297 | 'value' => '', |
298 | - 'default' => __( "Let's get cooking! Delicious and easy to follow recipes.", 'lsx-health-plan' ), |
|
298 | + 'default' => __("Let's get cooking! Delicious and easy to follow recipes.", 'lsx-health-plan'), |
|
299 | 299 | ) |
300 | 300 | ); |
301 | 301 | } |
@@ -313,27 +313,27 @@ discard block |
||
313 | 313 | * @param object $cmb new_cmb2_box(). |
314 | 314 | * @return void |
315 | 315 | */ |
316 | - public function global_defaults( $cmb ) { |
|
316 | + public function global_defaults($cmb) { |
|
317 | 317 | $cmb->add_field( |
318 | 318 | array( |
319 | 319 | 'id' => 'global_defaults_title', |
320 | 320 | 'type' => 'title', |
321 | - 'name' => __( 'Global Defaults', 'lsx-health-plan' ), |
|
322 | - 'default' => __( 'Global Defaults', 'lsx-health-plan' ), |
|
323 | - 'description' => __( 'If you have not connected a specific post to your day plan, set a default option below.', 'lsx-health-plan' ), |
|
321 | + 'name' => __('Global Defaults', 'lsx-health-plan'), |
|
322 | + 'default' => __('Global Defaults', 'lsx-health-plan'), |
|
323 | + 'description' => __('If you have not connected a specific post to your day plan, set a default option below.', 'lsx-health-plan'), |
|
324 | 324 | ) |
325 | 325 | ); |
326 | 326 | |
327 | - foreach ( $this->default_types as $type => $default_type ) { |
|
327 | + foreach ($this->default_types as $type => $default_type) { |
|
328 | 328 | $limit = 5; |
329 | 329 | $sortable = false; |
330 | - if ( isset( $default_type['limit'] ) ) { |
|
330 | + if (isset($default_type['limit'])) { |
|
331 | 331 | $limit = $default_type['limit']; |
332 | 332 | $sortable = true; |
333 | 333 | } |
334 | 334 | |
335 | - if ( 'page' === $type && false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) { |
|
336 | - $type = array( 'page', 'workout' ); |
|
335 | + if ('page' === $type && false !== \lsx_health_plan\functions\get_option('exercise_enabled', false)) { |
|
336 | + $type = array('page', 'workout'); |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | $cmb->add_field( |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | 'sortable' => $sortable, |
347 | 347 | 'query_args' => array( |
348 | 348 | 'post_type' => $type, |
349 | - 'post_status' => array( 'publish' ), |
|
349 | + 'post_status' => array('publish'), |
|
350 | 350 | 'posts_per_page' => -1, |
351 | 351 | ), |
352 | 352 | ) |
@@ -367,20 +367,20 @@ discard block |
||
367 | 367 | * @param object $cmb new_cmb2_box(). |
368 | 368 | * @return void |
369 | 369 | */ |
370 | - public function global_downloads( $cmb ) { |
|
370 | + public function global_downloads($cmb) { |
|
371 | 371 | $cmb->add_field( |
372 | 372 | array( |
373 | 373 | 'id' => 'global_downloads_title', |
374 | 374 | 'type' => 'title', |
375 | - 'name' => __( 'Global Downloads', 'lsx-health-plan' ), |
|
376 | - 'default' => __( 'Global Downloads', 'lsx-health-plan' ), |
|
375 | + 'name' => __('Global Downloads', 'lsx-health-plan'), |
|
376 | + 'default' => __('Global Downloads', 'lsx-health-plan'), |
|
377 | 377 | ) |
378 | 378 | ); |
379 | 379 | |
380 | - foreach ( $this->download_types as $type => $download_type ) { |
|
380 | + foreach ($this->download_types as $type => $download_type) { |
|
381 | 381 | $limit = 5; |
382 | 382 | $sortable = false; |
383 | - if ( isset( $download_type['limit'] ) ) { |
|
383 | + if (isset($download_type['limit'])) { |
|
384 | 384 | $limit = $download_type['limit']; |
385 | 385 | $sortable = true; |
386 | 386 | } |
@@ -393,8 +393,8 @@ discard block |
||
393 | 393 | 'limit' => $limit, |
394 | 394 | 'sortable' => $sortable, |
395 | 395 | 'query_args' => array( |
396 | - 'post_type' => array( 'dlm_download' ), |
|
397 | - 'post_status' => array( 'publish' ), |
|
396 | + 'post_type' => array('dlm_download'), |
|
397 | + 'post_status' => array('publish'), |
|
398 | 398 | 'posts_per_page' => -1, |
399 | 399 | ), |
400 | 400 | ) |
@@ -414,18 +414,18 @@ discard block |
||
414 | 414 | * @param object $cmb new_cmb2_box(). |
415 | 415 | * @return void |
416 | 416 | */ |
417 | - public function endpoint_translations( $cmb ) { |
|
417 | + public function endpoint_translations($cmb) { |
|
418 | 418 | $cmb->add_field( |
419 | 419 | array( |
420 | 420 | 'id' => 'endpoints_title', |
421 | 421 | 'type' => 'title', |
422 | - 'name' => __( 'Set Endpoint Translations', 'lsx-health-plan' ), |
|
423 | - 'default' => __( 'Set Endpoint Translations', 'lsx-health-plan' ), |
|
424 | - 'description' => __( 'Endpoint is a web address (URL) at which the user can gain access to it. You need to resave your permalinks after changing the endpoint settings.', 'lsx-health-plan' ), |
|
422 | + 'name' => __('Set Endpoint Translations', 'lsx-health-plan'), |
|
423 | + 'default' => __('Set Endpoint Translations', 'lsx-health-plan'), |
|
424 | + 'description' => __('Endpoint is a web address (URL) at which the user can gain access to it. You need to resave your permalinks after changing the endpoint settings.', 'lsx-health-plan'), |
|
425 | 425 | ) |
426 | 426 | ); |
427 | - foreach ( $this->endpoints as $slug => $endpoint_vars ) { |
|
428 | - if ( 'exercise' === $slug ) { |
|
427 | + foreach ($this->endpoints as $slug => $endpoint_vars) { |
|
428 | + if ('exercise' === $slug) { |
|
429 | 429 | continue; |
430 | 430 | } |
431 | 431 | |
@@ -453,19 +453,19 @@ discard block |
||
453 | 453 | * @param object $cmb new_cmb2_box(). |
454 | 454 | * @return void |
455 | 455 | */ |
456 | - public function exercise_translations( $cmb ) { |
|
457 | - if ( isset( $this->endpoints['exercise'] ) && '' !== $this->endpoints['exercise'] && ! empty( $this->endpoints['exercise'] ) ) { |
|
456 | + public function exercise_translations($cmb) { |
|
457 | + if (isset($this->endpoints['exercise']) && '' !== $this->endpoints['exercise'] && ! empty($this->endpoints['exercise'])) { |
|
458 | 458 | $cmb->add_field( |
459 | 459 | array( |
460 | 460 | 'id' => 'exercise_endpoints_title', |
461 | 461 | 'type' => 'title', |
462 | - 'name' => __( 'Set Exercise Translations', 'lsx-health-plan' ), |
|
463 | - 'default' => __( 'Set Exercise Translations', 'lsx-health-plan' ), |
|
464 | - 'description' => __( 'You need to resave your permalinks after changing the endpoint settings.', 'lsx-health-plan' ), |
|
462 | + 'name' => __('Set Exercise Translations', 'lsx-health-plan'), |
|
463 | + 'default' => __('Set Exercise Translations', 'lsx-health-plan'), |
|
464 | + 'description' => __('You need to resave your permalinks after changing the endpoint settings.', 'lsx-health-plan'), |
|
465 | 465 | ) |
466 | 466 | ); |
467 | 467 | |
468 | - foreach ( $this->endpoints['exercise'] as $slug => $endpoint_vars ) { |
|
468 | + foreach ($this->endpoints['exercise'] as $slug => $endpoint_vars) { |
|
469 | 469 | $cmb->add_field( |
470 | 470 | array( |
471 | 471 | 'name' => $endpoint_vars['title'], |
@@ -491,27 +491,27 @@ discard block |
||
491 | 491 | * @param object $cmb new_cmb2_box(). |
492 | 492 | * @return void |
493 | 493 | */ |
494 | - public function post_type_toggles( $cmb ) { |
|
495 | - $post_types = apply_filters( 'lsx_health_plan_post_types', isset( $this->post_types ) ); |
|
494 | + public function post_type_toggles($cmb) { |
|
495 | + $post_types = apply_filters('lsx_health_plan_post_types', isset($this->post_types)); |
|
496 | 496 | |
497 | 497 | $cmb->add_field( |
498 | 498 | array( |
499 | 499 | 'id' => 'post_type_toggles_title', |
500 | 500 | 'type' => 'title', |
501 | - 'name' => __( 'Disable Post Types', 'lsx-health-plan' ), |
|
502 | - 'default' => __( 'Disable Post Types', 'lsx-health-plan' ), |
|
503 | - 'description' => __( 'Disable post types if you are wanting a minimal site.', 'lsx-health-plan' ), |
|
501 | + 'name' => __('Disable Post Types', 'lsx-health-plan'), |
|
502 | + 'default' => __('Disable Post Types', 'lsx-health-plan'), |
|
503 | + 'description' => __('Disable post types if you are wanting a minimal site.', 'lsx-health-plan'), |
|
504 | 504 | ) |
505 | 505 | ); |
506 | 506 | |
507 | - foreach ( $post_types as $post_type ) { |
|
508 | - if ( 'plan' === $post_type || 'exercise' === $post_type || ( 'video' === $post_type && false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) ) { |
|
507 | + foreach ($post_types as $post_type) { |
|
508 | + if ('plan' === $post_type || 'exercise' === $post_type || ('video' === $post_type && false !== \lsx_health_plan\functions\get_option('exercise_enabled', false))) { |
|
509 | 509 | continue; |
510 | 510 | } |
511 | 511 | |
512 | 512 | $cmb->add_field( |
513 | 513 | array( |
514 | - 'name' => ucwords( $post_type ), |
|
514 | + 'name' => ucwords($post_type), |
|
515 | 515 | 'id' => $post_type . '_disabled', |
516 | 516 | 'type' => 'checkbox', |
517 | 517 | 'value' => 1, |
@@ -531,19 +531,19 @@ discard block |
||
531 | 531 | array( |
532 | 532 | 'id' => 'post_type_toggles_enable_title', |
533 | 533 | 'type' => 'title', |
534 | - 'name' => __( 'Enable Post Types', 'lsx-health-plan' ), |
|
535 | - 'default' => __( 'Enable Post Types', 'lsx-health-plan' ), |
|
536 | - 'description' => __( 'Enable new functionailty like the "exercise" post type.', 'lsx-health-plan' ), |
|
534 | + 'name' => __('Enable Post Types', 'lsx-health-plan'), |
|
535 | + 'default' => __('Enable Post Types', 'lsx-health-plan'), |
|
536 | + 'description' => __('Enable new functionailty like the "exercise" post type.', 'lsx-health-plan'), |
|
537 | 537 | ) |
538 | 538 | ); |
539 | 539 | $cmb->add_field( |
540 | 540 | array( |
541 | - 'name' => __( 'Exercises', 'lsx-health-plan' ), |
|
541 | + 'name' => __('Exercises', 'lsx-health-plan'), |
|
542 | 542 | 'id' => 'exercise_enabled', |
543 | 543 | 'type' => 'checkbox', |
544 | 544 | 'value' => 1, |
545 | 545 | 'default' => 0, |
546 | - 'description' => __( 'Enabling the exercise post type will automatically replace the Video post type.', 'lsx-health-plan' ), |
|
546 | + 'description' => __('Enabling the exercise post type will automatically replace the Video post type.', 'lsx-health-plan'), |
|
547 | 547 | ) |
548 | 548 | ); |
549 | 549 | $cmb->add_field( |
@@ -560,18 +560,18 @@ discard block |
||
560 | 560 | * @return void |
561 | 561 | */ |
562 | 562 | |
563 | - public function stat_disable( $cmb ) { |
|
563 | + public function stat_disable($cmb) { |
|
564 | 564 | $cmb->add_field( |
565 | 565 | array( |
566 | 566 | 'id' => 'stat_disable_title', |
567 | 567 | 'type' => 'title', |
568 | - 'name' => __( 'Disable Profile Stats', 'lsx-health-plan' ), |
|
569 | - 'default' => __( 'Disable Profile Stats', 'lsx-health-plan' ), |
|
568 | + 'name' => __('Disable Profile Stats', 'lsx-health-plan'), |
|
569 | + 'default' => __('Disable Profile Stats', 'lsx-health-plan'), |
|
570 | 570 | ) |
571 | 571 | ); |
572 | 572 | $cmb->add_field( |
573 | 573 | array( |
574 | - 'name' => __( 'Disable All Stats', 'lsx-health-plan' ), |
|
574 | + 'name' => __('Disable All Stats', 'lsx-health-plan'), |
|
575 | 575 | 'desc' => 'Disable All Stats', |
576 | 576 | 'id' => 'disable_all_stats', |
577 | 577 | 'type' => 'checkbox', |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | ); |
582 | 582 | $cmb->add_field( |
583 | 583 | array( |
584 | - 'name' => __( 'Disable Weight', 'lsx-health-plan' ), |
|
584 | + 'name' => __('Disable Weight', 'lsx-health-plan'), |
|
585 | 585 | 'id' => 'disable_weight_checkbox', |
586 | 586 | 'type' => 'checkbox', |
587 | 587 | 'value' => 1, |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | ); |
591 | 591 | $cmb->add_field( |
592 | 592 | array( |
593 | - 'name' => __( 'Disable Waist', 'lsx-health-plan' ), |
|
593 | + 'name' => __('Disable Waist', 'lsx-health-plan'), |
|
594 | 594 | 'id' => 'disable_waist_checkbox', |
595 | 595 | 'type' => 'checkbox', |
596 | 596 | 'value' => 1, |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | ); |
600 | 600 | $cmb->add_field( |
601 | 601 | array( |
602 | - 'name' => __( 'Disable Fitness', 'lsx-health-plan' ), |
|
602 | + 'name' => __('Disable Fitness', 'lsx-health-plan'), |
|
603 | 603 | 'id' => 'disable_fitness_checkbox', |
604 | 604 | 'type' => 'checkbox', |
605 | 605 | 'value' => 1, |