@@ -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( '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('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 | |
@@ -54,16 +54,16 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function __construct() { |
| 56 | 56 | $this->load_classes(); |
| 57 | - add_action( 'cmb2_admin_init', array( $this, 'register_settings_page' ) ); |
|
| 58 | - add_action( 'lsx_hp_settings_page', array( $this, 'generate_tabs' ), 1, 1 ); |
|
| 59 | - |
|
| 60 | - add_action( 'lsx_hp_settings_page_general_top', array( $this, 'general_settings' ), 1, 1 ); |
|
| 61 | - add_action( 'lsx_hp_settings_page', array( $this, 'global_defaults' ), 3, 1 ); |
|
| 62 | - add_action( 'lsx_hp_settings_page', array( $this, 'global_downloads' ), 5, 1 ); |
|
| 63 | - add_action( 'lsx_hp_settings_page', array( $this, 'stat_disable' ), 6, 1 ); |
|
| 64 | - add_action( 'lsx_hp_settings_page', array( $this, 'endpoint_translations' ), 7, 1 ); |
|
| 65 | - add_action( 'lsx_hp_settings_page', array( $this, 'exercise_translations' ), 7, 1 ); |
|
| 66 | - add_action( 'lsx_hp_settings_page', array( $this, 'post_type_toggles' ), 9, 1 ); |
|
| 57 | + add_action('cmb2_admin_init', array($this, 'register_settings_page')); |
|
| 58 | + add_action('lsx_hp_settings_page', array($this, 'generate_tabs'), 1, 1); |
|
| 59 | + |
|
| 60 | + add_action('lsx_hp_settings_page_general_top', array($this, 'general_settings'), 1, 1); |
|
| 61 | + add_action('lsx_hp_settings_page', array($this, 'global_defaults'), 3, 1); |
|
| 62 | + add_action('lsx_hp_settings_page', array($this, 'global_downloads'), 5, 1); |
|
| 63 | + add_action('lsx_hp_settings_page', array($this, 'stat_disable'), 6, 1); |
|
| 64 | + add_action('lsx_hp_settings_page', array($this, 'endpoint_translations'), 7, 1); |
|
| 65 | + add_action('lsx_hp_settings_page', array($this, 'exercise_translations'), 7, 1); |
|
| 66 | + add_action('lsx_hp_settings_page', array($this, 'post_type_toggles'), 9, 1); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public static function get_instance() { |
| 77 | 77 | // If the single instance hasn't been set, set it now. |
| 78 | - if ( null === self::$instance ) { |
|
| 78 | + if (null === self::$instance) { |
|
| 79 | 79 | self::$instance = new self(); |
| 80 | 80 | } |
| 81 | 81 | return self::$instance; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | //'tip', |
| 96 | 96 | ); |
| 97 | 97 | |
| 98 | - foreach ( $this->post_types as $post_type ) { |
|
| 98 | + foreach ($this->post_types as $post_type) { |
|
| 99 | 99 | $this->$post_type = require_once LSX_HEALTH_PLAN_PATH . 'classes/admin/settings/class-' . $post_type . '.php'; |
| 100 | 100 | } |
| 101 | 101 | } |
@@ -107,124 +107,124 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | public function set_vars() { |
| 109 | 109 | |
| 110 | - $this->default_types = array( |
|
| 110 | + $this->default_types = array( |
|
| 111 | 111 | 'page' => array( |
| 112 | - 'title' => __( 'Warm Up', 'lsx-health-plan' ), |
|
| 113 | - 'description' => __( 'Set a default warm up routine.', 'lsx-health-plan' ), |
|
| 112 | + 'title' => __('Warm Up', 'lsx-health-plan'), |
|
| 113 | + 'description' => __('Set a default warm up routine.', 'lsx-health-plan'), |
|
| 114 | 114 | 'limit' => 1, |
| 115 | 115 | 'id' => 'plan_warmup', |
| 116 | 116 | ), |
| 117 | 117 | ); |
| 118 | 118 | $this->download_types = array( |
| 119 | 119 | 'page' => array( |
| 120 | - 'title' => __( 'Warm Up', 'lsx-health-plan' ), |
|
| 121 | - 'description' => __( 'Set a default warm up routine.', 'lsx-health-plan' ), |
|
| 120 | + 'title' => __('Warm Up', 'lsx-health-plan'), |
|
| 121 | + 'description' => __('Set a default warm up routine.', 'lsx-health-plan'), |
|
| 122 | 122 | 'limit' => 1, |
| 123 | 123 | ), |
| 124 | 124 | ); |
| 125 | - $this->endpoints = array( |
|
| 125 | + $this->endpoints = array( |
|
| 126 | 126 | 'endpoint_warm_up' => array( |
| 127 | - 'title' => __( 'Warm Up Endpoint', 'lsx-health-plan' ), |
|
| 127 | + 'title' => __('Warm Up Endpoint', 'lsx-health-plan'), |
|
| 128 | 128 | 'default' => 'warm-up', |
| 129 | 129 | ), |
| 130 | 130 | ); |
| 131 | 131 | |
| 132 | - if ( post_type_exists( 'meal' ) ) { |
|
| 133 | - $this->download_types['meal'] = array( |
|
| 134 | - 'title' => __( 'Meal Plan', 'lsx-health-plan' ), |
|
| 135 | - 'description' => __( 'Set a default meal plan.', 'lsx-health-plan' ), |
|
| 132 | + if (post_type_exists('meal')) { |
|
| 133 | + $this->download_types['meal'] = array( |
|
| 134 | + 'title' => __('Meal Plan', 'lsx-health-plan'), |
|
| 135 | + 'description' => __('Set a default meal plan.', 'lsx-health-plan'), |
|
| 136 | 136 | ); |
| 137 | - $this->default_types['meal'] = array( |
|
| 138 | - 'title' => __( 'Meal Plan', 'lsx-health-plan' ), |
|
| 139 | - 'description' => __( 'Set a default meal plan.', 'lsx-health-plan' ), |
|
| 137 | + $this->default_types['meal'] = array( |
|
| 138 | + 'title' => __('Meal Plan', 'lsx-health-plan'), |
|
| 139 | + 'description' => __('Set a default meal plan.', 'lsx-health-plan'), |
|
| 140 | 140 | 'id' => 'connected_meals', |
| 141 | 141 | ); |
| 142 | 142 | $this->endpoints['endpoint_meal'] = array( |
| 143 | - 'title' => __( 'Meal Endpoint', 'lsx-health-plan' ), |
|
| 143 | + 'title' => __('Meal Endpoint', 'lsx-health-plan'), |
|
| 144 | 144 | 'default' => 'meal', |
| 145 | - 'description' => __( 'Define the tab slug which shows on the single plan page.', 'lsx-health-plan' ), |
|
| 145 | + 'description' => __('Define the tab slug which shows on the single plan page.', 'lsx-health-plan'), |
|
| 146 | 146 | ); |
| 147 | 147 | $this->endpoints['endpoint_meal_archive'] = array( |
| 148 | - 'title' => __( 'Meals Archive Endpoint', 'lsx-health-plan' ), |
|
| 148 | + 'title' => __('Meals Archive Endpoint', 'lsx-health-plan'), |
|
| 149 | 149 | 'default' => 'meals', |
| 150 | 150 | ); |
| 151 | 151 | $this->endpoints['meal_single_slug'] = array( |
| 152 | - 'title' => __( 'Single Meal Slug', 'lsx-health-plan' ), |
|
| 152 | + 'title' => __('Single Meal Slug', 'lsx-health-plan'), |
|
| 153 | 153 | 'default' => 'meal', |
| 154 | 154 | ); |
| 155 | 155 | } |
| 156 | - if ( post_type_exists( 'recipe' ) ) { |
|
| 156 | + if (post_type_exists('recipe')) { |
|
| 157 | 157 | $this->download_types['recipe'] = array( |
| 158 | - 'title' => __( 'Recipe', 'lsx-health-plan' ), |
|
| 159 | - 'description' => __( 'Set a default recipe.', 'lsx-health-plan' ), |
|
| 158 | + 'title' => __('Recipe', 'lsx-health-plan'), |
|
| 159 | + 'description' => __('Set a default recipe.', 'lsx-health-plan'), |
|
| 160 | 160 | ); |
| 161 | 161 | $this->default_types['recipe'] = array( |
| 162 | - 'title' => __( 'Recipe', 'lsx-health-plan' ), |
|
| 163 | - 'description' => __( 'Set a default recipe.', 'lsx-health-plan' ), |
|
| 162 | + 'title' => __('Recipe', 'lsx-health-plan'), |
|
| 163 | + 'description' => __('Set a default recipe.', 'lsx-health-plan'), |
|
| 164 | 164 | 'id' => 'connected_recipes', |
| 165 | 165 | ); |
| 166 | 166 | $this->endpoints['endpoint_recipe'] = array( |
| 167 | - 'title' => __( 'Recipes Endpoint', 'lsx-health-plan' ), |
|
| 167 | + 'title' => __('Recipes Endpoint', 'lsx-health-plan'), |
|
| 168 | 168 | 'default' => 'recipe', |
| 169 | 169 | ); |
| 170 | 170 | } |
| 171 | - if ( post_type_exists( 'workout' ) ) { |
|
| 171 | + if (post_type_exists('workout')) { |
|
| 172 | 172 | $this->download_types['workout'] = array( |
| 173 | - 'title' => __( 'Workout', 'lsx-health-plan' ), |
|
| 174 | - 'description' => __( 'Set a default workout routine PDF.', 'lsx-health-plan' ), |
|
| 173 | + 'title' => __('Workout', 'lsx-health-plan'), |
|
| 174 | + 'description' => __('Set a default workout routine PDF.', 'lsx-health-plan'), |
|
| 175 | 175 | ); |
| 176 | 176 | $this->default_types['workout'] = array( |
| 177 | - 'title' => __( 'Workout', 'lsx-health-plan' ), |
|
| 178 | - 'description' => __( 'Set a default workout routine.', 'lsx-health-plan' ), |
|
| 177 | + 'title' => __('Workout', 'lsx-health-plan'), |
|
| 178 | + 'description' => __('Set a default workout routine.', 'lsx-health-plan'), |
|
| 179 | 179 | 'id' => 'connected_workouts', |
| 180 | 180 | ); |
| 181 | 181 | $this->endpoints['endpoint_workout_archive'] = array( |
| 182 | - 'title' => __( 'Workouts Archive Endpoint', 'lsx-health-plan' ), |
|
| 182 | + 'title' => __('Workouts Archive Endpoint', 'lsx-health-plan'), |
|
| 183 | 183 | 'default' => '', |
| 184 | 184 | ); |
| 185 | 185 | $this->endpoints['endpoint_workout'] = array( |
| 186 | - 'title' => __( 'Single Workout Endpoint', 'lsx-health-plan' ), |
|
| 186 | + 'title' => __('Single Workout Endpoint', 'lsx-health-plan'), |
|
| 187 | 187 | 'default' => 'workout', |
| 188 | 188 | ); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | $this->endpoints['login_slug'] = array( |
| 192 | - 'title' => __( 'Login Slug', 'lsx-health-plan' ), |
|
| 192 | + 'title' => __('Login Slug', 'lsx-health-plan'), |
|
| 193 | 193 | 'default' => 'login', |
| 194 | 194 | ); |
| 195 | 195 | $this->endpoints['my_plan_slug'] = array( |
| 196 | - 'title' => __( 'My Plan Slug', 'lsx-health-plan' ), |
|
| 196 | + 'title' => __('My Plan Slug', 'lsx-health-plan'), |
|
| 197 | 197 | 'default' => 'my-plan', |
| 198 | 198 | ); |
| 199 | 199 | $this->endpoints['plan_single_slug'] = array( |
| 200 | - 'title' => __( 'Single Plan Slug', 'lsx-health-plan' ), |
|
| 200 | + 'title' => __('Single Plan Slug', 'lsx-health-plan'), |
|
| 201 | 201 | 'default' => 'plan', |
| 202 | 202 | ); |
| 203 | 203 | $this->endpoints['endpoint_plan_archive'] = array( |
| 204 | - 'title' => __( 'Plans Archive Endpoint', 'lsx-health-plan' ), |
|
| 204 | + 'title' => __('Plans Archive Endpoint', 'lsx-health-plan'), |
|
| 205 | 205 | 'default' => 'plans', |
| 206 | 206 | ); |
| 207 | 207 | |
| 208 | - if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) { |
|
| 208 | + if (false !== \lsx_health_plan\functions\get_option('exercise_enabled', false)) { |
|
| 209 | 209 | $this->endpoints['exercise'] = array( |
| 210 | 210 | 'exercise_single' => array( |
| 211 | - 'title' => __( 'Single Exercise Slug', 'lsx-health-plan' ), |
|
| 211 | + 'title' => __('Single Exercise Slug', 'lsx-health-plan'), |
|
| 212 | 212 | 'default' => 'exercise', |
| 213 | 213 | ), |
| 214 | 214 | 'exercise_archive' => array( |
| 215 | - 'title' => __( 'Archive Exercise Slug', 'lsx-health-plan' ), |
|
| 215 | + 'title' => __('Archive Exercise Slug', 'lsx-health-plan'), |
|
| 216 | 216 | 'default' => 'exercises', |
| 217 | 217 | ), |
| 218 | 218 | 'exercise_type' => array( |
| 219 | - 'title' => __( 'Exercise Type Slug', 'lsx-health-plan' ), |
|
| 219 | + 'title' => __('Exercise Type Slug', 'lsx-health-plan'), |
|
| 220 | 220 | 'default' => 'exercise-type', |
| 221 | 221 | ), |
| 222 | 222 | 'exercise_equipment' => array( |
| 223 | - 'title' => __( 'Equipment Slug', 'lsx-health-plan' ), |
|
| 223 | + 'title' => __('Equipment Slug', 'lsx-health-plan'), |
|
| 224 | 224 | 'default' => 'equipment', |
| 225 | 225 | ), |
| 226 | 226 | 'exercise_musclegroup' => array( |
| 227 | - 'title' => __( 'Muscle Group Slug', 'lsx-health-plan' ), |
|
| 227 | + 'title' => __('Muscle Group Slug', 'lsx-health-plan'), |
|
| 228 | 228 | 'default' => 'muscle-group', |
| 229 | 229 | ), |
| 230 | 230 | ); |
@@ -239,14 +239,14 @@ discard block |
||
| 239 | 239 | $cmb = new_cmb2_box( |
| 240 | 240 | array( |
| 241 | 241 | 'id' => $this->screen_id, |
| 242 | - 'title' => esc_html__( 'Settings', 'lsx-health-plan' ), |
|
| 243 | - 'object_types' => array( 'options-page' ), |
|
| 242 | + 'title' => esc_html__('Settings', 'lsx-health-plan'), |
|
| 243 | + 'object_types' => array('options-page'), |
|
| 244 | 244 | 'option_key' => 'lsx_health_plan_options', // The option key and admin menu page slug. |
| 245 | 245 | 'parent_slug' => 'edit.php?post_type=plan', // Make options page a submenu item of the themes menu. |
| 246 | 246 | 'capability' => 'manage_options', // Cap required to view options-page. |
| 247 | 247 | ) |
| 248 | 248 | ); |
| 249 | - do_action( 'lsx_hp_settings_page', $cmb ); |
|
| 249 | + do_action('lsx_hp_settings_page', $cmb); |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | /** |
@@ -255,17 +255,17 @@ discard block |
||
| 255 | 255 | * @param object $cmb new_cmb2_box(). |
| 256 | 256 | * @return void |
| 257 | 257 | */ |
| 258 | - public function general_settings( $cmb ) { |
|
| 258 | + public function general_settings($cmb) { |
|
| 259 | 259 | $cmb->add_field( |
| 260 | 260 | array( |
| 261 | - 'name' => __( 'Membership Product', 'lsx-health-plan' ), |
|
| 261 | + 'name' => __('Membership Product', 'lsx-health-plan'), |
|
| 262 | 262 | 'id' => 'membership_product', |
| 263 | 263 | 'type' => 'post_search_ajax', |
| 264 | 264 | 'limit' => 1, |
| 265 | 265 | 'sortable' => false, |
| 266 | 266 | 'query_args' => array( |
| 267 | - 'post_type' => array( 'product' ), |
|
| 268 | - 'post_status' => array( 'publish' ), |
|
| 267 | + 'post_type' => array('product'), |
|
| 268 | + 'post_status' => array('publish'), |
|
| 269 | 269 | 'posts_per_page' => -1, |
| 270 | 270 | ), |
| 271 | 271 | ) |
@@ -273,43 +273,43 @@ discard block |
||
| 273 | 273 | |
| 274 | 274 | $cmb->add_field( |
| 275 | 275 | array( |
| 276 | - 'name' => __( 'Your Warm-up Intro', 'lsx-health-plan' ), |
|
| 276 | + 'name' => __('Your Warm-up Intro', 'lsx-health-plan'), |
|
| 277 | 277 | 'id' => 'warmup_intro', |
| 278 | 278 | 'type' => 'textarea_small', |
| 279 | 279 | 'value' => '', |
| 280 | - 'default' => __( "Don't forget your warm-up! It's a vital part of your daily workout routine.", 'lsx-health-plan' ), |
|
| 280 | + 'default' => __("Don't forget your warm-up! It's a vital part of your daily workout routine.", 'lsx-health-plan'), |
|
| 281 | 281 | ) |
| 282 | 282 | ); |
| 283 | - if ( post_type_exists( 'workout' ) ) { |
|
| 283 | + if (post_type_exists('workout')) { |
|
| 284 | 284 | $cmb->add_field( |
| 285 | 285 | array( |
| 286 | - 'name' => __( 'Your Workout Intro', 'lsx-health-plan' ), |
|
| 286 | + 'name' => __('Your Workout Intro', 'lsx-health-plan'), |
|
| 287 | 287 | 'id' => 'workout_intro', |
| 288 | 288 | 'type' => 'textarea_small', |
| 289 | 289 | 'value' => '', |
| 290 | - 'default' => __( "Let's do this! Smash your daily workout and reach your fitness goals.", 'lsx-health-plan' ), |
|
| 290 | + 'default' => __("Let's do this! Smash your daily workout and reach your fitness goals.", 'lsx-health-plan'), |
|
| 291 | 291 | ) |
| 292 | 292 | ); |
| 293 | 293 | } |
| 294 | - if ( post_type_exists( 'meal' ) ) { |
|
| 294 | + if (post_type_exists('meal')) { |
|
| 295 | 295 | $cmb->add_field( |
| 296 | 296 | array( |
| 297 | - 'name' => __( 'Your Meal Plan Intro', 'lsx-health-plan' ), |
|
| 297 | + 'name' => __('Your Meal Plan Intro', 'lsx-health-plan'), |
|
| 298 | 298 | 'id' => 'meal_plan_intro', |
| 299 | 299 | 'type' => 'textarea_small', |
| 300 | 300 | 'value' => '', |
| 301 | - 'default' => __( 'Get the right mix of nutrients to keep muscles strong & healthy.', 'lsx-health-plan' ), |
|
| 301 | + 'default' => __('Get the right mix of nutrients to keep muscles strong & healthy.', 'lsx-health-plan'), |
|
| 302 | 302 | ) |
| 303 | 303 | ); |
| 304 | 304 | } |
| 305 | - if ( post_type_exists( 'recipe' ) ) { |
|
| 305 | + if (post_type_exists('recipe')) { |
|
| 306 | 306 | $cmb->add_field( |
| 307 | 307 | array( |
| 308 | - 'name' => __( 'Recipes Intro', 'lsx-health-plan' ), |
|
| 308 | + 'name' => __('Recipes Intro', 'lsx-health-plan'), |
|
| 309 | 309 | 'id' => 'recipes_intro', |
| 310 | 310 | 'type' => 'textarea_small', |
| 311 | 311 | 'value' => '', |
| 312 | - 'default' => __( "Let's get cooking! Delicious and easy to follow recipes.", 'lsx-health-plan' ), |
|
| 312 | + 'default' => __("Let's get cooking! Delicious and easy to follow recipes.", 'lsx-health-plan'), |
|
| 313 | 313 | ) |
| 314 | 314 | ); |
| 315 | 315 | } |
@@ -321,27 +321,27 @@ discard block |
||
| 321 | 321 | * @param object $cmb new_cmb2_box(). |
| 322 | 322 | * @return void |
| 323 | 323 | */ |
| 324 | - public function global_defaults( $cmb ) { |
|
| 324 | + public function global_defaults($cmb) { |
|
| 325 | 325 | $cmb->add_field( |
| 326 | 326 | array( |
| 327 | 327 | 'id' => 'global_defaults_title', |
| 328 | 328 | 'type' => 'title', |
| 329 | - 'name' => __( 'Global Defaults', 'lsx-health-plan' ), |
|
| 330 | - 'default' => __( 'Global Defaults', 'lsx-health-plan' ), |
|
| 331 | - 'description' => __( 'If you have not connected a specific post to your day plan, set a default option below.', 'lsx-health-plan' ), |
|
| 329 | + 'name' => __('Global Defaults', 'lsx-health-plan'), |
|
| 330 | + 'default' => __('Global Defaults', 'lsx-health-plan'), |
|
| 331 | + 'description' => __('If you have not connected a specific post to your day plan, set a default option below.', 'lsx-health-plan'), |
|
| 332 | 332 | ) |
| 333 | 333 | ); |
| 334 | 334 | |
| 335 | - foreach ( $this->default_types as $type => $default_type ) { |
|
| 335 | + foreach ($this->default_types as $type => $default_type) { |
|
| 336 | 336 | $limit = 5; |
| 337 | 337 | $sortable = false; |
| 338 | - if ( isset( $default_type['limit'] ) ) { |
|
| 338 | + if (isset($default_type['limit'])) { |
|
| 339 | 339 | $limit = $default_type['limit']; |
| 340 | 340 | $sortable = true; |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | - if ( 'page' === $type && false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) { |
|
| 344 | - $type = array( 'page', 'workout' ); |
|
| 343 | + if ('page' === $type && false !== \lsx_health_plan\functions\get_option('exercise_enabled', false)) { |
|
| 344 | + $type = array('page', 'workout'); |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | $cmb->add_field( |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | 'sortable' => $sortable, |
| 355 | 355 | 'query_args' => array( |
| 356 | 356 | 'post_type' => $type, |
| 357 | - 'post_status' => array( 'publish' ), |
|
| 357 | + 'post_status' => array('publish'), |
|
| 358 | 358 | 'posts_per_page' => -1, |
| 359 | 359 | ), |
| 360 | 360 | ) |
@@ -375,20 +375,20 @@ discard block |
||
| 375 | 375 | * @param object $cmb new_cmb2_box(). |
| 376 | 376 | * @return void |
| 377 | 377 | */ |
| 378 | - public function global_downloads( $cmb ) { |
|
| 378 | + public function global_downloads($cmb) { |
|
| 379 | 379 | $cmb->add_field( |
| 380 | 380 | array( |
| 381 | 381 | 'id' => 'global_downloads_title', |
| 382 | 382 | 'type' => 'title', |
| 383 | - 'name' => __( 'Global Downloads', 'lsx-health-plan' ), |
|
| 384 | - 'default' => __( 'Global Downloads', 'lsx-health-plan' ), |
|
| 383 | + 'name' => __('Global Downloads', 'lsx-health-plan'), |
|
| 384 | + 'default' => __('Global Downloads', 'lsx-health-plan'), |
|
| 385 | 385 | ) |
| 386 | 386 | ); |
| 387 | 387 | |
| 388 | - foreach ( $this->download_types as $type => $download_type ) { |
|
| 388 | + foreach ($this->download_types as $type => $download_type) { |
|
| 389 | 389 | $limit = 5; |
| 390 | 390 | $sortable = false; |
| 391 | - if ( isset( $download_type['limit'] ) ) { |
|
| 391 | + if (isset($download_type['limit'])) { |
|
| 392 | 392 | $limit = $download_type['limit']; |
| 393 | 393 | $sortable = true; |
| 394 | 394 | } |
@@ -401,8 +401,8 @@ discard block |
||
| 401 | 401 | 'limit' => $limit, |
| 402 | 402 | 'sortable' => $sortable, |
| 403 | 403 | 'query_args' => array( |
| 404 | - 'post_type' => array( 'dlm_download' ), |
|
| 405 | - 'post_status' => array( 'publish' ), |
|
| 404 | + 'post_type' => array('dlm_download'), |
|
| 405 | + 'post_status' => array('publish'), |
|
| 406 | 406 | 'posts_per_page' => -1, |
| 407 | 407 | ), |
| 408 | 408 | ) |
@@ -422,18 +422,18 @@ discard block |
||
| 422 | 422 | * @param object $cmb new_cmb2_box(). |
| 423 | 423 | * @return void |
| 424 | 424 | */ |
| 425 | - public function endpoint_translations( $cmb ) { |
|
| 425 | + public function endpoint_translations($cmb) { |
|
| 426 | 426 | $cmb->add_field( |
| 427 | 427 | array( |
| 428 | 428 | 'id' => 'endpoints_title', |
| 429 | 429 | 'type' => 'title', |
| 430 | - 'name' => __( 'Set Endpoint Translations', 'lsx-health-plan' ), |
|
| 431 | - 'default' => __( 'Set Endpoint Translations', 'lsx-health-plan' ), |
|
| 432 | - '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' ), |
|
| 430 | + 'name' => __('Set Endpoint Translations', 'lsx-health-plan'), |
|
| 431 | + 'default' => __('Set Endpoint Translations', 'lsx-health-plan'), |
|
| 432 | + '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'), |
|
| 433 | 433 | ) |
| 434 | 434 | ); |
| 435 | - foreach ( $this->endpoints as $slug => $endpoint_vars ) { |
|
| 436 | - if ( 'exercise' === $slug ) { |
|
| 435 | + foreach ($this->endpoints as $slug => $endpoint_vars) { |
|
| 436 | + if ('exercise' === $slug) { |
|
| 437 | 437 | continue; |
| 438 | 438 | } |
| 439 | 439 | |
@@ -461,19 +461,19 @@ discard block |
||
| 461 | 461 | * @param object $cmb new_cmb2_box(). |
| 462 | 462 | * @return void |
| 463 | 463 | */ |
| 464 | - public function exercise_translations( $cmb ) { |
|
| 465 | - if ( isset( $this->endpoints['exercise'] ) && '' !== $this->endpoints['exercise'] && ! empty( $this->endpoints['exercise'] ) ) { |
|
| 464 | + public function exercise_translations($cmb) { |
|
| 465 | + if (isset($this->endpoints['exercise']) && '' !== $this->endpoints['exercise'] && ! empty($this->endpoints['exercise'])) { |
|
| 466 | 466 | $cmb->add_field( |
| 467 | 467 | array( |
| 468 | 468 | 'id' => 'exercise_endpoints_title', |
| 469 | 469 | 'type' => 'title', |
| 470 | - 'name' => __( 'Set Exercise Translations', 'lsx-health-plan' ), |
|
| 471 | - 'default' => __( 'Set Exercise Translations', 'lsx-health-plan' ), |
|
| 472 | - 'description' => __( 'You need to resave your permalinks after changing the endpoint settings.', 'lsx-health-plan' ), |
|
| 470 | + 'name' => __('Set Exercise Translations', 'lsx-health-plan'), |
|
| 471 | + 'default' => __('Set Exercise Translations', 'lsx-health-plan'), |
|
| 472 | + 'description' => __('You need to resave your permalinks after changing the endpoint settings.', 'lsx-health-plan'), |
|
| 473 | 473 | ) |
| 474 | 474 | ); |
| 475 | 475 | |
| 476 | - foreach ( $this->endpoints['exercise'] as $slug => $endpoint_vars ) { |
|
| 476 | + foreach ($this->endpoints['exercise'] as $slug => $endpoint_vars) { |
|
| 477 | 477 | $cmb->add_field( |
| 478 | 478 | array( |
| 479 | 479 | 'name' => $endpoint_vars['title'], |
@@ -499,27 +499,27 @@ discard block |
||
| 499 | 499 | * @param object $cmb new_cmb2_box(). |
| 500 | 500 | * @return void |
| 501 | 501 | */ |
| 502 | - public function post_type_toggles( $cmb ) { |
|
| 503 | - $post_types = apply_filters( 'lsx_health_plan_post_types', isset( $this->post_types ) ); |
|
| 502 | + public function post_type_toggles($cmb) { |
|
| 503 | + $post_types = apply_filters('lsx_health_plan_post_types', isset($this->post_types)); |
|
| 504 | 504 | |
| 505 | 505 | $cmb->add_field( |
| 506 | 506 | array( |
| 507 | 507 | 'id' => 'post_type_toggles_title', |
| 508 | 508 | 'type' => 'title', |
| 509 | - 'name' => __( 'Disable Post Types', 'lsx-health-plan' ), |
|
| 510 | - 'default' => __( 'Disable Post Types', 'lsx-health-plan' ), |
|
| 511 | - 'description' => __( 'Disable post types if you are wanting a minimal site.', 'lsx-health-plan' ), |
|
| 509 | + 'name' => __('Disable Post Types', 'lsx-health-plan'), |
|
| 510 | + 'default' => __('Disable Post Types', 'lsx-health-plan'), |
|
| 511 | + 'description' => __('Disable post types if you are wanting a minimal site.', 'lsx-health-plan'), |
|
| 512 | 512 | ) |
| 513 | 513 | ); |
| 514 | 514 | |
| 515 | - foreach ( $post_types as $post_type ) { |
|
| 516 | - if ( 'plan' === $post_type || 'exercise' === $post_type || ( 'video' === $post_type && false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) ) { |
|
| 515 | + foreach ($post_types as $post_type) { |
|
| 516 | + if ('plan' === $post_type || 'exercise' === $post_type || ('video' === $post_type && false !== \lsx_health_plan\functions\get_option('exercise_enabled', false))) { |
|
| 517 | 517 | continue; |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | $cmb->add_field( |
| 521 | 521 | array( |
| 522 | - 'name' => ucwords( $post_type ), |
|
| 522 | + 'name' => ucwords($post_type), |
|
| 523 | 523 | 'id' => $post_type . '_disabled', |
| 524 | 524 | 'type' => 'checkbox', |
| 525 | 525 | 'value' => 1, |
@@ -539,19 +539,19 @@ discard block |
||
| 539 | 539 | array( |
| 540 | 540 | 'id' => 'post_type_toggles_enable_title', |
| 541 | 541 | 'type' => 'title', |
| 542 | - 'name' => __( 'Enable Post Types', 'lsx-health-plan' ), |
|
| 543 | - 'default' => __( 'Enable Post Types', 'lsx-health-plan' ), |
|
| 544 | - 'description' => __( 'Enable new functionality like the "exercise" post type.', 'lsx-health-plan' ), |
|
| 542 | + 'name' => __('Enable Post Types', 'lsx-health-plan'), |
|
| 543 | + 'default' => __('Enable Post Types', 'lsx-health-plan'), |
|
| 544 | + 'description' => __('Enable new functionality like the "exercise" post type.', 'lsx-health-plan'), |
|
| 545 | 545 | ) |
| 546 | 546 | ); |
| 547 | 547 | $cmb->add_field( |
| 548 | 548 | array( |
| 549 | - 'name' => __( 'Exercises', 'lsx-health-plan' ), |
|
| 549 | + 'name' => __('Exercises', 'lsx-health-plan'), |
|
| 550 | 550 | 'id' => 'exercise_enabled', |
| 551 | 551 | 'type' => 'checkbox', |
| 552 | 552 | 'value' => 1, |
| 553 | 553 | 'default' => 0, |
| 554 | - 'description' => __( 'Enabling the exercise post type will automatically replace the Video post type.', 'lsx-health-plan' ), |
|
| 554 | + 'description' => __('Enabling the exercise post type will automatically replace the Video post type.', 'lsx-health-plan'), |
|
| 555 | 555 | ) |
| 556 | 556 | ); |
| 557 | 557 | $cmb->add_field( |
@@ -568,18 +568,18 @@ discard block |
||
| 568 | 568 | * @return void |
| 569 | 569 | */ |
| 570 | 570 | |
| 571 | - public function stat_disable( $cmb ) { |
|
| 571 | + public function stat_disable($cmb) { |
|
| 572 | 572 | $cmb->add_field( |
| 573 | 573 | array( |
| 574 | 574 | 'id' => 'stat_disable_title', |
| 575 | 575 | 'type' => 'title', |
| 576 | - 'name' => __( 'Disable Profile Stats', 'lsx-health-plan' ), |
|
| 577 | - 'default' => __( 'Disable Profile Stats', 'lsx-health-plan' ), |
|
| 576 | + 'name' => __('Disable Profile Stats', 'lsx-health-plan'), |
|
| 577 | + 'default' => __('Disable Profile Stats', 'lsx-health-plan'), |
|
| 578 | 578 | ) |
| 579 | 579 | ); |
| 580 | 580 | $cmb->add_field( |
| 581 | 581 | array( |
| 582 | - 'name' => __( 'Disable All Stats', 'lsx-health-plan' ), |
|
| 582 | + 'name' => __('Disable All Stats', 'lsx-health-plan'), |
|
| 583 | 583 | 'desc' => 'Disable All Stats', |
| 584 | 584 | 'id' => 'disable_all_stats', |
| 585 | 585 | 'type' => 'checkbox', |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | ); |
| 590 | 590 | $cmb->add_field( |
| 591 | 591 | array( |
| 592 | - 'name' => __( 'Disable Weight', 'lsx-health-plan' ), |
|
| 592 | + 'name' => __('Disable Weight', 'lsx-health-plan'), |
|
| 593 | 593 | 'id' => 'disable_weight_checkbox', |
| 594 | 594 | 'type' => 'checkbox', |
| 595 | 595 | 'value' => 1, |
@@ -598,7 +598,7 @@ discard block |
||
| 598 | 598 | ); |
| 599 | 599 | $cmb->add_field( |
| 600 | 600 | array( |
| 601 | - 'name' => __( 'Disable Waist', 'lsx-health-plan' ), |
|
| 601 | + 'name' => __('Disable Waist', 'lsx-health-plan'), |
|
| 602 | 602 | 'id' => 'disable_waist_checkbox', |
| 603 | 603 | 'type' => 'checkbox', |
| 604 | 604 | 'value' => 1, |
@@ -607,7 +607,7 @@ discard block |
||
| 607 | 607 | ); |
| 608 | 608 | $cmb->add_field( |
| 609 | 609 | array( |
| 610 | - 'name' => __( 'Disable Fitness', 'lsx-health-plan' ), |
|
| 610 | + 'name' => __('Disable Fitness', 'lsx-health-plan'), |
|
| 611 | 611 | 'id' => 'disable_fitness_checkbox', |
| 612 | 612 | 'type' => 'checkbox', |
| 613 | 613 | 'value' => 1, |
@@ -629,10 +629,10 @@ discard block |
||
| 629 | 629 | * @param string $section either engine,archive or single. |
| 630 | 630 | * @return void |
| 631 | 631 | */ |
| 632 | - public function generate_tabs( $cmb ) { |
|
| 632 | + public function generate_tabs($cmb) { |
|
| 633 | 633 | $tabs = $this->get_settings_tabs(); |
| 634 | 634 | |
| 635 | - foreach ( $tabs as $tab_key => $tab ) { |
|
| 635 | + foreach ($tabs as $tab_key => $tab) { |
|
| 636 | 636 | $cmb->add_field( |
| 637 | 637 | array( |
| 638 | 638 | 'id' => 'settings_' . $tab_key . '_title', |
@@ -642,11 +642,11 @@ discard block |
||
| 642 | 642 | 'description' => $tab['desc'], |
| 643 | 643 | ) |
| 644 | 644 | ); |
| 645 | - do_action( 'lsx_hp_settings_page_' . $tab_key . '_top', $cmb ); |
|
| 645 | + do_action('lsx_hp_settings_page_' . $tab_key . '_top', $cmb); |
|
| 646 | 646 | |
| 647 | - do_action( 'lsx_hp_settings_page_' . $tab_key . '_middle', $cmb ); |
|
| 647 | + do_action('lsx_hp_settings_page_' . $tab_key . '_middle', $cmb); |
|
| 648 | 648 | |
| 649 | - do_action( 'lsx_hp_settings_page_' . $tab_key . '_bottom', $cmb ); |
|
| 649 | + do_action('lsx_hp_settings_page_' . $tab_key . '_bottom', $cmb); |
|
| 650 | 650 | |
| 651 | 651 | $cmb->add_field( |
| 652 | 652 | array( |
@@ -666,26 +666,26 @@ discard block |
||
| 666 | 666 | public function get_settings_tabs() { |
| 667 | 667 | $tabs = array( |
| 668 | 668 | 'general' => array( |
| 669 | - 'title' => __( 'General', 'lsx-health-plan' ), |
|
| 670 | - 'desc' => __( 'Control the sitewide settings for the LSX HP site.', 'lsx-health-plan' ), |
|
| 669 | + 'title' => __('General', 'lsx-health-plan'), |
|
| 670 | + 'desc' => __('Control the sitewide settings for the LSX HP site.', 'lsx-health-plan'), |
|
| 671 | 671 | ), |
| 672 | 672 | ); |
| 673 | 673 | |
| 674 | - foreach ( $this->post_types as $post_type ) { |
|
| 675 | - switch ( $post_type ) { |
|
| 674 | + foreach ($this->post_types as $post_type) { |
|
| 675 | + switch ($post_type) { |
|
| 676 | 676 | default: |
| 677 | 677 | //if ( ! in_array( $post_type, \lsx\search\includes\get_restricted_post_types() ) ) { |
| 678 | - $temp_post_type = get_post_type_object( $post_type ); |
|
| 679 | - if ( ! is_wp_error( $temp_post_type ) ) { |
|
| 680 | - $page_url = get_post_type_archive_link( $temp_post_type->name ); |
|
| 678 | + $temp_post_type = get_post_type_object($post_type); |
|
| 679 | + if ( ! is_wp_error($temp_post_type)) { |
|
| 680 | + $page_url = get_post_type_archive_link($temp_post_type->name); |
|
| 681 | 681 | $description = sprintf( |
| 682 | 682 | /* translators: %s: The subscription info */ |
| 683 | - __( 'Control the settings for your <a target="_blank" href="%1$s">%2$s</a> archive.', 'lsx-search' ), |
|
| 683 | + __('Control the settings for your <a target="_blank" href="%1$s">%2$s</a> archive.', 'lsx-search'), |
|
| 684 | 684 | $page_url, |
| 685 | 685 | $temp_post_type->label |
| 686 | 686 | ); |
| 687 | 687 | |
| 688 | - $tabs[ $post_type ] = array( |
|
| 688 | + $tabs[$post_type] = array( |
|
| 689 | 689 | 'title' => $temp_post_type->label, |
| 690 | 690 | 'desc' => $description, |
| 691 | 691 | ); |