@@ -31,25 +31,25 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function __construct() { |
| 33 | 33 | |
| 34 | - if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) { |
|
| 34 | + if (false !== \lsx_health_plan\functions\get_option('exercise_enabled', false)) { |
|
| 35 | 35 | // Post Type and Taxonomies. |
| 36 | - add_action( 'init', array( $this, 'register_post_type' ) ); |
|
| 37 | - add_action( 'init', array( $this, 'exercise_type_taxonomy_setup' ) ); |
|
| 38 | - add_action( 'init', array( $this, 'equipment_taxonomy_setup' ) ); |
|
| 39 | - add_action( 'init', array( $this, 'muscle_group_taxonomy_setup' ) ); |
|
| 40 | - add_action( 'admin_menu', array( $this, 'register_menus' ) ); |
|
| 36 | + add_action('init', array($this, 'register_post_type')); |
|
| 37 | + add_action('init', array($this, 'exercise_type_taxonomy_setup')); |
|
| 38 | + add_action('init', array($this, 'equipment_taxonomy_setup')); |
|
| 39 | + add_action('init', array($this, 'muscle_group_taxonomy_setup')); |
|
| 40 | + add_action('admin_menu', array($this, 'register_menus')); |
|
| 41 | 41 | |
| 42 | 42 | // Custom Fields. |
| 43 | - add_action( 'cmb2_admin_init', array( $this, 'exercise_details' ), 8 ); |
|
| 44 | - add_action( 'cmb2_admin_init', array( $this, 'gallery_metabox' ), 9 ); |
|
| 45 | - add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 ); |
|
| 43 | + add_action('cmb2_admin_init', array($this, 'exercise_details'), 8); |
|
| 44 | + add_action('cmb2_admin_init', array($this, 'gallery_metabox'), 9); |
|
| 45 | + add_filter('lsx_health_plan_connections', array($this, 'enable_connections'), 10, 1); |
|
| 46 | 46 | |
| 47 | 47 | // Template Redirects. |
| 48 | - add_filter( 'lsx_health_plan_archive_template', array( $this, 'enable_post_type' ), 10, 1 ); |
|
| 49 | - add_filter( 'lsx_health_plan_single_template', array( $this, 'enable_post_type' ), 10, 1 ); |
|
| 48 | + add_filter('lsx_health_plan_archive_template', array($this, 'enable_post_type'), 10, 1); |
|
| 49 | + add_filter('lsx_health_plan_single_template', array($this, 'enable_post_type'), 10, 1); |
|
| 50 | 50 | |
| 51 | 51 | //Breadcrumbs |
| 52 | - add_filter( 'woocommerce_get_breadcrumb', array( $this, 'exercise_breadcrumb_filter' ), 30, 1 ); |
|
| 52 | + add_filter('woocommerce_get_breadcrumb', array($this, 'exercise_breadcrumb_filter'), 30, 1); |
|
| 53 | 53 | |
| 54 | 54 | } |
| 55 | 55 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public static function get_instance() { |
| 67 | 67 | // If the single instance hasn't been set, set it now. |
| 68 | - if ( null === self::$instance ) { |
|
| 68 | + if (null === self::$instance) { |
|
| 69 | 69 | self::$instance = new self(); |
| 70 | 70 | } |
| 71 | 71 | return self::$instance; |
@@ -75,21 +75,21 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function register_post_type() { |
| 77 | 77 | $labels = array( |
| 78 | - 'name' => esc_html__( 'Exercises', 'lsx-health-plan' ), |
|
| 79 | - 'singular_name' => esc_html__( 'Exercise', 'lsx-health-plan' ), |
|
| 80 | - 'add_new' => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ), |
|
| 81 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
| 82 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
| 83 | - 'new_item' => esc_html__( 'New', 'lsx-health-plan' ), |
|
| 84 | - 'all_items' => esc_html__( 'All Exercises', 'lsx-health-plan' ), |
|
| 85 | - 'view_item' => esc_html__( 'View', 'lsx-health-plan' ), |
|
| 86 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
| 87 | - 'not_found' => esc_html__( 'None found', 'lsx-health-plan' ), |
|
| 88 | - 'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ), |
|
| 78 | + 'name' => esc_html__('Exercises', 'lsx-health-plan'), |
|
| 79 | + 'singular_name' => esc_html__('Exercise', 'lsx-health-plan'), |
|
| 80 | + 'add_new' => esc_html_x('Add New', 'post type general name', 'lsx-health-plan'), |
|
| 81 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
| 82 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
| 83 | + 'new_item' => esc_html__('New', 'lsx-health-plan'), |
|
| 84 | + 'all_items' => esc_html__('All Exercises', 'lsx-health-plan'), |
|
| 85 | + 'view_item' => esc_html__('View', 'lsx-health-plan'), |
|
| 86 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
| 87 | + 'not_found' => esc_html__('None found', 'lsx-health-plan'), |
|
| 88 | + 'not_found_in_trash' => esc_html__('None found in Trash', 'lsx-health-plan'), |
|
| 89 | 89 | 'parent_item_colon' => '', |
| 90 | - 'menu_name' => esc_html__( 'Exercises', 'lsx-health-plan' ), |
|
| 90 | + 'menu_name' => esc_html__('Exercises', 'lsx-health-plan'), |
|
| 91 | 91 | ); |
| 92 | - $args = array( |
|
| 92 | + $args = array( |
|
| 93 | 93 | 'labels' => $labels, |
| 94 | 94 | 'public' => true, |
| 95 | 95 | 'publicly_queryable' => true, |
@@ -99,10 +99,10 @@ discard block |
||
| 99 | 99 | 'menu_icon' => 'dashicons-universal-access', |
| 100 | 100 | 'query_var' => true, |
| 101 | 101 | 'rewrite' => array( |
| 102 | - 'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ), |
|
| 102 | + 'slug' => \lsx_health_plan\functions\get_option('endpoint_exercise_single', 'exercise'), |
|
| 103 | 103 | ), |
| 104 | 104 | 'capability_type' => 'page', |
| 105 | - 'has_archive' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_archive', 'exercises' ), |
|
| 105 | + 'has_archive' => \lsx_health_plan\functions\get_option('endpoint_exercise_archive', 'exercises'), |
|
| 106 | 106 | 'hierarchical' => false, |
| 107 | 107 | 'menu_position' => null, |
| 108 | 108 | 'supports' => array( |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | 'custom-fields', |
| 114 | 114 | ), |
| 115 | 115 | ); |
| 116 | - register_post_type( 'exercise', $args ); |
|
| 116 | + register_post_type('exercise', $args); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -123,17 +123,17 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public function exercise_type_taxonomy_setup() { |
| 125 | 125 | $labels = array( |
| 126 | - 'name' => esc_html_x( 'Exercise Type', 'taxonomy general name', 'lsx-health-plan' ), |
|
| 127 | - 'singular_name' => esc_html_x( 'Exercise Type', 'taxonomy singular name', 'lsx-health-plan' ), |
|
| 128 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
| 129 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
| 130 | - 'parent_item' => esc_html__( 'Parent', 'lsx-health-plan' ), |
|
| 131 | - 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ), |
|
| 132 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
| 133 | - 'update_item' => esc_html__( 'Update', 'lsx-health-plan' ), |
|
| 134 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
| 135 | - 'new_item_name' => esc_html__( 'New Name', 'lsx-health-plan' ), |
|
| 136 | - 'menu_name' => esc_html__( 'Exercise Types', 'lsx-health-plan' ), |
|
| 126 | + 'name' => esc_html_x('Exercise Type', 'taxonomy general name', 'lsx-health-plan'), |
|
| 127 | + 'singular_name' => esc_html_x('Exercise Type', 'taxonomy singular name', 'lsx-health-plan'), |
|
| 128 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
| 129 | + 'all_items' => esc_html__('All', 'lsx-health-plan'), |
|
| 130 | + 'parent_item' => esc_html__('Parent', 'lsx-health-plan'), |
|
| 131 | + 'parent_item_colon' => esc_html__('Parent:', 'lsx-health-plan'), |
|
| 132 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
| 133 | + 'update_item' => esc_html__('Update', 'lsx-health-plan'), |
|
| 134 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
| 135 | + 'new_item_name' => esc_html__('New Name', 'lsx-health-plan'), |
|
| 136 | + 'menu_name' => esc_html__('Exercise Types', 'lsx-health-plan'), |
|
| 137 | 137 | ); |
| 138 | 138 | |
| 139 | 139 | $args = array( |
@@ -143,12 +143,12 @@ discard block |
||
| 143 | 143 | 'show_admin_column' => true, |
| 144 | 144 | 'query_var' => true, |
| 145 | 145 | 'rewrite' => array( |
| 146 | - 'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_type', 'exercise-type' ), |
|
| 146 | + 'slug' => \lsx_health_plan\functions\get_option('endpoint_exercise_type', 'exercise-type'), |
|
| 147 | 147 | ), |
| 148 | 148 | 'show_in_rest' => true, |
| 149 | 149 | ); |
| 150 | 150 | |
| 151 | - register_taxonomy( 'exercise-type', array( 'exercise' ), $args ); |
|
| 151 | + register_taxonomy('exercise-type', array('exercise'), $args); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
@@ -158,17 +158,17 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | public function equipment_taxonomy_setup() { |
| 160 | 160 | $labels = array( |
| 161 | - 'name' => esc_html_x( 'Equipment', 'taxonomy general name', 'lsx-health-plan' ), |
|
| 162 | - 'singular_name' => esc_html_x( 'Equipment', 'taxonomy singular name', 'lsx-health-plan' ), |
|
| 163 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
| 164 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
| 165 | - 'parent_item' => esc_html__( 'Parent', 'lsx-health-plan' ), |
|
| 166 | - 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ), |
|
| 167 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
| 168 | - 'update_item' => esc_html__( 'Update', 'lsx-health-plan' ), |
|
| 169 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
| 170 | - 'new_item_name' => esc_html__( 'New Name', 'lsx-health-plan' ), |
|
| 171 | - 'menu_name' => esc_html__( 'Equipment', 'lsx-health-plan' ), |
|
| 161 | + 'name' => esc_html_x('Equipment', 'taxonomy general name', 'lsx-health-plan'), |
|
| 162 | + 'singular_name' => esc_html_x('Equipment', 'taxonomy singular name', 'lsx-health-plan'), |
|
| 163 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
| 164 | + 'all_items' => esc_html__('All', 'lsx-health-plan'), |
|
| 165 | + 'parent_item' => esc_html__('Parent', 'lsx-health-plan'), |
|
| 166 | + 'parent_item_colon' => esc_html__('Parent:', 'lsx-health-plan'), |
|
| 167 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
| 168 | + 'update_item' => esc_html__('Update', 'lsx-health-plan'), |
|
| 169 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
| 170 | + 'new_item_name' => esc_html__('New Name', 'lsx-health-plan'), |
|
| 171 | + 'menu_name' => esc_html__('Equipment', 'lsx-health-plan'), |
|
| 172 | 172 | ); |
| 173 | 173 | |
| 174 | 174 | $args = array( |
@@ -178,12 +178,12 @@ discard block |
||
| 178 | 178 | 'show_admin_column' => true, |
| 179 | 179 | 'query_var' => true, |
| 180 | 180 | 'rewrite' => array( |
| 181 | - 'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_equipment', 'equipment' ), |
|
| 181 | + 'slug' => \lsx_health_plan\functions\get_option('endpoint_exercise_equipment', 'equipment'), |
|
| 182 | 182 | ), |
| 183 | 183 | 'show_in_rest' => true, |
| 184 | 184 | ); |
| 185 | 185 | |
| 186 | - register_taxonomy( 'equipment', array( 'exercise' ), $args ); |
|
| 186 | + register_taxonomy('equipment', array('exercise'), $args); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
@@ -193,17 +193,17 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | public function muscle_group_taxonomy_setup() { |
| 195 | 195 | $labels = array( |
| 196 | - 'name' => esc_html_x( 'Muscle Groups', 'taxonomy general name', 'lsx-health-plan' ), |
|
| 197 | - 'singular_name' => esc_html_x( 'Muscle Group', 'taxonomy singular name', 'lsx-health-plan' ), |
|
| 198 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
| 199 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
| 200 | - 'parent_item' => esc_html__( 'Parent', 'lsx-health-plan' ), |
|
| 201 | - 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ), |
|
| 202 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
| 203 | - 'update_item' => esc_html__( 'Update', 'lsx-health-plan' ), |
|
| 204 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
| 205 | - 'new_item_name' => esc_html__( 'New Name', 'lsx-health-plan' ), |
|
| 206 | - 'menu_name' => esc_html__( 'Muscle Groups', 'lsx-health-plan' ), |
|
| 196 | + 'name' => esc_html_x('Muscle Groups', 'taxonomy general name', 'lsx-health-plan'), |
|
| 197 | + 'singular_name' => esc_html_x('Muscle Group', 'taxonomy singular name', 'lsx-health-plan'), |
|
| 198 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
| 199 | + 'all_items' => esc_html__('All', 'lsx-health-plan'), |
|
| 200 | + 'parent_item' => esc_html__('Parent', 'lsx-health-plan'), |
|
| 201 | + 'parent_item_colon' => esc_html__('Parent:', 'lsx-health-plan'), |
|
| 202 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
| 203 | + 'update_item' => esc_html__('Update', 'lsx-health-plan'), |
|
| 204 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
| 205 | + 'new_item_name' => esc_html__('New Name', 'lsx-health-plan'), |
|
| 206 | + 'menu_name' => esc_html__('Muscle Groups', 'lsx-health-plan'), |
|
| 207 | 207 | ); |
| 208 | 208 | |
| 209 | 209 | $args = array( |
@@ -213,12 +213,12 @@ discard block |
||
| 213 | 213 | 'show_admin_column' => true, |
| 214 | 214 | 'query_var' => true, |
| 215 | 215 | 'rewrite' => array( |
| 216 | - 'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_musclegroup', 'muscle-group' ), |
|
| 216 | + 'slug' => \lsx_health_plan\functions\get_option('endpoint_exercise_musclegroup', 'muscle-group'), |
|
| 217 | 217 | ), |
| 218 | 218 | 'show_in_rest' => true, |
| 219 | 219 | ); |
| 220 | 220 | |
| 221 | - register_taxonomy( 'muscle-group', array( 'exercise' ), $args ); |
|
| 221 | + register_taxonomy('muscle-group', array('exercise'), $args); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | /** |
@@ -227,10 +227,10 @@ discard block |
||
| 227 | 227 | * @return void |
| 228 | 228 | */ |
| 229 | 229 | public function register_menus() { |
| 230 | - add_submenu_page( 'edit.php?post_type=workout', esc_html__( 'Exercises', 'lsx-health-plan' ), esc_html__( 'Exercises', 'lsx-health-plan' ), 'edit_posts', 'edit.php?post_type=exercise' ); |
|
| 231 | - add_submenu_page( 'edit.php?post_type=workout', esc_html__( 'Exercise Types', 'lsx-health-plan' ), esc_html__( 'Exercise Types', 'lsx-health-plan' ), 'edit_posts', 'edit-tags.php?taxonomy=exercise-type&post_type=exercise' ); |
|
| 232 | - add_submenu_page( 'edit.php?post_type=workout', esc_html__( 'Equipment', 'lsx-health-plan' ), esc_html__( 'Equipment', 'lsx-health-plan' ), 'edit_posts', 'edit-tags.php?taxonomy=equipment&post_type=exercise' ); |
|
| 233 | - add_submenu_page( 'edit.php?post_type=workout', esc_html__( 'Muscle Groups', 'lsx-health-plan' ), esc_html__( 'Muscle Groups', 'lsx-health-plan' ), 'edit_posts', 'edit-tags.php?taxonomy=muscle-group&post_type=exercise' ); |
|
| 230 | + add_submenu_page('edit.php?post_type=workout', esc_html__('Exercises', 'lsx-health-plan'), esc_html__('Exercises', 'lsx-health-plan'), 'edit_posts', 'edit.php?post_type=exercise'); |
|
| 231 | + add_submenu_page('edit.php?post_type=workout', esc_html__('Exercise Types', 'lsx-health-plan'), esc_html__('Exercise Types', 'lsx-health-plan'), 'edit_posts', 'edit-tags.php?taxonomy=exercise-type&post_type=exercise'); |
|
| 232 | + add_submenu_page('edit.php?post_type=workout', esc_html__('Equipment', 'lsx-health-plan'), esc_html__('Equipment', 'lsx-health-plan'), 'edit_posts', 'edit-tags.php?taxonomy=equipment&post_type=exercise'); |
|
| 233 | + add_submenu_page('edit.php?post_type=workout', esc_html__('Muscle Groups', 'lsx-health-plan'), esc_html__('Muscle Groups', 'lsx-health-plan'), 'edit_posts', 'edit-tags.php?taxonomy=muscle-group&post_type=exercise'); |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | /** |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | * @param array $post_types |
| 240 | 240 | * @return array |
| 241 | 241 | */ |
| 242 | - public function enable_post_type( $post_types = array() ) { |
|
| 242 | + public function enable_post_type($post_types = array()) { |
|
| 243 | 243 | $post_types[] = $this->slug; |
| 244 | 244 | return $post_types; |
| 245 | 245 | } |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | * @param array $connections |
| 251 | 251 | * @return void |
| 252 | 252 | */ |
| 253 | - public function enable_connections( $connections = array() ) { |
|
| 253 | + public function enable_connections($connections = array()) { |
|
| 254 | 254 | $connections['exercise']['connected_workouts'] = 'connected_exercises'; |
| 255 | 255 | $connections['workout']['connected_exercises'] = 'connected_workouts'; |
| 256 | 256 | return $connections; |
@@ -263,8 +263,8 @@ discard block |
||
| 263 | 263 | $cmb = new_cmb2_box( |
| 264 | 264 | array( |
| 265 | 265 | 'id' => $this->slug . '_gallery_details_metabox', |
| 266 | - 'title' => __( 'Exercise Gallery', 'lsx-health-plan' ), |
|
| 267 | - 'object_types' => array( $this->slug ), |
|
| 266 | + 'title' => __('Exercise Gallery', 'lsx-health-plan'), |
|
| 267 | + 'object_types' => array($this->slug), |
|
| 268 | 268 | 'context' => 'normal', |
| 269 | 269 | 'priority' => 'low', |
| 270 | 270 | 'show_names' => true, |
@@ -273,12 +273,12 @@ discard block |
||
| 273 | 273 | |
| 274 | 274 | $cmb->add_field( |
| 275 | 275 | array( |
| 276 | - 'name' => __( 'Layout', 'lsx-health-plan' ), |
|
| 276 | + 'name' => __('Layout', 'lsx-health-plan'), |
|
| 277 | 277 | 'id' => $this->slug . '_gallery_layout', |
| 278 | 278 | 'type' => 'radio', |
| 279 | 279 | 'options' => array( |
| 280 | - 'slider' => __( 'Slider', 'lsx-health-plan' ) . ' {#}', // {#} gets replaced by row number |
|
| 281 | - 'grid' => __( 'Grid', 'lsx-health-plan' ), |
|
| 280 | + 'slider' => __('Slider', 'lsx-health-plan') . ' {#}', // {#} gets replaced by row number |
|
| 281 | + 'grid' => __('Grid', 'lsx-health-plan'), |
|
| 282 | 282 | ), |
| 283 | 283 | 'default' => 'grid', |
| 284 | 284 | ) |
@@ -286,12 +286,12 @@ discard block |
||
| 286 | 286 | |
| 287 | 287 | $cmb->add_field( |
| 288 | 288 | array( |
| 289 | - 'name' => __( 'Grid Columns', 'lsx-health-plan' ), |
|
| 289 | + 'name' => __('Grid Columns', 'lsx-health-plan'), |
|
| 290 | 290 | 'id' => $this->slug . '_gallery_columns', |
| 291 | 291 | 'type' => 'select', |
| 292 | 292 | 'options' => array( |
| 293 | - '3' => __( '2 Columns', 'lsx-health-plan' ), |
|
| 294 | - '4' => __( '3 Columns', 'lsx-health-plan' ), |
|
| 293 | + '3' => __('2 Columns', 'lsx-health-plan'), |
|
| 294 | + '4' => __('3 Columns', 'lsx-health-plan'), |
|
| 295 | 295 | ), |
| 296 | 296 | 'default' => '1', |
| 297 | 297 | ) |
@@ -303,12 +303,12 @@ discard block |
||
| 303 | 303 | 'id' => $this->slug . '_gallery', |
| 304 | 304 | 'type' => 'group', |
| 305 | 305 | 'options' => array( |
| 306 | - 'group_title' => __( 'Gallery', 'lsx-health-plan' ) . ' {#}', // {#} gets replaced by row number |
|
| 307 | - 'add_button' => __( 'Add Item', 'lsx-health-plan' ), |
|
| 308 | - 'remove_button' => __( 'Remove Item', 'lsx-health-plan' ), |
|
| 306 | + 'group_title' => __('Gallery', 'lsx-health-plan') . ' {#}', // {#} gets replaced by row number |
|
| 307 | + 'add_button' => __('Add Item', 'lsx-health-plan'), |
|
| 308 | + 'remove_button' => __('Remove Item', 'lsx-health-plan'), |
|
| 309 | 309 | 'sortable' => true, |
| 310 | 310 | ), |
| 311 | - 'desc' => __( 'Upload only one image, video or gif per gallery group, each group will only display 1 item.', 'lsx-health-plan' ), |
|
| 311 | + 'desc' => __('Upload only one image, video or gif per gallery group, each group will only display 1 item.', 'lsx-health-plan'), |
|
| 312 | 312 | 'classes' => 'lsx-admin-row', |
| 313 | 313 | ) |
| 314 | 314 | ); |
@@ -317,13 +317,13 @@ discard block |
||
| 317 | 317 | $cmb->add_group_field( |
| 318 | 318 | $gallery_group, |
| 319 | 319 | array( |
| 320 | - 'name' => __( 'Image', 'lsx-health-plan' ), |
|
| 320 | + 'name' => __('Image', 'lsx-health-plan'), |
|
| 321 | 321 | 'id' => $this->slug . '_gallery_image', |
| 322 | 322 | 'type' => 'file', |
| 323 | 323 | 'text' => array( |
| 324 | - 'add_upload_file_text' => __( 'Add File', 'lsx-health-plan' ), |
|
| 324 | + 'add_upload_file_text' => __('Add File', 'lsx-health-plan'), |
|
| 325 | 325 | ), |
| 326 | - 'desc' => __( 'Upload an image a minimum of 800px x 600px in size.', 'lsx-health-plan' ), |
|
| 326 | + 'desc' => __('Upload an image a minimum of 800px x 600px in size.', 'lsx-health-plan'), |
|
| 327 | 327 | 'query_args' => array( |
| 328 | 328 | 'type' => array( |
| 329 | 329 | 'image/gif', |
@@ -340,10 +340,10 @@ discard block |
||
| 340 | 340 | $cmb->add_group_field( |
| 341 | 341 | $gallery_group, |
| 342 | 342 | array( |
| 343 | - 'name' => __( 'oEmbed', 'lsx-health-plan' ), |
|
| 343 | + 'name' => __('oEmbed', 'lsx-health-plan'), |
|
| 344 | 344 | 'id' => $this->slug . '_gallery_embed', |
| 345 | 345 | 'type' => 'text', |
| 346 | - 'desc' => __( 'Drop in the embed url for your video from YouTube, Vimeo or DailyMotion, e.g: "https://www.youtube.com/watch?v=9xwazD5SyVg". A full list of supports formats can be found at <a href="https://make.wordpress.org/support/user-manual/content/media/adding-media-to-your-pages-and-posts/embedding-media-from-other-sites/">WordPress</a>', 'lsx-health-plan' ), |
|
| 346 | + 'desc' => __('Drop in the embed url for your video from YouTube, Vimeo or DailyMotion, e.g: "https://www.youtube.com/watch?v=9xwazD5SyVg". A full list of supports formats can be found at <a href="https://make.wordpress.org/support/user-manual/content/media/adding-media-to-your-pages-and-posts/embedding-media-from-other-sites/">WordPress</a>', 'lsx-health-plan'), |
|
| 347 | 347 | 'classes' => 'test-apply-form lsx-field-col lsx-field-col-50', |
| 348 | 348 | ) |
| 349 | 349 | ); |
@@ -351,10 +351,10 @@ discard block |
||
| 351 | 351 | $cmb->add_group_field( |
| 352 | 352 | $gallery_group, |
| 353 | 353 | array( |
| 354 | - 'name' => __( 'External Media', 'lsx-health-plan' ), |
|
| 354 | + 'name' => __('External Media', 'lsx-health-plan'), |
|
| 355 | 355 | 'id' => $this->slug . '_gallery_external', |
| 356 | 356 | 'type' => 'textarea_code', |
| 357 | - 'desc' => __( 'Drop in the iFrame embed code from Giphy in this field, i.e: <iframe src="https://giphy.com/embed/3o7527Rn1HxXWqgxuo" width="480" height="270" frameborder="0" class="giphy-embed" allowfullscreen></iframe>', 'lsx-health-plan' ), |
|
| 357 | + 'desc' => __('Drop in the iFrame embed code from Giphy in this field, i.e: <iframe src="https://giphy.com/embed/3o7527Rn1HxXWqgxuo" width="480" height="270" frameborder="0" class="giphy-embed" allowfullscreen></iframe>', 'lsx-health-plan'), |
|
| 358 | 358 | 'classes' => 'lsx-field-col lsx-field-col-50', |
| 359 | 359 | ) |
| 360 | 360 | ); |
@@ -369,8 +369,8 @@ discard block |
||
| 369 | 369 | $cmb = new_cmb2_box( |
| 370 | 370 | array( |
| 371 | 371 | 'id' => $this->slug . '_general_details_metabox', |
| 372 | - 'title' => __( 'Details', 'lsx-health-plan' ), |
|
| 373 | - 'object_types' => array( $this->slug ), |
|
| 372 | + 'title' => __('Details', 'lsx-health-plan'), |
|
| 373 | + 'object_types' => array($this->slug), |
|
| 374 | 374 | 'context' => 'normal', |
| 375 | 375 | 'priority' => 'high', |
| 376 | 376 | 'show_names' => true, |
@@ -379,15 +379,15 @@ discard block |
||
| 379 | 379 | |
| 380 | 380 | $cmb->add_field( |
| 381 | 381 | array( |
| 382 | - 'name' => __( 'Side', 'lsx-health-plan' ), |
|
| 382 | + 'name' => __('Side', 'lsx-health-plan'), |
|
| 383 | 383 | 'id' => $this->slug . '_side', |
| 384 | 384 | 'type' => 'select', |
| 385 | 385 | 'options' => array( |
| 386 | - '' => __( 'Select', 'lsx-health-plan' ), |
|
| 387 | - 'left' => __( 'Left', 'lsx-health-plan' ), |
|
| 388 | - 'right' => __( 'Right', 'lsx-health-plan' ), |
|
| 386 | + '' => __('Select', 'lsx-health-plan'), |
|
| 387 | + 'left' => __('Left', 'lsx-health-plan'), |
|
| 388 | + 'right' => __('Right', 'lsx-health-plan'), |
|
| 389 | 389 | ), |
| 390 | - 'desc' => __( 'Select which side this exercise uses. ', 'lsx-health-plan' ), |
|
| 390 | + 'desc' => __('Select which side this exercise uses. ', 'lsx-health-plan'), |
|
| 391 | 391 | ) |
| 392 | 392 | ); |
| 393 | 393 | } |
@@ -398,16 +398,16 @@ discard block |
||
| 398 | 398 | * @var array $crumbs |
| 399 | 399 | * @return array |
| 400 | 400 | */ |
| 401 | - public function exercise_breadcrumb_filter( $crumbs ) { |
|
| 402 | - $exercise = \lsx_health_plan\functions\get_option( 'endpoint_exercise', 'exercise' ); |
|
| 403 | - $exercises = \lsx_health_plan\functions\get_option( 'endpoint_exercise_archive', 'exercise' ); |
|
| 404 | - $url = get_post_type_archive_link( $exercise ); |
|
| 401 | + public function exercise_breadcrumb_filter($crumbs) { |
|
| 402 | + $exercise = \lsx_health_plan\functions\get_option('endpoint_exercise', 'exercise'); |
|
| 403 | + $exercises = \lsx_health_plan\functions\get_option('endpoint_exercise_archive', 'exercise'); |
|
| 404 | + $url = get_post_type_archive_link($exercise); |
|
| 405 | 405 | |
| 406 | - if ( is_singular( 'exercise' ) ) { |
|
| 406 | + if (is_singular('exercise')) { |
|
| 407 | 407 | $exercise_name = get_the_title(); |
| 408 | - $term_obj_list = get_the_terms( get_the_ID(), 'exercise-type' ); |
|
| 408 | + $term_obj_list = get_the_terms(get_the_ID(), 'exercise-type'); |
|
| 409 | 409 | $exercise_type = $term_obj_list[0]->name; |
| 410 | - $exercise_type_url = get_term_link( $term_obj_list[0]->term_id ); |
|
| 410 | + $exercise_type_url = get_term_link($term_obj_list[0]->term_id); |
|
| 411 | 411 | |
| 412 | 412 | $crumbs[1] = array( |
| 413 | 413 | 0 => $exercises, |
@@ -421,10 +421,10 @@ discard block |
||
| 421 | 421 | 0 => $exercise_name, |
| 422 | 422 | ); |
| 423 | 423 | } |
| 424 | - if ( is_tax( 'exercise-type' ) || is_tax( 'muscle-group' ) || is_tax( 'equipment' ) ) { |
|
| 425 | - $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); |
|
| 424 | + if (is_tax('exercise-type') || is_tax('muscle-group') || is_tax('equipment')) { |
|
| 425 | + $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy')); |
|
| 426 | 426 | |
| 427 | - $single_term_title = str_replace( '-', ' ', $term->taxonomy ) . ': ' . $term->name; |
|
| 427 | + $single_term_title = str_replace('-', ' ', $term->taxonomy) . ': ' . $term->name; |
|
| 428 | 428 | |
| 429 | 429 | $crumbs[1] = array( |
| 430 | 430 | 0 => $exercises, |
@@ -33,38 +33,38 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function __construct() { |
| 35 | 35 | |
| 36 | - add_action( 'init', array( $this, 'register_post_type' ) ); |
|
| 37 | - add_action( 'init', array( $this, 'plan_type_taxonomy_setup' ) ); |
|
| 38 | - add_action( 'init', array( $this, 'week_taxonomy_setup' ) ); |
|
| 36 | + add_action('init', array($this, 'register_post_type')); |
|
| 37 | + add_action('init', array($this, 'plan_type_taxonomy_setup')); |
|
| 38 | + add_action('init', array($this, 'week_taxonomy_setup')); |
|
| 39 | 39 | |
| 40 | 40 | // Icons for the plan types. |
| 41 | - add_action( 'create_term', array( $this, 'save_meta' ), 10, 2 ); |
|
| 42 | - add_action( 'edit_term', array( $this, 'save_meta' ), 10, 2 ); |
|
| 41 | + add_action('create_term', array($this, 'save_meta'), 10, 2); |
|
| 42 | + add_action('edit_term', array($this, 'save_meta'), 10, 2); |
|
| 43 | 43 | $prefix_taxonomy = 'plan-type'; |
| 44 | - add_action( sprintf( '%s_edit_form_fields', $prefix_taxonomy ), array( $this, 'add_thumbnail_form_field' ), 3, 1 ); |
|
| 44 | + add_action(sprintf('%s_edit_form_fields', $prefix_taxonomy), array($this, 'add_thumbnail_form_field'), 3, 1); |
|
| 45 | 45 | |
| 46 | 46 | // Register the Metaboxes. |
| 47 | - add_action( 'cmb2_admin_init', array( $this, 'featured_metabox' ), 5 ); |
|
| 48 | - add_action( 'cmb2_admin_init', array( $this, 'details_metaboxes' ), 5 ); |
|
| 49 | - add_action( 'cmb2_admin_init', array( $this, 'plan_connections' ), 5 ); |
|
| 50 | - add_action( 'cmb2_admin_init', array( $this, 'sections_metabox_loop' ), 1 ); |
|
| 47 | + add_action('cmb2_admin_init', array($this, 'featured_metabox'), 5); |
|
| 48 | + add_action('cmb2_admin_init', array($this, 'details_metaboxes'), 5); |
|
| 49 | + add_action('cmb2_admin_init', array($this, 'plan_connections'), 5); |
|
| 50 | + add_action('cmb2_admin_init', array($this, 'sections_metabox_loop'), 1); |
|
| 51 | 51 | |
| 52 | - add_filter( 'get_the_archive_title', array( $this, 'get_the_archive_title' ), 100 ); |
|
| 52 | + add_filter('get_the_archive_title', array($this, 'get_the_archive_title'), 100); |
|
| 53 | 53 | //add_filter( 'lsx_global_header_title', array( $this, 'hp_recipe_header_title' ), 200, 1 ); |
| 54 | 54 | |
| 55 | 55 | // Template Redirects. |
| 56 | - add_filter( 'lsx_health_plan_archive_template', array( $this, 'enable_post_type' ), 10, 1 ); |
|
| 57 | - add_filter( 'lsx_health_plan_single_template', array( $this, 'enable_post_type' ), 10, 1 ); |
|
| 56 | + add_filter('lsx_health_plan_archive_template', array($this, 'enable_post_type'), 10, 1); |
|
| 57 | + add_filter('lsx_health_plan_single_template', array($this, 'enable_post_type'), 10, 1); |
|
| 58 | 58 | |
| 59 | 59 | // Plan Archive Actions. |
| 60 | - add_action( 'pre_get_posts', array( $this, 'set_parent_only' ), 10, 1 ); |
|
| 61 | - add_filter( 'get_the_archive_title', array( $this, 'get_the_archive_title' ), 100 ); |
|
| 62 | - add_action( 'lsx_content_top', 'lsx_hp_plan_archive_filters', 10, 1 ); |
|
| 63 | - add_filter( 'lsx_hp_disable_plan_archive_filters', '\lsx_health_plan\functions\plan\is_search_enabled', 10, 1 ); |
|
| 64 | - add_filter( 'lsx_hp_disable_plan_archive_filters', '\lsx_health_plan\functions\plan\is_filters_disabled', 10, 1 ); |
|
| 60 | + add_action('pre_get_posts', array($this, 'set_parent_only'), 10, 1); |
|
| 61 | + add_filter('get_the_archive_title', array($this, 'get_the_archive_title'), 100); |
|
| 62 | + add_action('lsx_content_top', 'lsx_hp_plan_archive_filters', 10, 1); |
|
| 63 | + add_filter('lsx_hp_disable_plan_archive_filters', '\lsx_health_plan\functions\plan\is_search_enabled', 10, 1); |
|
| 64 | + add_filter('lsx_hp_disable_plan_archive_filters', '\lsx_health_plan\functions\plan\is_filters_disabled', 10, 1); |
|
| 65 | 65 | |
| 66 | 66 | //Breadcrumbs |
| 67 | - add_filter( 'woocommerce_get_breadcrumb', array( $this, 'plan_breadcrumb_filter' ), 30, 1 ); |
|
| 67 | + add_filter('woocommerce_get_breadcrumb', array($this, 'plan_breadcrumb_filter'), 30, 1); |
|
| 68 | 68 | |
| 69 | 69 | } |
| 70 | 70 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | public static function get_instance() { |
| 79 | 79 | // If the single instance hasn't been set, set it now. |
| 80 | - if ( null === self::$instance ) { |
|
| 80 | + if (null === self::$instance) { |
|
| 81 | 81 | self::$instance = new self(); |
| 82 | 82 | } |
| 83 | 83 | return self::$instance; |
@@ -87,21 +87,21 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | public function register_post_type() { |
| 89 | 89 | $labels = array( |
| 90 | - 'name' => esc_html__( 'Plans', 'lsx-health-plan' ), |
|
| 91 | - 'singular_name' => esc_html__( 'Plan', 'lsx-health-plan' ), |
|
| 92 | - 'add_new' => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ), |
|
| 93 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
| 94 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
| 95 | - 'new_item' => esc_html__( 'New', 'lsx-health-plan' ), |
|
| 96 | - 'all_items' => esc_html__( 'All Plans', 'lsx-health-plan' ), |
|
| 97 | - 'view_item' => esc_html__( 'View', 'lsx-health-plan' ), |
|
| 98 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
| 99 | - 'not_found' => esc_html__( 'None found', 'lsx-health-plan' ), |
|
| 100 | - 'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ), |
|
| 101 | - 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ), |
|
| 102 | - 'menu_name' => esc_html__( 'Plans', 'lsx-health-plan' ), |
|
| 90 | + 'name' => esc_html__('Plans', 'lsx-health-plan'), |
|
| 91 | + 'singular_name' => esc_html__('Plan', 'lsx-health-plan'), |
|
| 92 | + 'add_new' => esc_html_x('Add New', 'post type general name', 'lsx-health-plan'), |
|
| 93 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
| 94 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
| 95 | + 'new_item' => esc_html__('New', 'lsx-health-plan'), |
|
| 96 | + 'all_items' => esc_html__('All Plans', 'lsx-health-plan'), |
|
| 97 | + 'view_item' => esc_html__('View', 'lsx-health-plan'), |
|
| 98 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
| 99 | + 'not_found' => esc_html__('None found', 'lsx-health-plan'), |
|
| 100 | + 'not_found_in_trash' => esc_html__('None found in Trash', 'lsx-health-plan'), |
|
| 101 | + 'parent_item_colon' => esc_html__('Parent:', 'lsx-health-plan'), |
|
| 102 | + 'menu_name' => esc_html__('Plans', 'lsx-health-plan'), |
|
| 103 | 103 | ); |
| 104 | - $args = array( |
|
| 104 | + $args = array( |
|
| 105 | 105 | 'labels' => $labels, |
| 106 | 106 | 'public' => true, |
| 107 | 107 | 'publicly_queryable' => true, |
@@ -111,10 +111,10 @@ discard block |
||
| 111 | 111 | 'menu_icon' => 'dashicons-welcome-write-blog', |
| 112 | 112 | 'query_var' => true, |
| 113 | 113 | 'rewrite' => array( |
| 114 | - 'slug' => \lsx_health_plan\functions\get_option( 'plan_single_slug', 'plan' ), |
|
| 114 | + 'slug' => \lsx_health_plan\functions\get_option('plan_single_slug', 'plan'), |
|
| 115 | 115 | ), |
| 116 | 116 | 'capability_type' => 'page', |
| 117 | - 'has_archive' => \lsx_health_plan\functions\get_option( 'endpoint_plan_archive', 'plans' ), |
|
| 117 | + 'has_archive' => \lsx_health_plan\functions\get_option('endpoint_plan_archive', 'plans'), |
|
| 118 | 118 | 'hierarchical' => false, |
| 119 | 119 | 'menu_position' => null, |
| 120 | 120 | 'supports' => array( |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | 'custom-fields', |
| 126 | 126 | ), |
| 127 | 127 | ); |
| 128 | - register_post_type( 'plan', $args ); |
|
| 128 | + register_post_type('plan', $args); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
@@ -133,17 +133,17 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function plan_type_taxonomy_setup() { |
| 135 | 135 | $labels = array( |
| 136 | - 'name' => esc_html_x( 'Plan Type', 'taxonomy general name', 'lsx-health-plan' ), |
|
| 137 | - 'singular_name' => esc_html_x( 'Plan Type', 'taxonomy singular name', 'lsx-health-plan' ), |
|
| 138 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
| 139 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
| 140 | - 'parent_item' => esc_html__( 'Parent', 'lsx-health-plan' ), |
|
| 141 | - 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ), |
|
| 142 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
| 143 | - 'update_item' => esc_html__( 'Update', 'lsx-health-plan' ), |
|
| 144 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
| 145 | - 'new_item_name' => esc_html__( 'New Name', 'lsx-health-plan' ), |
|
| 146 | - 'menu_name' => esc_html__( 'Plan Types', 'lsx-health-plan' ), |
|
| 136 | + 'name' => esc_html_x('Plan Type', 'taxonomy general name', 'lsx-health-plan'), |
|
| 137 | + 'singular_name' => esc_html_x('Plan Type', 'taxonomy singular name', 'lsx-health-plan'), |
|
| 138 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
| 139 | + 'all_items' => esc_html__('All', 'lsx-health-plan'), |
|
| 140 | + 'parent_item' => esc_html__('Parent', 'lsx-health-plan'), |
|
| 141 | + 'parent_item_colon' => esc_html__('Parent:', 'lsx-health-plan'), |
|
| 142 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
| 143 | + 'update_item' => esc_html__('Update', 'lsx-health-plan'), |
|
| 144 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
| 145 | + 'new_item_name' => esc_html__('New Name', 'lsx-health-plan'), |
|
| 146 | + 'menu_name' => esc_html__('Plan Types', 'lsx-health-plan'), |
|
| 147 | 147 | ); |
| 148 | 148 | |
| 149 | 149 | $args = array( |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | ), |
| 158 | 158 | ); |
| 159 | 159 | |
| 160 | - register_taxonomy( 'plan-type', array( 'plan' ), $args ); |
|
| 160 | + register_taxonomy('plan-type', array('plan'), $args); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
@@ -165,17 +165,17 @@ discard block |
||
| 165 | 165 | */ |
| 166 | 166 | public function week_taxonomy_setup() { |
| 167 | 167 | $labels = array( |
| 168 | - 'name' => esc_html_x( 'Week', 'taxonomy general name', 'lsx-health-plan' ), |
|
| 169 | - 'singular_name' => esc_html_x( 'Week', 'taxonomy singular name', 'lsx-health-plan' ), |
|
| 170 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
| 171 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
| 172 | - 'parent_item' => esc_html__( 'Parent', 'lsx-health-plan' ), |
|
| 173 | - 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ), |
|
| 174 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
| 175 | - 'update_item' => esc_html__( 'Update', 'lsx-health-plan' ), |
|
| 176 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
| 177 | - 'new_item_name' => esc_html__( 'New Name', 'lsx-health-plan' ), |
|
| 178 | - 'menu_name' => esc_html__( 'Weeks', 'lsx-health-plan' ), |
|
| 168 | + 'name' => esc_html_x('Week', 'taxonomy general name', 'lsx-health-plan'), |
|
| 169 | + 'singular_name' => esc_html_x('Week', 'taxonomy singular name', 'lsx-health-plan'), |
|
| 170 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
| 171 | + 'all_items' => esc_html__('All', 'lsx-health-plan'), |
|
| 172 | + 'parent_item' => esc_html__('Parent', 'lsx-health-plan'), |
|
| 173 | + 'parent_item_colon' => esc_html__('Parent:', 'lsx-health-plan'), |
|
| 174 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
| 175 | + 'update_item' => esc_html__('Update', 'lsx-health-plan'), |
|
| 176 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
| 177 | + 'new_item_name' => esc_html__('New Name', 'lsx-health-plan'), |
|
| 178 | + 'menu_name' => esc_html__('Weeks', 'lsx-health-plan'), |
|
| 179 | 179 | ); |
| 180 | 180 | |
| 181 | 181 | $args = array( |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | ), |
| 191 | 191 | ); |
| 192 | 192 | |
| 193 | - register_taxonomy( 'week', array( 'plan' ), $args ); |
|
| 193 | + register_taxonomy('week', array('plan'), $args); |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** |
@@ -198,13 +198,13 @@ discard block |
||
| 198 | 198 | * |
| 199 | 199 | * @since 0.1.0 |
| 200 | 200 | */ |
| 201 | - public function add_thumbnail_form_field( $term = false ) { |
|
| 202 | - if ( is_object( $term ) ) { |
|
| 203 | - $value = get_term_meta( $term->term_id, 'thumbnail', true ); |
|
| 204 | - $image_preview = wp_get_attachment_image_src( $value, 'thumbnail' ); |
|
| 201 | + public function add_thumbnail_form_field($term = false) { |
|
| 202 | + if (is_object($term)) { |
|
| 203 | + $value = get_term_meta($term->term_id, 'thumbnail', true); |
|
| 204 | + $image_preview = wp_get_attachment_image_src($value, 'thumbnail'); |
|
| 205 | 205 | |
| 206 | - if ( is_array( $image_preview ) ) { |
|
| 207 | - $image_preview = '<img style="height: 50px; width: 50px;" src="' . esc_url( $image_preview[0] ) . '" width="' . $image_preview[1] . '" height="' . $image_preview[2] . '" class="alignnone size-thumbnail d wp-image-' . $value . '" />'; |
|
| 206 | + if (is_array($image_preview)) { |
|
| 207 | + $image_preview = '<img style="height: 50px; width: 50px;" src="' . esc_url($image_preview[0]) . '" width="' . $image_preview[1] . '" height="' . $image_preview[2] . '" class="alignnone size-thumbnail d wp-image-' . $value . '" />'; |
|
| 208 | 208 | } |
| 209 | 209 | } else { |
| 210 | 210 | $image_preview = false; |
@@ -212,15 +212,15 @@ discard block |
||
| 212 | 212 | } |
| 213 | 213 | ?> |
| 214 | 214 | <tr class="form-field form-required term-thumbnail-wrap"> |
| 215 | - <th scope="row"><label for="thumbnail"><?php esc_html_e( 'Icon Image', 'lsx-health-plan' ); ?></label></th> |
|
| 215 | + <th scope="row"><label for="thumbnail"><?php esc_html_e('Icon Image', 'lsx-health-plan'); ?></label></th> |
|
| 216 | 216 | <td> |
| 217 | - <input class="input_image_id" type="hidden" name="thumbnail" value="<?php echo wp_kses_post( $value ); ?>"> |
|
| 217 | + <input class="input_image_id" type="hidden" name="thumbnail" value="<?php echo wp_kses_post($value); ?>"> |
|
| 218 | 218 | <div class="thumbnail-preview"> |
| 219 | - <?php echo wp_kses_post( $image_preview ); ?> |
|
| 219 | + <?php echo wp_kses_post($image_preview); ?> |
|
| 220 | 220 | </div> |
| 221 | - <a style="<?php if ( '' !== $value && false !== $value ) { ?>display:none;<?php } ?>" class="button-secondary lsx-thumbnail-image-add"><?php esc_html_e( 'Choose Image', 'lsx-health-plan' ); ?></a> |
|
| 222 | - <a style="<?php if ( '' === $value || false === $value ) { ?>display:none;<?php } ?>" class="button-secondary lsx-thumbnail-image-remove"><?php esc_html_e( 'Remove Image', 'lsx-health-plan' ); ?></a> |
|
| 223 | - <?php wp_nonce_field( 'lsx_hp_term_thumbnail_nonce', 'lsx_hp_term_thumbnail_nonce' ); ?> |
|
| 221 | + <a style="<?php if ('' !== $value && false !== $value) { ?>display:none;<?php } ?>" class="button-secondary lsx-thumbnail-image-add"><?php esc_html_e('Choose Image', 'lsx-health-plan'); ?></a> |
|
| 222 | + <a style="<?php if ('' === $value || false === $value) { ?>display:none;<?php } ?>" class="button-secondary lsx-thumbnail-image-remove"><?php esc_html_e('Remove Image', 'lsx-health-plan'); ?></a> |
|
| 223 | + <?php wp_nonce_field('lsx_hp_term_thumbnail_nonce', 'lsx_hp_term_thumbnail_nonce'); ?> |
|
| 224 | 224 | </td> |
| 225 | 225 | </tr> |
| 226 | 226 | <?php |
@@ -234,27 +234,27 @@ discard block |
||
| 234 | 234 | * @param int $term_id |
| 235 | 235 | * @param string $taxonomy |
| 236 | 236 | */ |
| 237 | - public function save_meta( $term_id = 0, $taxonomy = '' ) { |
|
| 238 | - if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { |
|
| 237 | + public function save_meta($term_id = 0, $taxonomy = '') { |
|
| 238 | + if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { |
|
| 239 | 239 | return; |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | - if ( ! isset( $_POST['thumbnail'] ) ) { |
|
| 242 | + if ( ! isset($_POST['thumbnail'])) { |
|
| 243 | 243 | return; |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - if ( check_admin_referer( 'lsx_hp_term_thumbnail_nonce', 'lsx_hp_term_thumbnail_nonce' ) ) { |
|
| 247 | - if ( ! isset( $_POST['thumbnail'] ) ) { |
|
| 246 | + if (check_admin_referer('lsx_hp_term_thumbnail_nonce', 'lsx_hp_term_thumbnail_nonce')) { |
|
| 247 | + if ( ! isset($_POST['thumbnail'])) { |
|
| 248 | 248 | return; |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | - $thumbnail_meta = sanitize_text_field( $_POST['thumbnail'] ); |
|
| 252 | - $thumbnail_meta = ! empty( $thumbnail_meta ) ? $thumbnail_meta : ''; |
|
| 251 | + $thumbnail_meta = sanitize_text_field($_POST['thumbnail']); |
|
| 252 | + $thumbnail_meta = ! empty($thumbnail_meta) ? $thumbnail_meta : ''; |
|
| 253 | 253 | |
| 254 | - if ( empty( $thumbnail_meta ) ) { |
|
| 255 | - delete_term_meta( $term_id, 'thumbnail' ); |
|
| 254 | + if (empty($thumbnail_meta)) { |
|
| 255 | + delete_term_meta($term_id, 'thumbnail'); |
|
| 256 | 256 | } else { |
| 257 | - update_term_meta( $term_id, 'thumbnail', $thumbnail_meta ); |
|
| 257 | + update_term_meta($term_id, 'thumbnail', $thumbnail_meta); |
|
| 258 | 258 | } |
| 259 | 259 | } |
| 260 | 260 | } |
@@ -263,40 +263,40 @@ discard block |
||
| 263 | 263 | * Define the metabox and field configurations. |
| 264 | 264 | */ |
| 265 | 265 | public function details_metaboxes() { |
| 266 | - $cmb = new_cmb2_box( array( |
|
| 266 | + $cmb = new_cmb2_box(array( |
|
| 267 | 267 | 'id' => $this->slug . '_details_metabox', |
| 268 | - 'title' => __( 'Details', 'lsx-health-plan' ), |
|
| 269 | - 'object_types' => array( $this->slug ), // Post type |
|
| 268 | + 'title' => __('Details', 'lsx-health-plan'), |
|
| 269 | + 'object_types' => array($this->slug), // Post type |
|
| 270 | 270 | 'context' => 'normal', |
| 271 | 271 | 'priority' => 'high', |
| 272 | 272 | 'show_names' => true, |
| 273 | - ) ); |
|
| 273 | + )); |
|
| 274 | 274 | |
| 275 | - $cmb->add_field( array( |
|
| 276 | - 'name' => __( 'Plan Short Description', 'lsx-health-plan' ), |
|
| 275 | + $cmb->add_field(array( |
|
| 276 | + 'name' => __('Plan Short Description', 'lsx-health-plan'), |
|
| 277 | 277 | 'id' => $this->slug . '_short_description', |
| 278 | 278 | 'type' => 'textarea_small', |
| 279 | - 'desc' => __( 'Add a small description for this plan (optional)', 'lsx-health-plan' ), |
|
| 280 | - ) ); |
|
| 279 | + 'desc' => __('Add a small description for this plan (optional)', 'lsx-health-plan'), |
|
| 280 | + )); |
|
| 281 | 281 | |
| 282 | 282 | $warmup_type = 'page'; |
| 283 | - if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) { |
|
| 284 | - $warmup_type = array( 'page', 'workout' ); |
|
| 283 | + if (false !== \lsx_health_plan\functions\get_option('exercise_enabled', false)) { |
|
| 284 | + $warmup_type = array('page', 'workout'); |
|
| 285 | 285 | } |
| 286 | - $cmb->add_field( array( |
|
| 287 | - 'name' => __( 'Warmup', 'lsx-health-plan' ), |
|
| 288 | - 'desc' => __( 'Connect the warm up page that applies to this day plan using the field provided.', 'lsx-health-plan' ), |
|
| 286 | + $cmb->add_field(array( |
|
| 287 | + 'name' => __('Warmup', 'lsx-health-plan'), |
|
| 288 | + 'desc' => __('Connect the warm up page that applies to this day plan using the field provided.', 'lsx-health-plan'), |
|
| 289 | 289 | 'id' => $this->slug . '_warmup', |
| 290 | 290 | 'type' => 'post_search_ajax', |
| 291 | 291 | // Optional : |
| 292 | - 'limit' => 3, // Limit selection to X items only (default 1) |
|
| 292 | + 'limit' => 3, // Limit selection to X items only (default 1) |
|
| 293 | 293 | 'sortable' => true, // Allow selected items to be sortable (default false) |
| 294 | 294 | 'query_args' => array( |
| 295 | 295 | 'post_type' => $warmup_type, |
| 296 | - 'post_status' => array( 'publish' ), |
|
| 296 | + 'post_status' => array('publish'), |
|
| 297 | 297 | 'posts_per_page' => -1, |
| 298 | 298 | ), |
| 299 | - ) ); |
|
| 299 | + )); |
|
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | /** |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | * @param array $post_types |
| 306 | 306 | * @return array |
| 307 | 307 | */ |
| 308 | - public function enable_post_type( $post_types = array() ) { |
|
| 308 | + public function enable_post_type($post_types = array()) { |
|
| 309 | 309 | $post_types[] = $this->slug; |
| 310 | 310 | return $post_types; |
| 311 | 311 | } |
@@ -319,8 +319,8 @@ discard block |
||
| 319 | 319 | $cmb = new_cmb2_box( |
| 320 | 320 | array( |
| 321 | 321 | 'id' => $this->slug . '_connections_metabox', |
| 322 | - 'title' => __( 'Plans', 'lsx-health-plan' ), |
|
| 323 | - 'object_types' => array( 'workout', 'meal', 'tip', 'recipe' ), |
|
| 322 | + 'title' => __('Plans', 'lsx-health-plan'), |
|
| 323 | + 'object_types' => array('workout', 'meal', 'tip', 'recipe'), |
|
| 324 | 324 | 'context' => 'normal', |
| 325 | 325 | 'priority' => 'high', |
| 326 | 326 | 'show_names' => true, |
@@ -328,15 +328,15 @@ discard block |
||
| 328 | 328 | ); |
| 329 | 329 | $cmb->add_field( |
| 330 | 330 | array( |
| 331 | - 'name' => __( 'Plan', 'lsx-health-plan' ), |
|
| 331 | + 'name' => __('Plan', 'lsx-health-plan'), |
|
| 332 | 332 | 'id' => 'connected_plans', |
| 333 | - 'desc' => __( 'Connect this to the day plan it applies to, using the field provided.', 'lsx-health-plan' ), |
|
| 333 | + 'desc' => __('Connect this to the day plan it applies to, using the field provided.', 'lsx-health-plan'), |
|
| 334 | 334 | 'type' => 'post_search_ajax', |
| 335 | 335 | 'limit' => 15, |
| 336 | 336 | 'sortable' => true, |
| 337 | 337 | 'query_args' => array( |
| 338 | - 'post_type' => array( 'plan' ), |
|
| 339 | - 'post_status' => array( 'publish' ), |
|
| 338 | + 'post_type' => array('plan'), |
|
| 339 | + 'post_status' => array('publish'), |
|
| 340 | 340 | 'posts_per_page' => -1, |
| 341 | 341 | ), |
| 342 | 342 | ) |
@@ -349,9 +349,9 @@ discard block |
||
| 349 | 349 | * @param string $title the term title. |
| 350 | 350 | * @return string |
| 351 | 351 | */ |
| 352 | - public function get_the_archive_title( $title ) { |
|
| 353 | - if ( is_post_type_archive( 'plan' ) ) { |
|
| 354 | - $title = __( 'Our health plans', 'lsx-health-plan' ); |
|
| 352 | + public function get_the_archive_title($title) { |
|
| 353 | + if (is_post_type_archive('plan')) { |
|
| 354 | + $title = __('Our health plans', 'lsx-health-plan'); |
|
| 355 | 355 | } |
| 356 | 356 | return $title; |
| 357 | 357 | } |
@@ -362,9 +362,9 @@ discard block |
||
| 362 | 362 | * @param object $wp_query |
| 363 | 363 | * @return array |
| 364 | 364 | */ |
| 365 | - public function set_parent_only( $wp_query ) { |
|
| 366 | - if ( ! is_admin() && $wp_query->is_main_query() && ( $wp_query->is_post_type_archive( 'plan' ) || $wp_query->is_tax( 'plan-type' ) ) ) { |
|
| 367 | - $wp_query->set( 'post_parent', '0' ); |
|
| 365 | + public function set_parent_only($wp_query) { |
|
| 366 | + if ( ! is_admin() && $wp_query->is_main_query() && ($wp_query->is_post_type_archive('plan') || $wp_query->is_tax('plan-type'))) { |
|
| 367 | + $wp_query->set('post_parent', '0'); |
|
| 368 | 368 | } |
| 369 | 369 | } |
| 370 | 370 | |
@@ -375,8 +375,8 @@ discard block |
||
| 375 | 375 | $cmb = new_cmb2_box( |
| 376 | 376 | array( |
| 377 | 377 | 'id' => $this->slug . '_featured_metabox_plan', |
| 378 | - 'title' => __( 'Featured Plan', 'lsx-health-plan' ), |
|
| 379 | - 'object_types' => array( $this->slug ), // Post type |
|
| 378 | + 'title' => __('Featured Plan', 'lsx-health-plan'), |
|
| 379 | + 'object_types' => array($this->slug), // Post type |
|
| 380 | 380 | 'context' => 'side', |
| 381 | 381 | 'priority' => 'high', |
| 382 | 382 | 'show_names' => true, |
@@ -384,8 +384,8 @@ discard block |
||
| 384 | 384 | ); |
| 385 | 385 | $cmb->add_field( |
| 386 | 386 | array( |
| 387 | - 'name' => __( 'Featured Plan', 'lsx-health-plan' ), |
|
| 388 | - 'desc' => __( 'Enable a featured plan' ), |
|
| 387 | + 'name' => __('Featured Plan', 'lsx-health-plan'), |
|
| 388 | + 'desc' => __('Enable a featured plan'), |
|
| 389 | 389 | 'id' => $this->slug . '_featured_plan', |
| 390 | 390 | 'type' => 'checkbox', |
| 391 | 391 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
@@ -400,8 +400,8 @@ discard block |
||
| 400 | 400 | $cmb = new_cmb2_box( |
| 401 | 401 | array( |
| 402 | 402 | 'id' => $this->slug . '_sections_metabox', |
| 403 | - 'title' => __( 'Sections', 'lsx-health-plan' ), |
|
| 404 | - 'object_types' => array( $this->slug ), // Post type. |
|
| 403 | + 'title' => __('Sections', 'lsx-health-plan'), |
|
| 404 | + 'object_types' => array($this->slug), // Post type. |
|
| 405 | 405 | 'context' => 'normal', |
| 406 | 406 | 'priority' => 'low', |
| 407 | 407 | 'show_names' => true, |
@@ -417,9 +417,9 @@ discard block |
||
| 417 | 417 | 'id' => $this->slug . '_sections', |
| 418 | 418 | 'type' => 'group', |
| 419 | 419 | 'options' => array( |
| 420 | - 'group_title' => __( 'Section', 'lsx-health-plan' ) . ' {#}', // {#} gets replaced by row number |
|
| 421 | - 'add_button' => __( 'Add section', 'lsx-health-plan' ), |
|
| 422 | - 'remove_button' => __( 'Remove section', 'lsx-health-plan' ), |
|
| 420 | + 'group_title' => __('Section', 'lsx-health-plan') . ' {#}', // {#} gets replaced by row number |
|
| 421 | + 'add_button' => __('Add section', 'lsx-health-plan'), |
|
| 422 | + 'remove_button' => __('Remove section', 'lsx-health-plan'), |
|
| 423 | 423 | 'sortable' => true, |
| 424 | 424 | 'closed' => true, // true to have the groups closed by default |
| 425 | 425 | ), |
@@ -431,10 +431,10 @@ discard block |
||
| 431 | 431 | $cmb->add_group_field( |
| 432 | 432 | $group, |
| 433 | 433 | array( |
| 434 | - 'name' => __( 'Title', 'lsx-health-plan' ), |
|
| 434 | + 'name' => __('Title', 'lsx-health-plan'), |
|
| 435 | 435 | 'id' => 'title', |
| 436 | 436 | 'type' => 'text', |
| 437 | - 'desc' => __( 'e.g Day 1 / Week 1', 'lsx-health-plan' ), |
|
| 437 | + 'desc' => __('e.g Day 1 / Week 1', 'lsx-health-plan'), |
|
| 438 | 438 | 'classes' => 'lsx-field-col lsx-field-col-50', |
| 439 | 439 | ) |
| 440 | 440 | ); |
@@ -442,10 +442,10 @@ discard block |
||
| 442 | 442 | $cmb->add_group_field( |
| 443 | 443 | $group, |
| 444 | 444 | array( |
| 445 | - 'name' => __( 'Group', 'lsx-health-plan' ), |
|
| 445 | + 'name' => __('Group', 'lsx-health-plan'), |
|
| 446 | 446 | 'id' => 'group', |
| 447 | 447 | 'type' => 'text', |
| 448 | - 'desc' => __( 'e.g Week 1 / January', 'lsx-health-plan' ), |
|
| 448 | + 'desc' => __('e.g Week 1 / January', 'lsx-health-plan'), |
|
| 449 | 449 | 'classes' => 'lsx-field-col lsx-field-col-50', |
| 450 | 450 | ) |
| 451 | 451 | ); |
@@ -453,25 +453,25 @@ discard block |
||
| 453 | 453 | $cmb->add_group_field( |
| 454 | 454 | $group, |
| 455 | 455 | array( |
| 456 | - 'name' => __( 'Overview', 'lsx-health-plan' ), |
|
| 456 | + 'name' => __('Overview', 'lsx-health-plan'), |
|
| 457 | 457 | 'id' => 'description', |
| 458 | 458 | 'type' => 'wysiwyg', |
| 459 | 459 | ) |
| 460 | 460 | ); |
| 461 | 461 | |
| 462 | - if ( post_type_exists( 'workout' ) ) { |
|
| 462 | + if (post_type_exists('workout')) { |
|
| 463 | 463 | $cmb->add_group_field( |
| 464 | 464 | $group, |
| 465 | 465 | array( |
| 466 | - 'name' => __( 'Workouts', 'lsx-health-plan' ), |
|
| 466 | + 'name' => __('Workouts', 'lsx-health-plan'), |
|
| 467 | 467 | 'id' => 'connected_workouts', |
| 468 | - 'desc' => __( 'Connect the workout(s) that apply to this section.', 'lsx-health-plan' ), |
|
| 468 | + 'desc' => __('Connect the workout(s) that apply to this section.', 'lsx-health-plan'), |
|
| 469 | 469 | 'type' => 'post_search_ajax', |
| 470 | 470 | 'limit' => 15, |
| 471 | 471 | 'sortable' => true, |
| 472 | 472 | 'query_args' => array( |
| 473 | - 'post_type' => array( 'workout' ), |
|
| 474 | - 'post_status' => array( 'publish' ), |
|
| 473 | + 'post_type' => array('workout'), |
|
| 474 | + 'post_status' => array('publish'), |
|
| 475 | 475 | 'posts_per_page' => -1, |
| 476 | 476 | ), |
| 477 | 477 | 'classes' => 'lsx-field-col lsx-field-add-field lsx-field-col-50', |
@@ -480,51 +480,51 @@ discard block |
||
| 480 | 480 | $cmb->add_group_field( |
| 481 | 481 | $group, |
| 482 | 482 | array( |
| 483 | - 'name' => __( 'Rest day', 'lsx-health-plan' ), |
|
| 483 | + 'name' => __('Rest day', 'lsx-health-plan'), |
|
| 484 | 484 | 'id' => 'rest_day_enabled', |
| 485 | 485 | 'type' => 'checkbox', |
| 486 | 486 | 'value' => 1, |
| 487 | 487 | 'default' => 0, |
| 488 | - 'description' => __( 'Enabling the rest day will add an item called "Rest" with no links.', 'lsx-health-plan' ), |
|
| 488 | + 'description' => __('Enabling the rest day will add an item called "Rest" with no links.', 'lsx-health-plan'), |
|
| 489 | 489 | 'classes' => 'lsx-field-col lsx-field-add-field lsx-field-col-50', |
| 490 | 490 | ) |
| 491 | 491 | ); |
| 492 | 492 | } |
| 493 | 493 | |
| 494 | - if ( post_type_exists( 'meal' ) ) { |
|
| 494 | + if (post_type_exists('meal')) { |
|
| 495 | 495 | $cmb->add_group_field( |
| 496 | 496 | $group, |
| 497 | 497 | array( |
| 498 | - 'name' => __( 'Meals', 'lsx-health-plan' ), |
|
| 499 | - 'desc' => __( 'Connect the meal(s) that apply to this section.', 'lsx-health-plan' ), |
|
| 498 | + 'name' => __('Meals', 'lsx-health-plan'), |
|
| 499 | + 'desc' => __('Connect the meal(s) that apply to this section.', 'lsx-health-plan'), |
|
| 500 | 500 | 'id' => 'connected_meals', |
| 501 | 501 | 'type' => 'post_search_ajax', |
| 502 | 502 | // Optional : |
| 503 | 503 | 'limit' => 15, // Limit selection to X items only (default 1) |
| 504 | 504 | 'sortable' => true, // Allow selected items to be sortable (default false) |
| 505 | 505 | 'query_args' => array( |
| 506 | - 'post_type' => array( 'meal' ), |
|
| 507 | - 'post_status' => array( 'publish' ), |
|
| 506 | + 'post_type' => array('meal'), |
|
| 507 | + 'post_status' => array('publish'), |
|
| 508 | 508 | 'posts_per_page' => -1, |
| 509 | 509 | ), |
| 510 | 510 | 'classes' => 'lsx-field-col lsx-field-add-field lsx-field-col-50', |
| 511 | 511 | ) |
| 512 | 512 | ); |
| 513 | 513 | } |
| 514 | - if ( post_type_exists( 'tip' ) ) { |
|
| 514 | + if (post_type_exists('tip')) { |
|
| 515 | 515 | $cmb->add_group_field( |
| 516 | 516 | $group, |
| 517 | 517 | array( |
| 518 | - 'name' => __( 'Tips', 'lsx-health-plan' ), |
|
| 518 | + 'name' => __('Tips', 'lsx-health-plan'), |
|
| 519 | 519 | 'id' => 'connected_tips', |
| 520 | - 'desc' => __( 'Connect the tip(s) that apply to this section.', 'lsx-health-plan' ), |
|
| 520 | + 'desc' => __('Connect the tip(s) that apply to this section.', 'lsx-health-plan'), |
|
| 521 | 521 | 'type' => 'post_search_ajax', |
| 522 | 522 | // Optional : |
| 523 | - 'limit' => 15, // Limit selection to X items only (default 1) |
|
| 524 | - 'sortable' => true, // Allow selected items to be sortable (default false) |
|
| 523 | + 'limit' => 15, // Limit selection to X items only (default 1) |
|
| 524 | + 'sortable' => true, // Allow selected items to be sortable (default false) |
|
| 525 | 525 | 'query_args' => array( |
| 526 | - 'post_type' => array( 'tip' ), |
|
| 527 | - 'post_status' => array( 'publish' ), |
|
| 526 | + 'post_type' => array('tip'), |
|
| 527 | + 'post_status' => array('publish'), |
|
| 528 | 528 | 'posts_per_page' => -1, |
| 529 | 529 | ), |
| 530 | 530 | 'classes' => 'lsx-field-col lsx-field-add-field lsx-field-col-50', |
@@ -539,15 +539,15 @@ discard block |
||
| 539 | 539 | * @var array $crumbs |
| 540 | 540 | * @return array |
| 541 | 541 | */ |
| 542 | - public function plan_breadcrumb_filter( $crumbs ) { |
|
| 543 | - if ( is_singular( 'plan' ) ) { |
|
| 544 | - $plan = \lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' ); |
|
| 545 | - $plans = \lsx_health_plan\functions\get_option( 'endpoint_plan_archive', 'plan' ); |
|
| 542 | + public function plan_breadcrumb_filter($crumbs) { |
|
| 543 | + if (is_singular('plan')) { |
|
| 544 | + $plan = \lsx_health_plan\functions\get_option('endpoint_plan', 'plan'); |
|
| 545 | + $plans = \lsx_health_plan\functions\get_option('endpoint_plan_archive', 'plan'); |
|
| 546 | 546 | $plan_name = get_the_title(); |
| 547 | - $url = get_post_type_archive_link( $plan ); |
|
| 548 | - $term_obj_list = get_the_terms( get_the_ID(), 'plan-type' ); |
|
| 547 | + $url = get_post_type_archive_link($plan); |
|
| 548 | + $term_obj_list = get_the_terms(get_the_ID(), 'plan-type'); |
|
| 549 | 549 | $plan_type = $term_obj_list[0]->name; |
| 550 | - $plan_type_url = get_term_link( $term_obj_list[0]->term_id ); |
|
| 550 | + $plan_type_url = get_term_link($term_obj_list[0]->term_id); |
|
| 551 | 551 | |
| 552 | 552 | $crumbs[1] = array( |
| 553 | 553 | 0 => $plans, |