@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | * Contructor |
31 | 31 | */ |
32 | 32 | public function __construct() { |
33 | - add_action( 'init', array( $this, 'register_post_type' ) ); |
|
33 | + add_action('init', array($this, 'register_post_type')); |
|
34 | 34 | |
35 | - add_filter( 'lsx_health_plan_single_template', array( $this, 'enable_post_type' ), 10, 1 ); |
|
36 | - add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 ); |
|
35 | + add_filter('lsx_health_plan_single_template', array($this, 'enable_post_type'), 10, 1); |
|
36 | + add_filter('lsx_health_plan_connections', array($this, 'enable_connections'), 10, 1); |
|
37 | 37 | |
38 | - add_action( 'cmb2_admin_init', array( $this, 'details_metaboxes' ) ); |
|
39 | - add_action( 'cmb2_admin_init', array( $this, 'meal_connections' ), 15 ); |
|
38 | + add_action('cmb2_admin_init', array($this, 'details_metaboxes')); |
|
39 | + add_action('cmb2_admin_init', array($this, 'meal_connections'), 15); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public static function get_instance() { |
50 | 50 | // If the single instance hasn't been set, set it now. |
51 | - if ( null === self::$instance ) { |
|
51 | + if (null === self::$instance) { |
|
52 | 52 | self::$instance = new self(); |
53 | 53 | } |
54 | 54 | return self::$instance; |
@@ -58,21 +58,21 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function register_post_type() { |
60 | 60 | $labels = array( |
61 | - 'name' => esc_html__( 'Meals', 'lsx-health-plan' ), |
|
62 | - 'singular_name' => esc_html__( 'Meal', 'lsx-health-plan' ), |
|
63 | - 'add_new' => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ), |
|
64 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
65 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
66 | - 'new_item' => esc_html__( 'New', 'lsx-health-plan' ), |
|
67 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
68 | - 'view_item' => esc_html__( 'View', 'lsx-health-plan' ), |
|
69 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
70 | - 'not_found' => esc_html__( 'None found', 'lsx-health-plan' ), |
|
71 | - 'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ), |
|
61 | + 'name' => esc_html__('Meals', 'lsx-health-plan'), |
|
62 | + 'singular_name' => esc_html__('Meal', 'lsx-health-plan'), |
|
63 | + 'add_new' => esc_html_x('Add New', 'post type general name', 'lsx-health-plan'), |
|
64 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
65 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
66 | + 'new_item' => esc_html__('New', 'lsx-health-plan'), |
|
67 | + 'all_items' => esc_html__('All', 'lsx-health-plan'), |
|
68 | + 'view_item' => esc_html__('View', 'lsx-health-plan'), |
|
69 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
70 | + 'not_found' => esc_html__('None found', 'lsx-health-plan'), |
|
71 | + 'not_found_in_trash' => esc_html__('None found in Trash', 'lsx-health-plan'), |
|
72 | 72 | 'parent_item_colon' => '', |
73 | - 'menu_name' => esc_html__( 'Meals', 'lsx-health-plan' ), |
|
73 | + 'menu_name' => esc_html__('Meals', 'lsx-health-plan'), |
|
74 | 74 | ); |
75 | - $args = array( |
|
75 | + $args = array( |
|
76 | 76 | 'labels' => $labels, |
77 | 77 | 'public' => true, |
78 | 78 | 'publicly_queryable' => true, |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | 'title', |
91 | 91 | ), |
92 | 92 | ); |
93 | - register_post_type( 'meal', $args ); |
|
93 | + register_post_type('meal', $args); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @param array $post_types |
100 | 100 | * @return array |
101 | 101 | */ |
102 | - public function enable_post_type( $post_types = array() ) { |
|
102 | + public function enable_post_type($post_types = array()) { |
|
103 | 103 | $post_types[] = $this->slug; |
104 | 104 | return $post_types; |
105 | 105 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * @param array $connections |
111 | 111 | * @return void |
112 | 112 | */ |
113 | - public function enable_connections( $connections = array() ) { |
|
113 | + public function enable_connections($connections = array()) { |
|
114 | 114 | $connections['meal']['connected_plans'] = 'connected_meals'; |
115 | 115 | $connections['plan']['connected_meals'] = 'connected_plans'; |
116 | 116 | return $connections; |
@@ -120,117 +120,117 @@ discard block |
||
120 | 120 | * Define the metabox and field configurations. |
121 | 121 | */ |
122 | 122 | public function details_metaboxes() { |
123 | - $cmb = new_cmb2_box( array( |
|
123 | + $cmb = new_cmb2_box(array( |
|
124 | 124 | 'id' => $this->slug . '_shopping_list_metabox', |
125 | - 'title' => __( 'Shopping List', 'lsx-health-plan' ), |
|
126 | - 'object_types' => array( $this->slug ), // Post type |
|
125 | + 'title' => __('Shopping List', 'lsx-health-plan'), |
|
126 | + 'object_types' => array($this->slug), // Post type |
|
127 | 127 | 'context' => 'normal', |
128 | 128 | 'priority' => 'high', |
129 | 129 | 'show_names' => true, |
130 | - ) ); |
|
131 | - $cmb->add_field( array( |
|
132 | - 'name' => __( 'Shopping List', 'lsx-health-plan' ), |
|
133 | - 'desc' => __( 'Connect the shopping list page that applies to this meal by entering the name of the page in the field provided.' ), |
|
130 | + )); |
|
131 | + $cmb->add_field(array( |
|
132 | + 'name' => __('Shopping List', 'lsx-health-plan'), |
|
133 | + 'desc' => __('Connect the shopping list page that applies to this meal by entering the name of the page in the field provided.'), |
|
134 | 134 | 'id' => $this->slug . '_shopping_list', |
135 | 135 | 'type' => 'post_search_ajax', |
136 | 136 | // Optional : |
137 | - 'limit' => 1, // Limit selection to X items only (default 1) |
|
137 | + 'limit' => 1, // Limit selection to X items only (default 1) |
|
138 | 138 | 'sortable' => true, // Allow selected items to be sortable (default false) |
139 | 139 | 'query_args' => array( |
140 | - 'post_type' => array( 'page' ), |
|
141 | - 'post_status' => array( 'publish' ), |
|
140 | + 'post_type' => array('page'), |
|
141 | + 'post_status' => array('publish'), |
|
142 | 142 | 'posts_per_page' => -1, |
143 | 143 | ), |
144 | - ) ); |
|
145 | - $cmb = new_cmb2_box( array( |
|
144 | + )); |
|
145 | + $cmb = new_cmb2_box(array( |
|
146 | 146 | 'id' => $this->slug . '_details_metabox', |
147 | - 'title' => __( 'Meal Details', 'lsx-health-plan' ), |
|
148 | - 'object_types' => array( $this->slug ), // Post type |
|
147 | + 'title' => __('Meal Details', 'lsx-health-plan'), |
|
148 | + 'object_types' => array($this->slug), // Post type |
|
149 | 149 | 'context' => 'normal', |
150 | 150 | 'priority' => 'high', |
151 | 151 | 'show_names' => true, |
152 | - ) ); |
|
153 | - $cmb->add_field( array( |
|
154 | - 'name' => __( 'Pre Breakfast Snack', 'lsx-health-plan' ), |
|
152 | + )); |
|
153 | + $cmb->add_field(array( |
|
154 | + 'name' => __('Pre Breakfast Snack', 'lsx-health-plan'), |
|
155 | 155 | 'id' => $this->slug . '_pre_breakfast_snack', |
156 | 156 | 'type' => 'wysiwyg', |
157 | 157 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
158 | 158 | 'options' => array( |
159 | 159 | 'textarea_rows' => 5, |
160 | 160 | ), |
161 | - ) ); |
|
162 | - $cmb->add_field( array( |
|
163 | - 'name' => __( 'Breakfast', 'lsx-health-plan' ), |
|
161 | + )); |
|
162 | + $cmb->add_field(array( |
|
163 | + 'name' => __('Breakfast', 'lsx-health-plan'), |
|
164 | 164 | 'id' => $this->slug . '_breakfast', |
165 | 165 | 'type' => 'wysiwyg', |
166 | 166 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
167 | 167 | 'options' => array( |
168 | 168 | 'textarea_rows' => 5, |
169 | 169 | ), |
170 | - ) ); |
|
171 | - $cmb->add_field( array( |
|
172 | - 'name' => __( 'Post Breakfast Snack', 'lsx-health-plan' ), |
|
170 | + )); |
|
171 | + $cmb->add_field(array( |
|
172 | + 'name' => __('Post Breakfast Snack', 'lsx-health-plan'), |
|
173 | 173 | 'id' => $this->slug . '_breakfast_snack', |
174 | 174 | 'type' => 'wysiwyg', |
175 | 175 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
176 | 176 | 'options' => array( |
177 | 177 | 'textarea_rows' => 5, |
178 | 178 | ), |
179 | - ) ); |
|
180 | - $cmb->add_field( array( |
|
181 | - 'name' => __( 'Pre Lunch Snack', 'lsx-health-plan' ), |
|
179 | + )); |
|
180 | + $cmb->add_field(array( |
|
181 | + 'name' => __('Pre Lunch Snack', 'lsx-health-plan'), |
|
182 | 182 | 'id' => $this->slug . '_pre_lunch_snack', |
183 | 183 | 'type' => 'wysiwyg', |
184 | 184 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
185 | 185 | 'options' => array( |
186 | 186 | 'textarea_rows' => 5, |
187 | 187 | ), |
188 | - ) ); |
|
189 | - $cmb->add_field( array( |
|
190 | - 'name' => __( 'Lunch', 'lsx-health-plan' ), |
|
188 | + )); |
|
189 | + $cmb->add_field(array( |
|
190 | + 'name' => __('Lunch', 'lsx-health-plan'), |
|
191 | 191 | 'id' => $this->slug . '_lunch', |
192 | 192 | 'type' => 'wysiwyg', |
193 | 193 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
194 | 194 | 'options' => array( |
195 | 195 | 'textarea_rows' => 5, |
196 | 196 | ), |
197 | - ) ); |
|
198 | - $cmb->add_field( array( |
|
199 | - 'name' => __( 'Post Lunch Snack', 'lsx-health-plan' ), |
|
197 | + )); |
|
198 | + $cmb->add_field(array( |
|
199 | + 'name' => __('Post Lunch Snack', 'lsx-health-plan'), |
|
200 | 200 | 'id' => $this->slug . '_lunch_snack', |
201 | 201 | 'type' => 'wysiwyg', |
202 | 202 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
203 | 203 | 'options' => array( |
204 | 204 | 'textarea_rows' => 5, |
205 | 205 | ), |
206 | - ) ); |
|
207 | - $cmb->add_field( array( |
|
208 | - 'name' => __( 'Pre Dinner Snack', 'lsx-health-plan' ), |
|
206 | + )); |
|
207 | + $cmb->add_field(array( |
|
208 | + 'name' => __('Pre Dinner Snack', 'lsx-health-plan'), |
|
209 | 209 | 'id' => $this->slug . '_pre_dinner_snack', |
210 | 210 | 'type' => 'wysiwyg', |
211 | 211 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
212 | 212 | 'options' => array( |
213 | 213 | 'textarea_rows' => 5, |
214 | 214 | ), |
215 | - ) ); |
|
216 | - $cmb->add_field( array( |
|
217 | - 'name' => __( 'Dinner', 'lsx-health-plan' ), |
|
215 | + )); |
|
216 | + $cmb->add_field(array( |
|
217 | + 'name' => __('Dinner', 'lsx-health-plan'), |
|
218 | 218 | 'id' => $this->slug . '_dinner', |
219 | 219 | 'type' => 'wysiwyg', |
220 | 220 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
221 | 221 | 'options' => array( |
222 | 222 | 'textarea_rows' => 5, |
223 | 223 | ), |
224 | - ) ); |
|
225 | - $cmb->add_field( array( |
|
226 | - 'name' => __( 'Post Dinner Snack', 'lsx-health-plan' ), |
|
224 | + )); |
|
225 | + $cmb->add_field(array( |
|
226 | + 'name' => __('Post Dinner Snack', 'lsx-health-plan'), |
|
227 | 227 | 'id' => $this->slug . '_dinner_snack', |
228 | 228 | 'type' => 'wysiwyg', |
229 | 229 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
230 | 230 | 'options' => array( |
231 | 231 | 'textarea_rows' => 5, |
232 | 232 | ), |
233 | - ) ); |
|
233 | + )); |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | /** |
@@ -239,14 +239,14 @@ discard block |
||
239 | 239 | * @return void |
240 | 240 | */ |
241 | 241 | public function meal_connections() { |
242 | - $cmb = new_cmb2_box( array( |
|
242 | + $cmb = new_cmb2_box(array( |
|
243 | 243 | 'id' => $this->slug . '_meals_connections_metabox', |
244 | - 'title' => __( 'Meal Plan', 'lsx-health-plan' ), |
|
245 | - 'object_types' => array( 'plan' ), // Post type |
|
244 | + 'title' => __('Meal Plan', 'lsx-health-plan'), |
|
245 | + 'object_types' => array('plan'), // Post type |
|
246 | 246 | 'context' => 'normal', |
247 | 247 | 'priority' => 'high', |
248 | 248 | 'show_names' => true, |
249 | - ) ); |
|
249 | + )); |
|
250 | 250 | /*$cmb->add_field( array( |
251 | 251 | 'name' => __( 'Box Description', 'lsx-health-plan' ), |
252 | 252 | 'id' => $this->slug . '_box_description', |
@@ -254,19 +254,19 @@ discard block |
||
254 | 254 | 'type' => 'textarea_small', |
255 | 255 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
256 | 256 | ) );*/ |
257 | - $cmb->add_field( array( |
|
258 | - 'name' => __( 'Meals', 'lsx-health-plan' ), |
|
259 | - 'desc' => __( 'Connect the meal that applies to this day plan using the field provided.', 'lsx-health-plan' ), |
|
257 | + $cmb->add_field(array( |
|
258 | + 'name' => __('Meals', 'lsx-health-plan'), |
|
259 | + 'desc' => __('Connect the meal that applies to this day plan using the field provided.', 'lsx-health-plan'), |
|
260 | 260 | 'id' => 'connected_meals', |
261 | 261 | 'type' => 'post_search_ajax', |
262 | 262 | // Optional : |
263 | 263 | 'limit' => 15, // Limit selection to X items only (default 1) |
264 | 264 | 'sortable' => true, // Allow selected items to be sortable (default false) |
265 | 265 | 'query_args' => array( |
266 | - 'post_type' => array( $this->slug ), |
|
267 | - 'post_status' => array( 'publish' ), |
|
266 | + 'post_type' => array($this->slug), |
|
267 | + 'post_status' => array('publish'), |
|
268 | 268 | 'posts_per_page' => -1, |
269 | 269 | ), |
270 | - ) ); |
|
270 | + )); |
|
271 | 271 | } |
272 | 272 | } |
@@ -30,26 +30,26 @@ discard block |
||
30 | 30 | * Contructor |
31 | 31 | */ |
32 | 32 | public function __construct() { |
33 | - if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) { |
|
33 | + if (false !== \lsx_health_plan\functions\get_option('exercise_enabled', false)) { |
|
34 | 34 | // Post Type and Taxonomies. |
35 | - add_action( 'init', array( $this, 'register_post_type' ) ); |
|
36 | - add_action( 'init', array( $this, 'exercise_type_taxonomy_setup' ) ); |
|
37 | - add_action( 'init', array( $this, 'equipment_taxonomy_setup' ) ); |
|
38 | - add_action( 'init', array( $this, 'muscle_group_taxonomy_setup' ) ); |
|
39 | - add_action( 'admin_menu', array( $this, 'register_menus' ) ); |
|
35 | + add_action('init', array($this, 'register_post_type')); |
|
36 | + add_action('init', array($this, 'exercise_type_taxonomy_setup')); |
|
37 | + add_action('init', array($this, 'equipment_taxonomy_setup')); |
|
38 | + add_action('init', array($this, 'muscle_group_taxonomy_setup')); |
|
39 | + add_action('admin_menu', array($this, 'register_menus')); |
|
40 | 40 | |
41 | 41 | // Settings. |
42 | - add_action( 'lsx_hp_settings_page', array( $this, 'register_settings' ), 10, 1 ); |
|
42 | + add_action('lsx_hp_settings_page', array($this, 'register_settings'), 10, 1); |
|
43 | 43 | |
44 | 44 | // Custom Fields. |
45 | - add_action( 'cmb2_admin_init', array( $this, 'exercise_details' ), 8 ); |
|
46 | - add_action( 'cmb2_admin_init', array( $this, 'gallery_metabox' ), 9 ); |
|
47 | - add_action( 'cmb2_admin_init', array( $this, 'tips_metabox' ) ); |
|
48 | - add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 ); |
|
45 | + add_action('cmb2_admin_init', array($this, 'exercise_details'), 8); |
|
46 | + add_action('cmb2_admin_init', array($this, 'gallery_metabox'), 9); |
|
47 | + add_action('cmb2_admin_init', array($this, 'tips_metabox')); |
|
48 | + add_filter('lsx_health_plan_connections', array($this, 'enable_connections'), 10, 1); |
|
49 | 49 | |
50 | 50 | // Template Redirects. |
51 | - add_filter( 'lsx_health_plan_archive_template', array( $this, 'enable_post_type' ), 10, 1 ); |
|
52 | - add_filter( 'lsx_health_plan_single_template', array( $this, 'enable_post_type' ), 10, 1 ); |
|
51 | + add_filter('lsx_health_plan_archive_template', array($this, 'enable_post_type'), 10, 1); |
|
52 | + add_filter('lsx_health_plan_single_template', array($this, 'enable_post_type'), 10, 1); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public static function get_instance() { |
64 | 64 | // If the single instance hasn't been set, set it now. |
65 | - if ( null === self::$instance ) { |
|
65 | + if (null === self::$instance) { |
|
66 | 66 | self::$instance = new self(); |
67 | 67 | } |
68 | 68 | return self::$instance; |
@@ -72,21 +72,21 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function register_post_type() { |
74 | 74 | $labels = array( |
75 | - 'name' => esc_html__( 'Exercise', 'lsx-health-plan' ), |
|
76 | - 'singular_name' => esc_html__( 'Exercises', 'lsx-health-plan' ), |
|
77 | - 'add_new' => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ), |
|
78 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
79 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
80 | - 'new_item' => esc_html__( 'New', 'lsx-health-plan' ), |
|
81 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
82 | - 'view_item' => esc_html__( 'View', 'lsx-health-plan' ), |
|
83 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
84 | - 'not_found' => esc_html__( 'None found', 'lsx-health-plan' ), |
|
85 | - 'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ), |
|
75 | + 'name' => esc_html__('Exercise', 'lsx-health-plan'), |
|
76 | + 'singular_name' => esc_html__('Exercises', 'lsx-health-plan'), |
|
77 | + 'add_new' => esc_html_x('Add New', 'post type general name', 'lsx-health-plan'), |
|
78 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
79 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
80 | + 'new_item' => esc_html__('New', 'lsx-health-plan'), |
|
81 | + 'all_items' => esc_html__('All', 'lsx-health-plan'), |
|
82 | + 'view_item' => esc_html__('View', 'lsx-health-plan'), |
|
83 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
84 | + 'not_found' => esc_html__('None found', 'lsx-health-plan'), |
|
85 | + 'not_found_in_trash' => esc_html__('None found in Trash', 'lsx-health-plan'), |
|
86 | 86 | 'parent_item_colon' => '', |
87 | - 'menu_name' => esc_html__( 'Exercises', 'lsx-health-plan' ), |
|
87 | + 'menu_name' => esc_html__('Exercises', 'lsx-health-plan'), |
|
88 | 88 | ); |
89 | - $args = array( |
|
89 | + $args = array( |
|
90 | 90 | 'labels' => $labels, |
91 | 91 | 'public' => true, |
92 | 92 | 'publicly_queryable' => true, |
@@ -96,10 +96,10 @@ discard block |
||
96 | 96 | 'menu_icon' => 'dashicons-universal-access', |
97 | 97 | 'query_var' => true, |
98 | 98 | 'rewrite' => array( |
99 | - 'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ), |
|
99 | + 'slug' => \lsx_health_plan\functions\get_option('endpoint_exercise_single', 'exercise'), |
|
100 | 100 | ), |
101 | 101 | 'capability_type' => 'page', |
102 | - 'has_archive' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_archive', 'exercises' ), |
|
102 | + 'has_archive' => \lsx_health_plan\functions\get_option('endpoint_exercise_archive', 'exercises'), |
|
103 | 103 | 'hierarchical' => false, |
104 | 104 | 'menu_position' => null, |
105 | 105 | 'supports' => array( |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | 'excerpt', |
110 | 110 | ), |
111 | 111 | ); |
112 | - register_post_type( 'exercise', $args ); |
|
112 | + register_post_type('exercise', $args); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -119,17 +119,17 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function exercise_type_taxonomy_setup() { |
121 | 121 | $labels = array( |
122 | - 'name' => esc_html_x( 'Exercise Type', 'taxonomy general name', 'lsx-health-plan' ), |
|
123 | - 'singular_name' => esc_html_x( 'Exercise Type', 'taxonomy singular name', 'lsx-health-plan' ), |
|
124 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
125 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
126 | - 'parent_item' => esc_html__( 'Parent', 'lsx-health-plan' ), |
|
127 | - 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ), |
|
128 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
129 | - 'update_item' => esc_html__( 'Update', 'lsx-health-plan' ), |
|
130 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
131 | - 'new_item_name' => esc_html__( 'New Name', 'lsx-health-plan' ), |
|
132 | - 'menu_name' => esc_html__( 'Exercise Types', 'lsx-health-plan' ), |
|
122 | + 'name' => esc_html_x('Exercise Type', 'taxonomy general name', 'lsx-health-plan'), |
|
123 | + 'singular_name' => esc_html_x('Exercise Type', 'taxonomy singular name', 'lsx-health-plan'), |
|
124 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
125 | + 'all_items' => esc_html__('All', 'lsx-health-plan'), |
|
126 | + 'parent_item' => esc_html__('Parent', 'lsx-health-plan'), |
|
127 | + 'parent_item_colon' => esc_html__('Parent:', 'lsx-health-plan'), |
|
128 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
129 | + 'update_item' => esc_html__('Update', 'lsx-health-plan'), |
|
130 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
131 | + 'new_item_name' => esc_html__('New Name', 'lsx-health-plan'), |
|
132 | + 'menu_name' => esc_html__('Exercise Types', 'lsx-health-plan'), |
|
133 | 133 | ); |
134 | 134 | |
135 | 135 | $args = array( |
@@ -139,12 +139,12 @@ discard block |
||
139 | 139 | 'show_admin_column' => true, |
140 | 140 | 'query_var' => true, |
141 | 141 | 'rewrite' => array( |
142 | - 'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_type', 'exercise-type' ), |
|
142 | + 'slug' => \lsx_health_plan\functions\get_option('endpoint_exercise_type', 'exercise-type'), |
|
143 | 143 | ), |
144 | 144 | 'show_in_rest' => true, |
145 | 145 | ); |
146 | 146 | |
147 | - register_taxonomy( 'exercise-type', array( 'exercise' ), $args ); |
|
147 | + register_taxonomy('exercise-type', array('exercise'), $args); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -154,17 +154,17 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function equipment_taxonomy_setup() { |
156 | 156 | $labels = array( |
157 | - 'name' => esc_html_x( 'Equipment', 'taxonomy general name', 'lsx-health-plan' ), |
|
158 | - 'singular_name' => esc_html_x( 'Equipment', 'taxonomy singular name', 'lsx-health-plan' ), |
|
159 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
160 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
161 | - 'parent_item' => esc_html__( 'Parent', 'lsx-health-plan' ), |
|
162 | - 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ), |
|
163 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
164 | - 'update_item' => esc_html__( 'Update', 'lsx-health-plan' ), |
|
165 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
166 | - 'new_item_name' => esc_html__( 'New Name', 'lsx-health-plan' ), |
|
167 | - 'menu_name' => esc_html__( 'Equipment', 'lsx-health-plan' ), |
|
157 | + 'name' => esc_html_x('Equipment', 'taxonomy general name', 'lsx-health-plan'), |
|
158 | + 'singular_name' => esc_html_x('Equipment', 'taxonomy singular name', 'lsx-health-plan'), |
|
159 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
160 | + 'all_items' => esc_html__('All', 'lsx-health-plan'), |
|
161 | + 'parent_item' => esc_html__('Parent', 'lsx-health-plan'), |
|
162 | + 'parent_item_colon' => esc_html__('Parent:', 'lsx-health-plan'), |
|
163 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
164 | + 'update_item' => esc_html__('Update', 'lsx-health-plan'), |
|
165 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
166 | + 'new_item_name' => esc_html__('New Name', 'lsx-health-plan'), |
|
167 | + 'menu_name' => esc_html__('Equipment', 'lsx-health-plan'), |
|
168 | 168 | ); |
169 | 169 | |
170 | 170 | $args = array( |
@@ -174,12 +174,12 @@ discard block |
||
174 | 174 | 'show_admin_column' => true, |
175 | 175 | 'query_var' => true, |
176 | 176 | 'rewrite' => array( |
177 | - 'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_equipment', 'equipment' ), |
|
177 | + 'slug' => \lsx_health_plan\functions\get_option('endpoint_exercise_equipment', 'equipment'), |
|
178 | 178 | ), |
179 | 179 | 'show_in_rest' => true, |
180 | 180 | ); |
181 | 181 | |
182 | - register_taxonomy( 'equipment', array( 'exercise' ), $args ); |
|
182 | + register_taxonomy('equipment', array('exercise'), $args); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
@@ -189,17 +189,17 @@ discard block |
||
189 | 189 | */ |
190 | 190 | public function muscle_group_taxonomy_setup() { |
191 | 191 | $labels = array( |
192 | - 'name' => esc_html_x( 'Muscle Groups', 'taxonomy general name', 'lsx-health-plan' ), |
|
193 | - 'singular_name' => esc_html_x( 'Muscle Group', 'taxonomy singular name', 'lsx-health-plan' ), |
|
194 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
195 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
196 | - 'parent_item' => esc_html__( 'Parent', 'lsx-health-plan' ), |
|
197 | - 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ), |
|
198 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
199 | - 'update_item' => esc_html__( 'Update', 'lsx-health-plan' ), |
|
200 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
201 | - 'new_item_name' => esc_html__( 'New Name', 'lsx-health-plan' ), |
|
202 | - 'menu_name' => esc_html__( 'Muscle Groups', 'lsx-health-plan' ), |
|
192 | + 'name' => esc_html_x('Muscle Groups', 'taxonomy general name', 'lsx-health-plan'), |
|
193 | + 'singular_name' => esc_html_x('Muscle Group', 'taxonomy singular name', 'lsx-health-plan'), |
|
194 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
195 | + 'all_items' => esc_html__('All', 'lsx-health-plan'), |
|
196 | + 'parent_item' => esc_html__('Parent', 'lsx-health-plan'), |
|
197 | + 'parent_item_colon' => esc_html__('Parent:', 'lsx-health-plan'), |
|
198 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
199 | + 'update_item' => esc_html__('Update', 'lsx-health-plan'), |
|
200 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
201 | + 'new_item_name' => esc_html__('New Name', 'lsx-health-plan'), |
|
202 | + 'menu_name' => esc_html__('Muscle Groups', 'lsx-health-plan'), |
|
203 | 203 | ); |
204 | 204 | |
205 | 205 | $args = array( |
@@ -209,12 +209,12 @@ discard block |
||
209 | 209 | 'show_admin_column' => true, |
210 | 210 | 'query_var' => true, |
211 | 211 | 'rewrite' => array( |
212 | - 'slug' => \lsx_health_plan\functions\get_option( 'endpoint_exercise_muscle_group', 'muscle-group' ), |
|
212 | + 'slug' => \lsx_health_plan\functions\get_option('endpoint_exercise_muscle_group', 'muscle-group'), |
|
213 | 213 | ), |
214 | 214 | 'show_in_rest' => true, |
215 | 215 | ); |
216 | 216 | |
217 | - register_taxonomy( 'muscle-group', array( 'exercise' ), $args ); |
|
217 | + register_taxonomy('muscle-group', array('exercise'), $args); |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | /** |
@@ -223,10 +223,10 @@ discard block |
||
223 | 223 | * @return void |
224 | 224 | */ |
225 | 225 | public function register_menus() { |
226 | - 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' ); |
|
227 | - 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' ); |
|
228 | - 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' ); |
|
229 | - 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' ); |
|
226 | + 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'); |
|
227 | + 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'); |
|
228 | + 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'); |
|
229 | + 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 | 230 | } |
231 | 231 | |
232 | 232 | /** |
@@ -236,8 +236,8 @@ discard block |
||
236 | 236 | $cmb = new_cmb2_box( |
237 | 237 | array( |
238 | 238 | 'id' => $this->slug . '_tips_details_metabox', |
239 | - 'title' => __( 'Exercise Tips', 'lsx-health-plan' ), |
|
240 | - 'object_types' => array( $this->slug ), // Post type |
|
239 | + 'title' => __('Exercise Tips', 'lsx-health-plan'), |
|
240 | + 'object_types' => array($this->slug), // Post type |
|
241 | 241 | 'context' => 'normal', |
242 | 242 | 'priority' => 'low', |
243 | 243 | 'show_names' => true, |
@@ -250,9 +250,9 @@ discard block |
||
250 | 250 | 'id' => $this->slug . '_tips', |
251 | 251 | 'type' => 'group', |
252 | 252 | 'options' => array( |
253 | - 'group_title' => __( 'Tip', 'your-text-domain' ) . ' {#}', // {#} gets replaced by row number |
|
254 | - 'add_button' => __( 'Add another tip', 'your-text-domain' ), |
|
255 | - 'remove_button' => __( 'Remove tip', 'your-text-domain' ), |
|
253 | + 'group_title' => __('Tip', 'your-text-domain') . ' {#}', // {#} gets replaced by row number |
|
254 | + 'add_button' => __('Add another tip', 'your-text-domain'), |
|
255 | + 'remove_button' => __('Remove tip', 'your-text-domain'), |
|
256 | 256 | 'sortable' => true, |
257 | 257 | ), |
258 | 258 | 'classes' => 'lsx-admin-row', |
@@ -263,13 +263,13 @@ discard block |
||
263 | 263 | $cmb->add_group_field( |
264 | 264 | $tip_group, |
265 | 265 | array( |
266 | - 'name' => __( 'Thumbnail', 'your-text-domain' ), |
|
266 | + 'name' => __('Thumbnail', 'your-text-domain'), |
|
267 | 267 | 'id' => $this->slug . '_tip_thumbnail', |
268 | 268 | 'type' => 'file', |
269 | 269 | 'text' => array( |
270 | - 'add_upload_file_text' => __( 'Add File', 'lsx-health-plan' ), |
|
270 | + 'add_upload_file_text' => __('Add File', 'lsx-health-plan'), |
|
271 | 271 | ), |
272 | - 'desc' => __( 'Upload an image 300px x 300px in size.', 'lsx-health-plan' ), |
|
272 | + 'desc' => __('Upload an image 300px x 300px in size.', 'lsx-health-plan'), |
|
273 | 273 | 'query_args' => array( |
274 | 274 | 'type' => array( |
275 | 275 | 'image/gif', |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $cmb->add_group_field( |
286 | 286 | $tip_group, |
287 | 287 | array( |
288 | - 'name' => __( 'Description', 'your-text-domain' ), |
|
288 | + 'name' => __('Description', 'your-text-domain'), |
|
289 | 289 | 'id' => $this->slug . '_tip_content', |
290 | 290 | 'type' => 'textarea', |
291 | 291 | 'classes' => 'lsx-field-col lsx-field-connect-field lsx-field-col-75', |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | * @param array $post_types |
300 | 300 | * @return array |
301 | 301 | */ |
302 | - public function enable_post_type( $post_types = array() ) { |
|
302 | + public function enable_post_type($post_types = array()) { |
|
303 | 303 | $post_types[] = $this->slug; |
304 | 304 | return $post_types; |
305 | 305 | } |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | * @param array $connections |
311 | 311 | * @return void |
312 | 312 | */ |
313 | - public function enable_connections( $connections = array() ) { |
|
313 | + public function enable_connections($connections = array()) { |
|
314 | 314 | $connections['exercise']['connected_workouts'] = 'connected_exercises'; |
315 | 315 | $connections['workout']['connected_exercises'] = 'connected_workouts'; |
316 | 316 | return $connections; |
@@ -322,24 +322,24 @@ discard block |
||
322 | 322 | * @param object $cmb new_cmb2_box(). |
323 | 323 | * @return void |
324 | 324 | */ |
325 | - public function register_settings( $cmb ) { |
|
325 | + public function register_settings($cmb) { |
|
326 | 326 | $cmb->add_field( |
327 | 327 | array( |
328 | 328 | 'id' => 'exercise_archive_settings_title', |
329 | 329 | 'type' => 'title', |
330 | - 'name' => __( 'Exercises Archive', 'lsx-health-plan' ), |
|
331 | - 'description' => __( 'All of the settings relating to the exercises post type archive.', 'lsx-health-plan' ), |
|
330 | + 'name' => __('Exercises Archive', 'lsx-health-plan'), |
|
331 | + 'description' => __('All of the settings relating to the exercises post type archive.', 'lsx-health-plan'), |
|
332 | 332 | ) |
333 | 333 | ); |
334 | 334 | $cmb->add_field( |
335 | 335 | array( |
336 | 336 | 'id' => 'exercise_archive_description', |
337 | 337 | 'type' => 'wysiwyg', |
338 | - 'name' => __( 'Archive Description', 'lsx-health-plan' ), |
|
339 | - 'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ), |
|
338 | + 'name' => __('Archive Description', 'lsx-health-plan'), |
|
339 | + 'description' => __('This will show up on the post type archive.', 'lsx-health-plan'), |
|
340 | 340 | ) |
341 | 341 | ); |
342 | - do_action( 'lsx_hp_exercise_settings_page', $cmb ); |
|
342 | + do_action('lsx_hp_exercise_settings_page', $cmb); |
|
343 | 343 | $cmb->add_field( |
344 | 344 | array( |
345 | 345 | 'id' => 'settings_exercise_archive_closing', |
@@ -355,8 +355,8 @@ discard block |
||
355 | 355 | $cmb = new_cmb2_box( |
356 | 356 | array( |
357 | 357 | 'id' => $this->slug . '_gallery_details_metabox', |
358 | - 'title' => __( 'Exercise Gallery', 'lsx-health-plan' ), |
|
359 | - 'object_types' => array( $this->slug ), |
|
358 | + 'title' => __('Exercise Gallery', 'lsx-health-plan'), |
|
359 | + 'object_types' => array($this->slug), |
|
360 | 360 | 'context' => 'normal', |
361 | 361 | 'priority' => 'low', |
362 | 362 | 'show_names' => true, |
@@ -365,19 +365,19 @@ discard block |
||
365 | 365 | |
366 | 366 | $cmb->add_field( |
367 | 367 | array( |
368 | - 'name' => __( 'Layout', 'lsx-health-plan' ), |
|
368 | + 'name' => __('Layout', 'lsx-health-plan'), |
|
369 | 369 | 'id' => $this->slug . '_gallery_layout', |
370 | 370 | 'type' => 'radio', |
371 | 371 | 'options' => array( |
372 | - 'slider' => __( 'Slider', 'your-text-domain' ) . ' {#}', // {#} gets replaced by row number |
|
373 | - 'grid' => __( 'Grid', 'your-text-domain' ), |
|
372 | + 'slider' => __('Slider', 'your-text-domain') . ' {#}', // {#} gets replaced by row number |
|
373 | + 'grid' => __('Grid', 'your-text-domain'), |
|
374 | 374 | ), |
375 | 375 | ) |
376 | 376 | ); |
377 | 377 | |
378 | 378 | $cmb->add_field( |
379 | 379 | array( |
380 | - 'name' => __( 'Grid Columns', 'lsx-health-plan' ), |
|
380 | + 'name' => __('Grid Columns', 'lsx-health-plan'), |
|
381 | 381 | 'id' => $this->slug . '_gallery_columns', |
382 | 382 | 'type' => 'text', |
383 | 383 | 'default' => '3', |
@@ -390,9 +390,9 @@ discard block |
||
390 | 390 | 'id' => $this->slug . '_gallery', |
391 | 391 | 'type' => 'group', |
392 | 392 | 'options' => array( |
393 | - 'group_title' => __( 'Gallery', 'your-text-domain' ) . ' {#}', // {#} gets replaced by row number |
|
394 | - 'add_button' => __( 'Add Item', 'your-text-domain' ), |
|
395 | - 'remove_button' => __( 'Remove Item', 'your-text-domain' ), |
|
393 | + 'group_title' => __('Gallery', 'your-text-domain') . ' {#}', // {#} gets replaced by row number |
|
394 | + 'add_button' => __('Add Item', 'your-text-domain'), |
|
395 | + 'remove_button' => __('Remove Item', 'your-text-domain'), |
|
396 | 396 | 'sortable' => true, |
397 | 397 | ), |
398 | 398 | 'classes' => 'lsx-admin-row', |
@@ -403,13 +403,13 @@ discard block |
||
403 | 403 | $cmb->add_group_field( |
404 | 404 | $gallery_group, |
405 | 405 | array( |
406 | - 'name' => __( 'Image', 'your-text-domain' ), |
|
406 | + 'name' => __('Image', 'your-text-domain'), |
|
407 | 407 | 'id' => $this->slug . '_gallery_image', |
408 | 408 | 'type' => 'file', |
409 | 409 | 'text' => array( |
410 | - 'add_upload_file_text' => __( 'Add File', 'lsx-health-plan' ), |
|
410 | + 'add_upload_file_text' => __('Add File', 'lsx-health-plan'), |
|
411 | 411 | ), |
412 | - 'desc' => __( 'Upload an image a minimum of 800px x 600px in size.', 'lsx-health-plan' ), |
|
412 | + 'desc' => __('Upload an image a minimum of 800px x 600px in size.', 'lsx-health-plan'), |
|
413 | 413 | 'query_args' => array( |
414 | 414 | 'type' => array( |
415 | 415 | 'image/gif', |
@@ -426,10 +426,10 @@ discard block |
||
426 | 426 | $cmb->add_group_field( |
427 | 427 | $gallery_group, |
428 | 428 | array( |
429 | - 'name' => __( 'oEmbed', 'your-text-domain' ), |
|
429 | + 'name' => __('oEmbed', 'your-text-domain'), |
|
430 | 430 | 'id' => $this->slug . '_gallery_embed', |
431 | 431 | 'type' => 'text', |
432 | - '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' ), |
|
432 | + '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'), |
|
433 | 433 | 'classes' => 'lsx-field-col lsx-field-connect-field lsx-field-col-33', |
434 | 434 | ) |
435 | 435 | ); |
@@ -437,10 +437,10 @@ discard block |
||
437 | 437 | $cmb->add_group_field( |
438 | 438 | $gallery_group, |
439 | 439 | array( |
440 | - 'name' => __( 'External Media', 'your-text-domain' ), |
|
440 | + 'name' => __('External Media', 'your-text-domain'), |
|
441 | 441 | 'id' => $this->slug . '_gallery_external', |
442 | 442 | 'type' => 'textarea_code', |
443 | - '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' ), |
|
443 | + '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'), |
|
444 | 444 | 'classes' => 'lsx-field-col lsx-field-connect-field lsx-field-col-33', |
445 | 445 | ) |
446 | 446 | ); |
@@ -455,8 +455,8 @@ discard block |
||
455 | 455 | $cmb = new_cmb2_box( |
456 | 456 | array( |
457 | 457 | 'id' => $this->slug . '_general_details_metabox', |
458 | - 'title' => __( 'Details', 'lsx-health-plan' ), |
|
459 | - 'object_types' => array( $this->slug ), |
|
458 | + 'title' => __('Details', 'lsx-health-plan'), |
|
459 | + 'object_types' => array($this->slug), |
|
460 | 460 | 'context' => 'normal', |
461 | 461 | 'priority' => 'high', |
462 | 462 | 'show_names' => true, |
@@ -465,15 +465,15 @@ discard block |
||
465 | 465 | |
466 | 466 | $cmb->add_field( |
467 | 467 | array( |
468 | - 'name' => __( 'Side', 'lsx-health-plan' ), |
|
468 | + 'name' => __('Side', 'lsx-health-plan'), |
|
469 | 469 | 'id' => $this->slug . '_side', |
470 | 470 | 'type' => 'select', |
471 | 471 | 'options' => array( |
472 | - '' => __( 'Select', 'your-text-domain' ), |
|
473 | - 'left' => __( 'Left', 'your-text-domain' ), |
|
474 | - 'right' => __( 'Right', 'your-text-domain' ), |
|
472 | + '' => __('Select', 'your-text-domain'), |
|
473 | + 'left' => __('Left', 'your-text-domain'), |
|
474 | + 'right' => __('Right', 'your-text-domain'), |
|
475 | 475 | ), |
476 | - 'desc' => __( 'Select which side this exercise uses. ', 'lsx-health-plan' ), |
|
476 | + 'desc' => __('Select which side this exercise uses. ', 'lsx-health-plan'), |
|
477 | 477 | ) |
478 | 478 | ); |
479 | 479 | } |
@@ -32,16 +32,16 @@ discard block |
||
32 | 32 | * Contructor |
33 | 33 | */ |
34 | 34 | public function __construct() { |
35 | - add_action( 'init', array( $this, 'register_post_type' ) ); |
|
36 | - add_filter( 'lsx_health_plan_single_template', array( $this, 'enable_post_type' ), 10, 1 ); |
|
37 | - add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 ); |
|
38 | - add_action( 'cmb2_admin_init', array( $this, 'details_metaboxes' ) ); |
|
39 | - add_action( 'cmb2_admin_init', array( $this, 'workout_connections' ), 15 ); |
|
40 | - add_action( 'lsx_hp_settings_page', array( $this, 'register_settings' ), 8, 1 ); |
|
41 | - add_filter( 'get_the_archive_title', array( $this, 'get_the_archive_title' ), 100 ); |
|
35 | + add_action('init', array($this, 'register_post_type')); |
|
36 | + add_filter('lsx_health_plan_single_template', array($this, 'enable_post_type'), 10, 1); |
|
37 | + add_filter('lsx_health_plan_connections', array($this, 'enable_connections'), 10, 1); |
|
38 | + add_action('cmb2_admin_init', array($this, 'details_metaboxes')); |
|
39 | + add_action('cmb2_admin_init', array($this, 'workout_connections'), 15); |
|
40 | + add_action('lsx_hp_settings_page', array($this, 'register_settings'), 8, 1); |
|
41 | + add_filter('get_the_archive_title', array($this, 'get_the_archive_title'), 100); |
|
42 | 42 | |
43 | 43 | // Template Redirects. |
44 | - add_filter( 'lsx_health_plan_archive_template', array( $this, 'enable_post_type' ), 10, 1 ); |
|
44 | + add_filter('lsx_health_plan_archive_template', array($this, 'enable_post_type'), 10, 1); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public static function get_instance() { |
55 | 55 | // If the single instance hasn't been set, set it now. |
56 | - if ( null === self::$instance ) { |
|
56 | + if (null === self::$instance) { |
|
57 | 57 | self::$instance = new self(); |
58 | 58 | } |
59 | 59 | return self::$instance; |
@@ -63,19 +63,19 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function register_post_type() { |
65 | 65 | $labels = array( |
66 | - 'name' => esc_html__( 'Workout', 'lsx-health-plan' ), |
|
67 | - 'singular_name' => esc_html__( 'Workouts', 'lsx-health-plan' ), |
|
68 | - 'add_new' => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ), |
|
69 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
70 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
71 | - 'new_item' => esc_html__( 'New', 'lsx-health-plan' ), |
|
72 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
73 | - 'view_item' => esc_html__( 'View', 'lsx-health-plan' ), |
|
74 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
75 | - 'not_found' => esc_html__( 'None found', 'lsx-health-plan' ), |
|
76 | - 'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ), |
|
66 | + 'name' => esc_html__('Workout', 'lsx-health-plan'), |
|
67 | + 'singular_name' => esc_html__('Workouts', 'lsx-health-plan'), |
|
68 | + 'add_new' => esc_html_x('Add New', 'post type general name', 'lsx-health-plan'), |
|
69 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
70 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
71 | + 'new_item' => esc_html__('New', 'lsx-health-plan'), |
|
72 | + 'all_items' => esc_html__('All', 'lsx-health-plan'), |
|
73 | + 'view_item' => esc_html__('View', 'lsx-health-plan'), |
|
74 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
75 | + 'not_found' => esc_html__('None found', 'lsx-health-plan'), |
|
76 | + 'not_found_in_trash' => esc_html__('None found in Trash', 'lsx-health-plan'), |
|
77 | 77 | 'parent_item_colon' => '', |
78 | - 'menu_name' => esc_html__( 'Workouts', 'lsx-health-plan' ), |
|
78 | + 'menu_name' => esc_html__('Workouts', 'lsx-health-plan'), |
|
79 | 79 | ); |
80 | 80 | $args = array( |
81 | 81 | 'labels' => $labels, |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | 'menu_icon' => 'dashicons-universal-access', |
88 | 88 | 'query_var' => true, |
89 | 89 | 'rewrite' => array( |
90 | - 'slug' => \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ), |
|
90 | + 'slug' => \lsx_health_plan\functions\get_option('endpoint_workout', 'workout'), |
|
91 | 91 | ), |
92 | 92 | 'capability_type' => 'page', |
93 | - 'has_archive' => \lsx_health_plan\functions\get_option( 'endpoint_workout_archive', false ), |
|
93 | + 'has_archive' => \lsx_health_plan\functions\get_option('endpoint_workout_archive', false), |
|
94 | 94 | 'hierarchical' => true, |
95 | 95 | 'menu_position' => null, |
96 | 96 | 'supports' => array( |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | 'excerpt', |
101 | 101 | ), |
102 | 102 | ); |
103 | - register_post_type( 'workout', $args ); |
|
103 | + register_post_type('workout', $args); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * @param array $post_types |
110 | 110 | * @return array |
111 | 111 | */ |
112 | - public function enable_post_type( $post_types = array() ) { |
|
112 | + public function enable_post_type($post_types = array()) { |
|
113 | 113 | $post_types[] = $this->slug; |
114 | 114 | return $post_types; |
115 | 115 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * @param array $connections |
121 | 121 | * @return void |
122 | 122 | */ |
123 | - public function enable_connections( $connections = array() ) { |
|
123 | + public function enable_connections($connections = array()) { |
|
124 | 124 | $connections['workout']['connected_plans'] = 'connected_workouts'; |
125 | 125 | $connections['plan']['connected_workouts'] = 'connected_plans'; |
126 | 126 | |
@@ -138,9 +138,9 @@ discard block |
||
138 | 138 | * @param string $title the term title. |
139 | 139 | * @return string |
140 | 140 | */ |
141 | - public function get_the_archive_title( $title ) { |
|
142 | - if ( is_post_type_archive( 'workout' ) ) { |
|
143 | - $title = __( 'Workouts', 'lsx-health-plan' ); |
|
141 | + public function get_the_archive_title($title) { |
|
142 | + if (is_post_type_archive('workout')) { |
|
143 | + $title = __('Workouts', 'lsx-health-plan'); |
|
144 | 144 | } |
145 | 145 | return $title; |
146 | 146 | } |
@@ -149,27 +149,27 @@ discard block |
||
149 | 149 | * Define the metabox and field configurations. |
150 | 150 | */ |
151 | 151 | public function details_metaboxes() { |
152 | - $workout_sections = apply_filters( 'lsx_health_plan_workout_sections_amount', 6 ); |
|
153 | - if ( false !== $workout_sections && null !== $workout_sections ) { |
|
152 | + $workout_sections = apply_filters('lsx_health_plan_workout_sections_amount', 6); |
|
153 | + if (false !== $workout_sections && null !== $workout_sections) { |
|
154 | 154 | $i = 1; |
155 | - while ( $i <= $workout_sections ) { |
|
155 | + while ($i <= $workout_sections) { |
|
156 | 156 | |
157 | - $cmb_group = new_cmb2_box( array( |
|
157 | + $cmb_group = new_cmb2_box(array( |
|
158 | 158 | 'id' => $this->slug . '_section_' . $i . '_metabox', |
159 | - 'title' => esc_html__( 'Exercise Group ', 'lsx-health-plan' ) . $i, |
|
160 | - 'object_types' => array( $this->slug ), |
|
161 | - ) ); |
|
159 | + 'title' => esc_html__('Exercise Group ', 'lsx-health-plan') . $i, |
|
160 | + 'object_types' => array($this->slug), |
|
161 | + )); |
|
162 | 162 | |
163 | - $cmb_group->add_field( array( |
|
164 | - 'name' => __( 'Title', 'lsx-health-plan' ), |
|
163 | + $cmb_group->add_field(array( |
|
164 | + 'name' => __('Title', 'lsx-health-plan'), |
|
165 | 165 | 'id' => $this->slug . '_section_' . $i . '_title', |
166 | 166 | 'type' => 'text', |
167 | 167 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
168 | - ) ); |
|
168 | + )); |
|
169 | 169 | |
170 | 170 | $cmb_group->add_field( |
171 | 171 | array( |
172 | - 'name' => __( 'Description', 'lsx-health-plan' ), |
|
172 | + 'name' => __('Description', 'lsx-health-plan'), |
|
173 | 173 | 'id' => $this->slug . '_section_' . $i . '_description', |
174 | 174 | 'type' => 'wysiwyg', |
175 | 175 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
@@ -188,27 +188,27 @@ discard block |
||
188 | 188 | 'id' => $this->slug . '_section_' . $i, |
189 | 189 | 'type' => 'group', |
190 | 190 | 'options' => array( |
191 | - 'group_title' => esc_html__( 'Exercise {#}', 'lsx-health-plan' ), // {#} gets replaced by row number |
|
192 | - 'add_button' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
193 | - 'remove_button' => esc_html__( 'Delete', 'lsx-health-plan' ), |
|
191 | + 'group_title' => esc_html__('Exercise {#}', 'lsx-health-plan'), // {#} gets replaced by row number |
|
192 | + 'add_button' => esc_html__('Add New', 'lsx-health-plan'), |
|
193 | + 'remove_button' => esc_html__('Delete', 'lsx-health-plan'), |
|
194 | 194 | 'sortable' => true, |
195 | 195 | ), |
196 | 196 | ) |
197 | 197 | ); |
198 | 198 | |
199 | - if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) { |
|
199 | + if (false !== \lsx_health_plan\functions\get_option('exercise_enabled', false)) { |
|
200 | 200 | $cmb_group->add_group_field( |
201 | 201 | $group_field_id, |
202 | 202 | array( |
203 | - 'name' => __( 'Exercise related to this workout', 'lsx-health-plan' ), |
|
203 | + 'name' => __('Exercise related to this workout', 'lsx-health-plan'), |
|
204 | 204 | 'id' => 'connected_exercises', |
205 | 205 | 'type' => 'post_search_ajax', |
206 | 206 | // Optional : |
207 | 207 | 'limit' => 1, // Limit selection to X items only (default 1) |
208 | - 'sortable' => true, // Allow selected items to be sortable (default false) |
|
208 | + 'sortable' => true, // Allow selected items to be sortable (default false) |
|
209 | 209 | 'query_args' => array( |
210 | - 'post_type' => array( 'exercise' ), |
|
211 | - 'post_status' => array( 'publish' ), |
|
210 | + 'post_type' => array('exercise'), |
|
211 | + 'post_status' => array('publish'), |
|
212 | 212 | 'posts_per_page' => -1, |
213 | 213 | ), |
214 | 214 | ) |
@@ -217,15 +217,15 @@ discard block |
||
217 | 217 | $cmb_group->add_group_field( |
218 | 218 | $group_field_id, |
219 | 219 | array( |
220 | - 'name' => __( 'Video related to this workout', 'lsx-health-plan' ), |
|
220 | + 'name' => __('Video related to this workout', 'lsx-health-plan'), |
|
221 | 221 | 'id' => 'connected_videos', |
222 | 222 | 'type' => 'post_search_ajax', |
223 | 223 | // Optional : |
224 | 224 | 'limit' => 1, // Limit selection to X items only (default 1) |
225 | - 'sortable' => true, // Allow selected items to be sortable (default false) |
|
225 | + 'sortable' => true, // Allow selected items to be sortable (default false) |
|
226 | 226 | 'query_args' => array( |
227 | - 'post_type' => array( 'video' ), |
|
228 | - 'post_status' => array( 'publish' ), |
|
227 | + 'post_type' => array('video'), |
|
228 | + 'post_status' => array('publish'), |
|
229 | 229 | 'posts_per_page' => -1, |
230 | 230 | ), |
231 | 231 | ) |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | $cmb_group->add_group_field( |
234 | 234 | $group_field_id, |
235 | 235 | array( |
236 | - 'name' => esc_html__( 'Workout Name', 'lsx-health-plan' ), |
|
236 | + 'name' => esc_html__('Workout Name', 'lsx-health-plan'), |
|
237 | 237 | 'id' => 'name', |
238 | 238 | 'type' => 'text', |
239 | 239 | // 'repeatable' => true, // Repeatable fields are supported w/in repeatable groups (for most types) |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | $cmb_group->add_group_field( |
244 | 244 | $group_field_id, |
245 | 245 | array( |
246 | - 'name' => __( 'Description', 'lsx-health-plan' ), |
|
246 | + 'name' => __('Description', 'lsx-health-plan'), |
|
247 | 247 | 'id' => 'description', |
248 | 248 | 'type' => 'wysiwyg', |
249 | 249 | 'options' => array( |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $cmb_group->add_group_field( |
257 | 257 | $group_field_id, |
258 | 258 | array( |
259 | - 'name' => esc_html__( 'Reps / Time / Distance', 'lsx-health-plan' ), |
|
259 | + 'name' => esc_html__('Reps / Time / Distance', 'lsx-health-plan'), |
|
260 | 260 | 'id' => 'reps', |
261 | 261 | 'type' => 'text', |
262 | 262 | // 'repeatable' => true, // Repeatable fields are supported w/in repeatable groups (for most types) |
@@ -276,9 +276,9 @@ discard block |
||
276 | 276 | $cmb = new_cmb2_box( |
277 | 277 | array( |
278 | 278 | 'id' => $this->slug . '_workout_connections_metabox', |
279 | - 'title' => __( 'Workouts', 'lsx-health-plan' ), |
|
280 | - 'desc' => __( 'Start typing to search for your workouts', 'lsx-health-plan' ), |
|
281 | - 'object_types' => array( 'plan' ), |
|
279 | + 'title' => __('Workouts', 'lsx-health-plan'), |
|
280 | + 'desc' => __('Start typing to search for your workouts', 'lsx-health-plan'), |
|
281 | + 'object_types' => array('plan'), |
|
282 | 282 | 'context' => 'normal', |
283 | 283 | 'priority' => 'high', |
284 | 284 | 'show_names' => true, |
@@ -286,22 +286,22 @@ discard block |
||
286 | 286 | ); |
287 | 287 | $cmb->add_field( |
288 | 288 | array( |
289 | - 'name' => __( 'Workouts', 'lsx-health-plan' ), |
|
289 | + 'name' => __('Workouts', 'lsx-health-plan'), |
|
290 | 290 | 'id' => 'connected_workouts', |
291 | - 'desc' => __( 'Connect the workout that applies to this day plan using the field provided.', 'lsx-health-plan' ), |
|
291 | + 'desc' => __('Connect the workout that applies to this day plan using the field provided.', 'lsx-health-plan'), |
|
292 | 292 | 'type' => 'post_search_ajax', |
293 | 293 | 'limit' => 15, |
294 | 294 | 'sortable' => true, |
295 | 295 | 'query_args' => array( |
296 | - 'post_type' => array( 'workout' ), |
|
297 | - 'post_status' => array( 'publish' ), |
|
296 | + 'post_type' => array('workout'), |
|
297 | + 'post_status' => array('publish'), |
|
298 | 298 | 'posts_per_page' => -1, |
299 | 299 | ), |
300 | 300 | ) |
301 | 301 | ); |
302 | 302 | $cmb->add_field( |
303 | 303 | array( |
304 | - 'name' => __( 'Pre Workout Snack', 'lsx-health-plan' ), |
|
304 | + 'name' => __('Pre Workout Snack', 'lsx-health-plan'), |
|
305 | 305 | 'id' => 'pre_workout_snack', |
306 | 306 | 'type' => 'wysiwyg', |
307 | 307 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | ); |
313 | 313 | $cmb->add_field( |
314 | 314 | array( |
315 | - 'name' => __( 'Post Workout Snack', 'lsx-health-plan' ), |
|
315 | + 'name' => __('Post Workout Snack', 'lsx-health-plan'), |
|
316 | 316 | 'id' => 'post_workout_snack', |
317 | 317 | 'type' => 'wysiwyg', |
318 | 318 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
@@ -329,14 +329,14 @@ discard block |
||
329 | 329 | * @param object $cmb new_cmb2_box(). |
330 | 330 | * @return void |
331 | 331 | */ |
332 | - public function register_settings( $cmb ) { |
|
333 | - if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) { |
|
332 | + public function register_settings($cmb) { |
|
333 | + if (false !== \lsx_health_plan\functions\get_option('exercise_enabled', false)) { |
|
334 | 334 | $cmb->add_field( |
335 | 335 | array( |
336 | 336 | 'id' => 'workout_settings_title', |
337 | 337 | 'type' => 'title', |
338 | - 'name' => __( 'Workout Settings', 'lsx-health-plan' ), |
|
339 | - 'description' => __( 'Choose the layout, content and link settings for your exercises.', 'lsx-health-plan' ), |
|
338 | + 'name' => __('Workout Settings', 'lsx-health-plan'), |
|
339 | + 'description' => __('Choose the layout, content and link settings for your exercises.', 'lsx-health-plan'), |
|
340 | 340 | ) |
341 | 341 | ); |
342 | 342 | |
@@ -344,12 +344,12 @@ discard block |
||
344 | 344 | array( |
345 | 345 | 'id' => 'workout_tab_layout', |
346 | 346 | 'type' => 'select', |
347 | - 'name' => __( 'Workout Tab Layout', 'lsx-health-plan' ), |
|
348 | - 'description' => __( 'Choose the layout for the workouts.', 'lsx-health-plan' ), |
|
347 | + 'name' => __('Workout Tab Layout', 'lsx-health-plan'), |
|
348 | + 'description' => __('Choose the layout for the workouts.', 'lsx-health-plan'), |
|
349 | 349 | 'options' => array( |
350 | - 'table' => __( 'Table', 'lsx-health-plan' ), |
|
351 | - 'list' => __( 'List', 'lsx-health-plan' ), |
|
352 | - 'grid' => __( 'Grid', 'lsx-health-plan' ), |
|
350 | + 'table' => __('Table', 'lsx-health-plan'), |
|
351 | + 'list' => __('List', 'lsx-health-plan'), |
|
352 | + 'grid' => __('Grid', 'lsx-health-plan'), |
|
353 | 353 | ), |
354 | 354 | ) |
355 | 355 | ); |
@@ -357,12 +357,12 @@ discard block |
||
357 | 357 | array( |
358 | 358 | 'id' => 'workout_tab_link', |
359 | 359 | 'type' => 'select', |
360 | - 'name' => __( 'Workout Tab Link', 'lsx-health-plan' ), |
|
361 | - 'description' => __( 'Choose to show the excerpt, full content or nothing.', 'lsx-health-plan' ), |
|
360 | + 'name' => __('Workout Tab Link', 'lsx-health-plan'), |
|
361 | + 'description' => __('Choose to show the excerpt, full content or nothing.', 'lsx-health-plan'), |
|
362 | 362 | 'options' => array( |
363 | - '' => __( 'None', 'lsx-health-plan' ), |
|
364 | - 'single' => __( 'Single', 'lsx-health-plan' ), |
|
365 | - 'modal' => __( 'Modal', 'lsx-health-plan' ), |
|
363 | + '' => __('None', 'lsx-health-plan'), |
|
364 | + 'single' => __('Single', 'lsx-health-plan'), |
|
365 | + 'modal' => __('Modal', 'lsx-health-plan'), |
|
366 | 366 | ), |
367 | 367 | 'default' => 'modal', |
368 | 368 | ) |
@@ -371,12 +371,12 @@ discard block |
||
371 | 371 | array( |
372 | 372 | 'id' => 'workout_tab_modal_content', |
373 | 373 | 'type' => 'select', |
374 | - 'name' => __( 'Modal Content', 'lsx-health-plan' ), |
|
375 | - 'description' => __( 'Choose to show the excerpt, full content or nothing. For the modal content only', 'lsx-health-plan' ), |
|
374 | + 'name' => __('Modal Content', 'lsx-health-plan'), |
|
375 | + 'description' => __('Choose to show the excerpt, full content or nothing. For the modal content only', 'lsx-health-plan'), |
|
376 | 376 | 'options' => array( |
377 | - '' => __( 'None', 'lsx-health-plan' ), |
|
378 | - 'excerpt' => __( 'Excerpt', 'lsx-health-plan' ), |
|
379 | - 'full' => __( 'Full Content', 'lsx-health-plan' ), |
|
377 | + '' => __('None', 'lsx-health-plan'), |
|
378 | + 'excerpt' => __('Excerpt', 'lsx-health-plan'), |
|
379 | + 'full' => __('Full Content', 'lsx-health-plan'), |
|
380 | 380 | ), |
381 | 381 | 'default' => '', |
382 | 382 | ) |
@@ -385,14 +385,14 @@ discard block |
||
385 | 385 | array( |
386 | 386 | 'id' => 'workout_tab_columns', |
387 | 387 | 'type' => 'select', |
388 | - 'name' => __( 'Grid Columns', 'lsx-health-plan' ), |
|
389 | - 'description' => __( 'If you are displaying a grid, set the amount of columns you want to use.', 'lsx-health-plan' ), |
|
388 | + 'name' => __('Grid Columns', 'lsx-health-plan'), |
|
389 | + 'description' => __('If you are displaying a grid, set the amount of columns you want to use.', 'lsx-health-plan'), |
|
390 | 390 | 'options' => array( |
391 | - '12' => __( '1', 'lsx-health-plan' ), |
|
392 | - '6' => __( '2', 'lsx-health-plan' ), |
|
393 | - '4' => __( '3', 'lsx-health-plan' ), |
|
394 | - '3' => __( '4', 'lsx-health-plan' ), |
|
395 | - '2' => __( '6', 'lsx-health-plan' ), |
|
391 | + '12' => __('1', 'lsx-health-plan'), |
|
392 | + '6' => __('2', 'lsx-health-plan'), |
|
393 | + '4' => __('3', 'lsx-health-plan'), |
|
394 | + '3' => __('4', 'lsx-health-plan'), |
|
395 | + '2' => __('6', 'lsx-health-plan'), |
|
396 | 396 | ), |
397 | 397 | 'default' => '4', |
398 | 398 | ) |
@@ -401,18 +401,18 @@ discard block |
||
401 | 401 | array( |
402 | 402 | 'id' => 'workout_tab_content', |
403 | 403 | 'type' => 'select', |
404 | - 'name' => __( 'Grid Content', 'lsx-health-plan' ), |
|
405 | - 'description' => __( 'Choose to show the excerpt, full content or nothing. For the grid layout only', 'lsx-health-plan' ), |
|
404 | + 'name' => __('Grid Content', 'lsx-health-plan'), |
|
405 | + 'description' => __('Choose to show the excerpt, full content or nothing. For the grid layout only', 'lsx-health-plan'), |
|
406 | 406 | 'options' => array( |
407 | - '' => __( 'None', 'lsx-health-plan' ), |
|
408 | - 'excerpt' => __( 'Excerpt', 'lsx-health-plan' ), |
|
409 | - 'full' => __( 'Full Content', 'lsx-health-plan' ), |
|
407 | + '' => __('None', 'lsx-health-plan'), |
|
408 | + 'excerpt' => __('Excerpt', 'lsx-health-plan'), |
|
409 | + 'full' => __('Full Content', 'lsx-health-plan'), |
|
410 | 410 | ), |
411 | 411 | 'default' => '', |
412 | 412 | ) |
413 | 413 | ); |
414 | 414 | |
415 | - do_action( 'lsx_hp_workout_settings_page', $cmb ); |
|
415 | + do_action('lsx_hp_workout_settings_page', $cmb); |
|
416 | 416 | |
417 | 417 | $cmb->add_field( |
418 | 418 | array( |
@@ -39,24 +39,24 @@ discard block |
||
39 | 39 | * Contructor |
40 | 40 | */ |
41 | 41 | public function __construct() { |
42 | - add_action( 'init', array( $this, 'register_post_type' ) ); |
|
43 | - add_action( 'init', array( $this, 'taxonomy_setup' ) ); |
|
44 | - add_action( 'admin_menu', array( $this, 'register_menus' ) ); |
|
42 | + add_action('init', array($this, 'register_post_type')); |
|
43 | + add_action('init', array($this, 'taxonomy_setup')); |
|
44 | + add_action('admin_menu', array($this, 'register_menus')); |
|
45 | 45 | |
46 | 46 | // Frontend Actions and Filters. |
47 | - add_action( 'lsx_content_wrap_before', 'lsx_health_plan_recipe_archive_description', 11 ); |
|
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 | - add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 ); |
|
51 | - add_filter( 'get_the_archive_title', array( $this, 'get_the_archive_title' ), 100 ); |
|
52 | - add_filter( 'lsx_display_global_header_description', array( $this, 'disable_global_header_description' ), 100 ); |
|
53 | - add_filter( 'woocommerce_get_breadcrumb', array( $this, 'recipes_breadcrumb_filter' ), 30, 1 ); |
|
47 | + add_action('lsx_content_wrap_before', 'lsx_health_plan_recipe_archive_description', 11); |
|
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 | + add_filter('lsx_health_plan_connections', array($this, 'enable_connections'), 10, 1); |
|
51 | + add_filter('get_the_archive_title', array($this, 'get_the_archive_title'), 100); |
|
52 | + add_filter('lsx_display_global_header_description', array($this, 'disable_global_header_description'), 100); |
|
53 | + add_filter('woocommerce_get_breadcrumb', array($this, 'recipes_breadcrumb_filter'), 30, 1); |
|
54 | 54 | |
55 | 55 | // Backend Actions and Filters. |
56 | - add_action( 'cmb2_admin_init', array( $this, 'featured_metabox' ) ); |
|
57 | - add_action( 'cmb2_admin_init', array( $this, 'details_metaboxes' ) ); |
|
58 | - add_action( 'cmb2_admin_init', array( $this, 'recipes_connections' ), 5 ); |
|
59 | - add_action( 'lsx_hp_settings_page', array( $this, 'register_settings' ), 9, 1 ); |
|
56 | + add_action('cmb2_admin_init', array($this, 'featured_metabox')); |
|
57 | + add_action('cmb2_admin_init', array($this, 'details_metaboxes')); |
|
58 | + add_action('cmb2_admin_init', array($this, 'recipes_connections'), 5); |
|
59 | + add_action('lsx_hp_settings_page', array($this, 'register_settings'), 9, 1); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | public static function get_instance() { |
70 | 70 | |
71 | 71 | // If the single instance hasn't been set, set it now. |
72 | - if ( null === self::$instance ) { |
|
72 | + if (null === self::$instance) { |
|
73 | 73 | self::$instance = new self(); |
74 | 74 | } |
75 | 75 | |
@@ -82,21 +82,21 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function register_post_type() { |
84 | 84 | $this->labels = array( |
85 | - 'name' => esc_html__( 'Recipe', 'lsx-health-plan' ), |
|
86 | - 'singular_name' => esc_html__( 'Recipes', 'lsx-health-plan' ), |
|
87 | - 'add_new' => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ), |
|
88 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
89 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
90 | - 'new_item' => esc_html__( 'New', 'lsx-health-plan' ), |
|
91 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
92 | - 'view_item' => esc_html__( 'View', 'lsx-health-plan' ), |
|
93 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
94 | - 'not_found' => esc_html__( 'None found', 'lsx-health-plan' ), |
|
95 | - 'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ), |
|
85 | + 'name' => esc_html__('Recipe', 'lsx-health-plan'), |
|
86 | + 'singular_name' => esc_html__('Recipes', 'lsx-health-plan'), |
|
87 | + 'add_new' => esc_html_x('Add New', 'post type general name', 'lsx-health-plan'), |
|
88 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
89 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
90 | + 'new_item' => esc_html__('New', 'lsx-health-plan'), |
|
91 | + 'all_items' => esc_html__('All', 'lsx-health-plan'), |
|
92 | + 'view_item' => esc_html__('View', 'lsx-health-plan'), |
|
93 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
94 | + 'not_found' => esc_html__('None found', 'lsx-health-plan'), |
|
95 | + 'not_found_in_trash' => esc_html__('None found in Trash', 'lsx-health-plan'), |
|
96 | 96 | 'parent_item_colon' => '', |
97 | - 'menu_name' => esc_html__( 'Recipes', 'lsx-health-plan' ), |
|
97 | + 'menu_name' => esc_html__('Recipes', 'lsx-health-plan'), |
|
98 | 98 | ); |
99 | - $args = array( |
|
99 | + $args = array( |
|
100 | 100 | 'labels' => $this->labels, |
101 | 101 | 'public' => true, |
102 | 102 | 'publicly_queryable' => true, |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | 'thumbnail', |
119 | 119 | ), |
120 | 120 | ); |
121 | - register_post_type( 'recipe', $args ); |
|
121 | + register_post_type('recipe', $args); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | * @return void |
128 | 128 | */ |
129 | 129 | public function register_menus() { |
130 | - add_submenu_page( 'edit.php?post_type=meal', esc_html__( 'Recipes', 'lsx-health-plan' ), esc_html__( 'Recipes', 'lsx-health-plan' ), 'edit_posts', 'edit.php?post_type=recipe' ); |
|
131 | - add_submenu_page( 'edit.php?post_type=meal', esc_html__( 'Types', 'lsx-health-plan' ), esc_html__( 'Types', 'lsx-health-plan' ), 'edit_posts', 'edit-tags.php?taxonomy=recipe-type&post_type=recipe' ); |
|
132 | - add_submenu_page( 'edit.php?post_type=meal', esc_html__( 'Cuisines', 'lsx-health-plan' ), esc_html__( 'Cuisines', 'lsx-health-plan' ), 'edit_posts', 'edit-tags.php?taxonomy=recipe-cuisine&post_type=recipe' ); |
|
130 | + add_submenu_page('edit.php?post_type=meal', esc_html__('Recipes', 'lsx-health-plan'), esc_html__('Recipes', 'lsx-health-plan'), 'edit_posts', 'edit.php?post_type=recipe'); |
|
131 | + add_submenu_page('edit.php?post_type=meal', esc_html__('Types', 'lsx-health-plan'), esc_html__('Types', 'lsx-health-plan'), 'edit_posts', 'edit-tags.php?taxonomy=recipe-type&post_type=recipe'); |
|
132 | + add_submenu_page('edit.php?post_type=meal', esc_html__('Cuisines', 'lsx-health-plan'), esc_html__('Cuisines', 'lsx-health-plan'), 'edit_posts', 'edit-tags.php?taxonomy=recipe-cuisine&post_type=recipe'); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -137,19 +137,19 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function taxonomy_setup() { |
139 | 139 | $labels = array( |
140 | - 'name' => esc_html_x( 'Cuisine', 'taxonomy general name', 'lsx-health-plan' ), |
|
141 | - 'singular_name' => esc_html_x( 'Cuisines', 'taxonomy singular name', 'lsx-health-plan' ), |
|
142 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
143 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
144 | - 'parent_item' => esc_html__( 'Parent', 'lsx-health-plan' ), |
|
145 | - 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ), |
|
146 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
147 | - 'update_item' => esc_html__( 'Update', 'lsx-health-plan' ), |
|
148 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
149 | - 'new_item_name' => esc_html__( 'New Name', 'lsx-health-plan' ), |
|
150 | - 'menu_name' => esc_html__( 'Cuisines', 'lsx-health-plan' ), |
|
140 | + 'name' => esc_html_x('Cuisine', 'taxonomy general name', 'lsx-health-plan'), |
|
141 | + 'singular_name' => esc_html_x('Cuisines', 'taxonomy singular name', 'lsx-health-plan'), |
|
142 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
143 | + 'all_items' => esc_html__('All', 'lsx-health-plan'), |
|
144 | + 'parent_item' => esc_html__('Parent', 'lsx-health-plan'), |
|
145 | + 'parent_item_colon' => esc_html__('Parent:', 'lsx-health-plan'), |
|
146 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
147 | + 'update_item' => esc_html__('Update', 'lsx-health-plan'), |
|
148 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
149 | + 'new_item_name' => esc_html__('New Name', 'lsx-health-plan'), |
|
150 | + 'menu_name' => esc_html__('Cuisines', 'lsx-health-plan'), |
|
151 | 151 | ); |
152 | - $args = array( |
|
152 | + $args = array( |
|
153 | 153 | 'hierarchical' => true, |
154 | 154 | 'labels' => $labels, |
155 | 155 | 'show_ui' => true, |
@@ -160,22 +160,22 @@ discard block |
||
160 | 160 | 'slug' => 'recipe-cuisine', |
161 | 161 | ), |
162 | 162 | ); |
163 | - register_taxonomy( 'recipe-cuisine', array( $this->slug ), $args ); |
|
163 | + register_taxonomy('recipe-cuisine', array($this->slug), $args); |
|
164 | 164 | |
165 | 165 | $labels = array( |
166 | - 'name' => esc_html_x( 'Type', 'taxonomy general name', 'lsx-health-plan' ), |
|
167 | - 'singular_name' => esc_html_x( 'Types', 'taxonomy singular name', 'lsx-health-plan' ), |
|
168 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
169 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
170 | - 'parent_item' => esc_html__( 'Parent', 'lsx-health-plan' ), |
|
171 | - 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ), |
|
172 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
173 | - 'update_item' => esc_html__( 'Update', 'lsx-health-plan' ), |
|
174 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
175 | - 'new_item_name' => esc_html__( 'New Name', 'lsx-health-plan' ), |
|
176 | - 'menu_name' => esc_html__( 'Types', 'lsx-health-plan' ), |
|
166 | + 'name' => esc_html_x('Type', 'taxonomy general name', 'lsx-health-plan'), |
|
167 | + 'singular_name' => esc_html_x('Types', 'taxonomy singular name', 'lsx-health-plan'), |
|
168 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
169 | + 'all_items' => esc_html__('All', 'lsx-health-plan'), |
|
170 | + 'parent_item' => esc_html__('Parent', 'lsx-health-plan'), |
|
171 | + 'parent_item_colon' => esc_html__('Parent:', 'lsx-health-plan'), |
|
172 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
173 | + 'update_item' => esc_html__('Update', 'lsx-health-plan'), |
|
174 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
175 | + 'new_item_name' => esc_html__('New Name', 'lsx-health-plan'), |
|
176 | + 'menu_name' => esc_html__('Types', 'lsx-health-plan'), |
|
177 | 177 | ); |
178 | - $args = array( |
|
178 | + $args = array( |
|
179 | 179 | 'hierarchical' => true, |
180 | 180 | 'labels' => $labels, |
181 | 181 | 'show_ui' => true, |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | 'slug' => 'recipe-type', |
187 | 187 | ), |
188 | 188 | ); |
189 | - register_taxonomy( 'recipe-type', array( $this->slug ), $args ); |
|
189 | + register_taxonomy('recipe-type', array($this->slug), $args); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | /** |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * @param array $post_types |
196 | 196 | * @return array |
197 | 197 | */ |
198 | - public function enable_post_type( $post_types = array() ) { |
|
198 | + public function enable_post_type($post_types = array()) { |
|
199 | 199 | $post_types[] = $this->slug; |
200 | 200 | return $post_types; |
201 | 201 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | * @param array $connections |
207 | 207 | * @return void |
208 | 208 | */ |
209 | - public function enable_connections( $connections = array() ) { |
|
209 | + public function enable_connections($connections = array()) { |
|
210 | 210 | $connections['recipe']['connected_plans'] = 'connected_recipes'; |
211 | 211 | $connections['plan']['connected_recipes'] = 'connected_plans'; |
212 | 212 | return $connections; |
@@ -218,17 +218,17 @@ discard block |
||
218 | 218 | * @param string $title the term title. |
219 | 219 | * @return string |
220 | 220 | */ |
221 | - public function get_the_archive_title( $title ) { |
|
222 | - if ( is_post_type_archive( 'recipe' ) ) { |
|
223 | - $title = __( 'Recipes', 'lsx-health-plan' ); |
|
221 | + public function get_the_archive_title($title) { |
|
222 | + if (is_post_type_archive('recipe')) { |
|
223 | + $title = __('Recipes', 'lsx-health-plan'); |
|
224 | 224 | } |
225 | - if ( is_post_type_archive( 'exercise' ) ) { |
|
226 | - $title = __( 'Exercises', 'lsx-health-plan' ); |
|
225 | + if (is_post_type_archive('exercise')) { |
|
226 | + $title = __('Exercises', 'lsx-health-plan'); |
|
227 | 227 | } |
228 | - if ( is_tax( 'recipe-type' ) ) { |
|
228 | + if (is_tax('recipe-type')) { |
|
229 | 229 | $queried_object = get_queried_object(); |
230 | - if ( isset( $queried_object->name ) ) { |
|
231 | - $title = $queried_object->name . ' ' . __( 'Recipes', 'lsx-health-plan' ); |
|
230 | + if (isset($queried_object->name)) { |
|
231 | + $title = $queried_object->name . ' ' . __('Recipes', 'lsx-health-plan'); |
|
232 | 232 | } |
233 | 233 | } |
234 | 234 | return $title; |
@@ -240,8 +240,8 @@ discard block |
||
240 | 240 | * @param boolean $disable |
241 | 241 | * @return boolean |
242 | 242 | */ |
243 | - public function disable_global_header_description( $disable ) { |
|
244 | - if ( is_tax( 'recipe-type' ) ) { |
|
243 | + public function disable_global_header_description($disable) { |
|
244 | + if (is_tax('recipe-type')) { |
|
245 | 245 | $disable = true; |
246 | 246 | } |
247 | 247 | return $disable; |
@@ -253,11 +253,11 @@ discard block |
||
253 | 253 | * @var array $crumbs |
254 | 254 | * @return array |
255 | 255 | */ |
256 | - public function recipes_breadcrumb_filter( $crumbs ) { |
|
257 | - if ( is_tax( 'recipe-type' ) ) { |
|
256 | + public function recipes_breadcrumb_filter($crumbs) { |
|
257 | + if (is_tax('recipe-type')) { |
|
258 | 258 | $text = $this->labels['singular_name']; |
259 | - $url = get_post_type_archive_link( 'recipe' ); |
|
260 | - if ( function_exists( 'woocommerce_breadcrumb' ) ) { |
|
259 | + $url = get_post_type_archive_link('recipe'); |
|
260 | + if (function_exists('woocommerce_breadcrumb')) { |
|
261 | 261 | $crumbs[1] = array( |
262 | 262 | 0 => $text, |
263 | 263 | 1 => $url, |
@@ -279,8 +279,8 @@ discard block |
||
279 | 279 | $cmb = new_cmb2_box( |
280 | 280 | array( |
281 | 281 | 'id' => $this->slug . '_featured_metabox', |
282 | - 'title' => __( 'Featured', 'lsx-health-plan' ), |
|
283 | - 'object_types' => array( $this->slug ), |
|
282 | + 'title' => __('Featured', 'lsx-health-plan'), |
|
283 | + 'object_types' => array($this->slug), |
|
284 | 284 | 'context' => 'side', |
285 | 285 | 'priority' => 'high', |
286 | 286 | 'show_names' => true, |
@@ -288,8 +288,8 @@ discard block |
||
288 | 288 | ); |
289 | 289 | $cmb->add_field( |
290 | 290 | array( |
291 | - 'name' => __( 'Featured', 'lsx-health-plan' ), |
|
292 | - 'desc' => __( 'Enable the checkbox to feature this recipe, featured recipes display in any page that has the recipe shortcode: [lsx_health_plan_featured_recipes_block]', 'lsx-health-plan' ), |
|
291 | + 'name' => __('Featured', 'lsx-health-plan'), |
|
292 | + 'desc' => __('Enable the checkbox to feature this recipe, featured recipes display in any page that has the recipe shortcode: [lsx_health_plan_featured_recipes_block]', 'lsx-health-plan'), |
|
293 | 293 | 'id' => $this->slug . '_featured', |
294 | 294 | 'type' => 'checkbox', |
295 | 295 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
@@ -304,8 +304,8 @@ discard block |
||
304 | 304 | $cmb = new_cmb2_box( |
305 | 305 | array( |
306 | 306 | 'id' => $this->slug . '_details_metabox', |
307 | - 'title' => __( 'Cooking Info', 'lsx-health-plan' ), |
|
308 | - 'object_types' => array( $this->slug ), // Post type |
|
307 | + 'title' => __('Cooking Info', 'lsx-health-plan'), |
|
308 | + 'object_types' => array($this->slug), // Post type |
|
309 | 309 | 'context' => 'normal', |
310 | 310 | 'priority' => 'high', |
311 | 311 | 'show_names' => true, |
@@ -313,27 +313,27 @@ discard block |
||
313 | 313 | ); |
314 | 314 | $cmb->add_field( |
315 | 315 | array( |
316 | - 'name' => __( 'Prep Time', 'lsx-health-plan' ), |
|
316 | + 'name' => __('Prep Time', 'lsx-health-plan'), |
|
317 | 317 | 'id' => $this->slug . '_prep_time', |
318 | - 'desc' => __( 'Add the preparation time for the entire meal i.e: 25 mins', 'lsx-health-plan' ), |
|
318 | + 'desc' => __('Add the preparation time for the entire meal i.e: 25 mins', 'lsx-health-plan'), |
|
319 | 319 | 'type' => 'text', |
320 | 320 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
321 | 321 | ) |
322 | 322 | ); |
323 | 323 | $cmb->add_field( |
324 | 324 | array( |
325 | - 'name' => __( 'Cooking Time', 'lsx-health-plan' ), |
|
325 | + 'name' => __('Cooking Time', 'lsx-health-plan'), |
|
326 | 326 | 'id' => $this->slug . '_cooking_time', |
327 | - 'desc' => __( 'Add the cooking time i.e: 15 mins', 'lsx-health-plan' ), |
|
327 | + 'desc' => __('Add the cooking time i.e: 15 mins', 'lsx-health-plan'), |
|
328 | 328 | 'type' => 'text', |
329 | 329 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
330 | 330 | ) |
331 | 331 | ); |
332 | 332 | $cmb->add_field( |
333 | 333 | array( |
334 | - 'name' => __( 'Serves', 'lsx-health-plan' ), |
|
334 | + 'name' => __('Serves', 'lsx-health-plan'), |
|
335 | 335 | 'id' => $this->slug . '_serves', |
336 | - 'desc' => __( 'Add the recommended serving size i.e: 6', 'lsx-health-plan' ), |
|
336 | + 'desc' => __('Add the recommended serving size i.e: 6', 'lsx-health-plan'), |
|
337 | 337 | 'type' => 'text', |
338 | 338 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
339 | 339 | 'attributes' => array( |
@@ -344,8 +344,8 @@ discard block |
||
344 | 344 | ); |
345 | 345 | $cmb->add_field( |
346 | 346 | array( |
347 | - 'name' => __( 'Portion', 'lsx-health-plan' ), |
|
348 | - 'desc' => __( 'Add the recommended portion size i.e: 200mg', 'lsx-health-plan' ), |
|
347 | + 'name' => __('Portion', 'lsx-health-plan'), |
|
348 | + 'desc' => __('Add the recommended portion size i.e: 200mg', 'lsx-health-plan'), |
|
349 | 349 | 'id' => $this->slug . '_portion', |
350 | 350 | 'type' => 'text', |
351 | 351 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
@@ -354,8 +354,8 @@ discard block |
||
354 | 354 | $cmb = new_cmb2_box( |
355 | 355 | array( |
356 | 356 | 'id' => $this->slug . '_nutritional_metabox', |
357 | - 'title' => __( 'Nutritional Info', 'lsx-health-plan' ), |
|
358 | - 'object_types' => array( $this->slug ), // Post type |
|
357 | + 'title' => __('Nutritional Info', 'lsx-health-plan'), |
|
358 | + 'object_types' => array($this->slug), // Post type |
|
359 | 359 | 'context' => 'normal', |
360 | 360 | 'priority' => 'high', |
361 | 361 | 'show_names' => true, |
@@ -363,45 +363,45 @@ discard block |
||
363 | 363 | ); |
364 | 364 | $cmb->add_field( |
365 | 365 | array( |
366 | - 'name' => __( 'Energy', 'lsx-health-plan' ), |
|
366 | + 'name' => __('Energy', 'lsx-health-plan'), |
|
367 | 367 | 'id' => $this->slug . '_energy', |
368 | - 'desc' => __( 'Add the energy amount for the entire meal i.e: 700 kj', 'lsx-health-plan' ), |
|
368 | + 'desc' => __('Add the energy amount for the entire meal i.e: 700 kj', 'lsx-health-plan'), |
|
369 | 369 | 'type' => 'text', |
370 | 370 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
371 | 371 | ) |
372 | 372 | ); |
373 | 373 | $cmb->add_field( |
374 | 374 | array( |
375 | - 'name' => __( 'Protein', 'lsx-health-plan' ), |
|
375 | + 'name' => __('Protein', 'lsx-health-plan'), |
|
376 | 376 | 'id' => $this->slug . '_protein', |
377 | - 'desc' => __( 'Add the protein amount for the entire meal i.e: 50 g', 'lsx-health-plan' ), |
|
377 | + 'desc' => __('Add the protein amount for the entire meal i.e: 50 g', 'lsx-health-plan'), |
|
378 | 378 | 'type' => 'text', |
379 | 379 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
380 | 380 | ) |
381 | 381 | ); |
382 | 382 | $cmb->add_field( |
383 | 383 | array( |
384 | - 'name' => __( 'Carbohydrates', 'lsx-health-plan' ), |
|
384 | + 'name' => __('Carbohydrates', 'lsx-health-plan'), |
|
385 | 385 | 'id' => $this->slug . '_carbohydrates', |
386 | - 'desc' => __( 'Add the carbohydrates amount for the entire meal i.e: 5 g', 'lsx-health-plan' ), |
|
386 | + 'desc' => __('Add the carbohydrates amount for the entire meal i.e: 5 g', 'lsx-health-plan'), |
|
387 | 387 | 'type' => 'text', |
388 | 388 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
389 | 389 | ) |
390 | 390 | ); |
391 | 391 | $cmb->add_field( |
392 | 392 | array( |
393 | - 'name' => __( 'Fibre', 'lsx-health-plan' ), |
|
393 | + 'name' => __('Fibre', 'lsx-health-plan'), |
|
394 | 394 | 'id' => $this->slug . '_fibre', |
395 | - 'desc' => __( 'Add the fibre amount for the entire meal i.e: 5 g', 'lsx-health-plan' ), |
|
395 | + 'desc' => __('Add the fibre amount for the entire meal i.e: 5 g', 'lsx-health-plan'), |
|
396 | 396 | 'type' => 'text', |
397 | 397 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
398 | 398 | ) |
399 | 399 | ); |
400 | 400 | $cmb->add_field( |
401 | 401 | array( |
402 | - 'name' => __( 'Fat', 'lsx-health-plan' ), |
|
402 | + 'name' => __('Fat', 'lsx-health-plan'), |
|
403 | 403 | 'id' => $this->slug . '_fat', |
404 | - 'desc' => __( 'Add the fat amount for the entire meal i.e: 20 g', 'lsx-health-plan' ), |
|
404 | + 'desc' => __('Add the fat amount for the entire meal i.e: 20 g', 'lsx-health-plan'), |
|
405 | 405 | 'type' => 'text', |
406 | 406 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
407 | 407 | ) |
@@ -417,8 +417,8 @@ discard block |
||
417 | 417 | $cmb = new_cmb2_box( |
418 | 418 | array( |
419 | 419 | 'id' => $this->slug . '_recipes_connections_metabox', |
420 | - 'title' => __( 'Recipes', 'lsx-health-plan' ), |
|
421 | - 'object_types' => array( 'plan' ), // Post type |
|
420 | + 'title' => __('Recipes', 'lsx-health-plan'), |
|
421 | + 'object_types' => array('plan'), // Post type |
|
422 | 422 | 'context' => 'normal', |
423 | 423 | 'priority' => 'high', |
424 | 424 | 'show_names' => true, |
@@ -426,16 +426,16 @@ discard block |
||
426 | 426 | ); |
427 | 427 | $cmb->add_field( |
428 | 428 | array( |
429 | - 'name' => __( 'Recipes', 'lsx-health-plan' ), |
|
430 | - 'desc' => __( 'Connect the recipes that apply to this day plan using the field provided.', 'lsx-health-plan' ), |
|
429 | + 'name' => __('Recipes', 'lsx-health-plan'), |
|
430 | + 'desc' => __('Connect the recipes that apply to this day plan using the field provided.', 'lsx-health-plan'), |
|
431 | 431 | 'id' => 'connected_recipes', |
432 | 432 | 'type' => 'post_search_ajax', |
433 | 433 | // Optional : |
434 | - 'limit' => 15, // Limit selection to X items only (default 1) |
|
434 | + 'limit' => 15, // Limit selection to X items only (default 1) |
|
435 | 435 | 'sortable' => true, // Allow selected items to be sortable (default false) |
436 | 436 | 'query_args' => array( |
437 | - 'post_type' => array( $this->slug ), |
|
438 | - 'post_status' => array( 'publish' ), |
|
437 | + 'post_type' => array($this->slug), |
|
438 | + 'post_status' => array('publish'), |
|
439 | 439 | 'posts_per_page' => -1, |
440 | 440 | ), |
441 | 441 | ) |
@@ -448,24 +448,24 @@ discard block |
||
448 | 448 | * @param object $cmb new_cmb2_box(). |
449 | 449 | * @return void |
450 | 450 | */ |
451 | - public function register_settings( $cmb ) { |
|
451 | + public function register_settings($cmb) { |
|
452 | 452 | $cmb->add_field( |
453 | 453 | array( |
454 | 454 | 'id' => 'recipe_archive_settings_title', |
455 | 455 | 'type' => 'title', |
456 | - 'name' => __( 'Recipes Archive', 'lsx-health-plan' ), |
|
457 | - 'description' => __( 'All of the settings relating to the recipes post type archive.', 'lsx-health-plan' ), |
|
456 | + 'name' => __('Recipes Archive', 'lsx-health-plan'), |
|
457 | + 'description' => __('All of the settings relating to the recipes post type archive.', 'lsx-health-plan'), |
|
458 | 458 | ) |
459 | 459 | ); |
460 | 460 | $cmb->add_field( |
461 | 461 | array( |
462 | 462 | 'id' => 'recipe_archive_description', |
463 | 463 | 'type' => 'wysiwyg', |
464 | - 'name' => __( 'Archive Description', 'lsx-health-plan' ), |
|
465 | - 'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ), |
|
464 | + 'name' => __('Archive Description', 'lsx-health-plan'), |
|
465 | + 'description' => __('This will show up on the post type archive.', 'lsx-health-plan'), |
|
466 | 466 | ) |
467 | 467 | ); |
468 | - do_action( 'lsx_hp_recipe_settings_page', $cmb ); |
|
468 | + do_action('lsx_hp_recipe_settings_page', $cmb); |
|
469 | 469 | $cmb->add_field( |
470 | 470 | array( |
471 | 471 | 'id' => 'settings_recipe_archive_closing', |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | * Contructor |
31 | 31 | */ |
32 | 32 | public function __construct() { |
33 | - add_action( 'init', array( $this, 'register_post_type' ) ); |
|
34 | - add_action( 'admin_menu', array( $this, 'register_menus' ) ); |
|
35 | - add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 ); |
|
36 | - add_action( 'cmb2_admin_init', array( $this, 'featured_metabox' ) ); |
|
37 | - add_action( 'cmb2_admin_init', array( $this, 'tips_connections' ), 15 ); |
|
33 | + add_action('init', array($this, 'register_post_type')); |
|
34 | + add_action('admin_menu', array($this, 'register_menus')); |
|
35 | + add_filter('lsx_health_plan_connections', array($this, 'enable_connections'), 10, 1); |
|
36 | + add_action('cmb2_admin_init', array($this, 'featured_metabox')); |
|
37 | + add_action('cmb2_admin_init', array($this, 'tips_connections'), 15); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public static function get_instance() { |
48 | 48 | // If the single instance hasn't been set, set it now. |
49 | - if ( null === self::$instance ) { |
|
49 | + if (null === self::$instance) { |
|
50 | 50 | self::$instance = new self(); |
51 | 51 | } |
52 | 52 | return self::$instance; |
@@ -56,21 +56,21 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function register_post_type() { |
58 | 58 | $labels = array( |
59 | - 'name' => esc_html__( 'Tip', 'lsx-health-plan' ), |
|
60 | - 'singular_name' => esc_html__( 'Tips', 'lsx-health-plan' ), |
|
61 | - 'add_new' => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ), |
|
62 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
63 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
64 | - 'new_item' => esc_html__( 'New', 'lsx-health-plan' ), |
|
65 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
66 | - 'view_item' => esc_html__( 'View', 'lsx-health-plan' ), |
|
67 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
68 | - 'not_found' => esc_html__( 'None found', 'lsx-health-plan' ), |
|
69 | - 'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ), |
|
59 | + 'name' => esc_html__('Tip', 'lsx-health-plan'), |
|
60 | + 'singular_name' => esc_html__('Tips', 'lsx-health-plan'), |
|
61 | + 'add_new' => esc_html_x('Add New', 'post type general name', 'lsx-health-plan'), |
|
62 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
63 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
64 | + 'new_item' => esc_html__('New', 'lsx-health-plan'), |
|
65 | + 'all_items' => esc_html__('All', 'lsx-health-plan'), |
|
66 | + 'view_item' => esc_html__('View', 'lsx-health-plan'), |
|
67 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
68 | + 'not_found' => esc_html__('None found', 'lsx-health-plan'), |
|
69 | + 'not_found_in_trash' => esc_html__('None found in Trash', 'lsx-health-plan'), |
|
70 | 70 | 'parent_item_colon' => '', |
71 | - 'menu_name' => esc_html__( 'Tips', 'lsx-health-plan' ), |
|
71 | + 'menu_name' => esc_html__('Tips', 'lsx-health-plan'), |
|
72 | 72 | ); |
73 | - $args = array( |
|
73 | + $args = array( |
|
74 | 74 | 'labels' => $labels, |
75 | 75 | 'public' => true, |
76 | 76 | 'publicly_queryable' => false, |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | 'thumbnail', |
91 | 91 | ), |
92 | 92 | ); |
93 | - register_post_type( 'tip', $args ); |
|
93 | + register_post_type('tip', $args); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @return void |
100 | 100 | */ |
101 | 101 | public function register_menus() { |
102 | - add_submenu_page( 'edit.php?post_type=plan', esc_html__( 'Tips', 'lsx-health-plan' ), esc_html__( 'Tips', 'lsx-health-plan' ), 'edit_posts', 'edit.php?post_type=tip' ); |
|
102 | + add_submenu_page('edit.php?post_type=plan', esc_html__('Tips', 'lsx-health-plan'), esc_html__('Tips', 'lsx-health-plan'), 'edit_posts', 'edit.php?post_type=tip'); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * @param array $connections |
109 | 109 | * @return void |
110 | 110 | */ |
111 | - public function enable_connections( $connections = array() ) { |
|
111 | + public function enable_connections($connections = array()) { |
|
112 | 112 | $connections['tip']['connected_plans'] = 'connected_tips'; |
113 | 113 | $connections['plan']['connected_tips'] = 'connected_plans'; |
114 | 114 | return $connections; |
@@ -120,49 +120,49 @@ discard block |
||
120 | 120 | * @return void |
121 | 121 | */ |
122 | 122 | public function tips_connections() { |
123 | - $cmb = new_cmb2_box( array( |
|
123 | + $cmb = new_cmb2_box(array( |
|
124 | 124 | 'id' => $this->slug . '_tips_connections_metabox', |
125 | - 'title' => __( 'Tips', 'lsx-health-plan' ), |
|
126 | - 'object_types' => array( 'plan' ), // Post type |
|
125 | + 'title' => __('Tips', 'lsx-health-plan'), |
|
126 | + 'object_types' => array('plan'), // Post type |
|
127 | 127 | 'context' => 'normal', |
128 | 128 | 'priority' => 'high', |
129 | 129 | 'show_names' => false, |
130 | - ) ); |
|
131 | - $cmb->add_field( array( |
|
132 | - 'name' => __( 'Tips', 'lsx-health-plan' ), |
|
130 | + )); |
|
131 | + $cmb->add_field(array( |
|
132 | + 'name' => __('Tips', 'lsx-health-plan'), |
|
133 | 133 | 'id' => 'connected_tips', |
134 | - 'desc' => __( 'Connect the tips that apply to this day plan using the field provided.', 'lsx-health-plan' ), |
|
134 | + 'desc' => __('Connect the tips that apply to this day plan using the field provided.', 'lsx-health-plan'), |
|
135 | 135 | 'type' => 'post_search_ajax', |
136 | 136 | // Optional : |
137 | - 'limit' => 15, // Limit selection to X items only (default 1) |
|
138 | - 'sortable' => true, // Allow selected items to be sortable (default false) |
|
137 | + 'limit' => 15, // Limit selection to X items only (default 1) |
|
138 | + 'sortable' => true, // Allow selected items to be sortable (default false) |
|
139 | 139 | 'query_args' => array( |
140 | - 'post_type' => array( 'tip' ), |
|
141 | - 'post_status' => array( 'publish' ), |
|
140 | + 'post_type' => array('tip'), |
|
141 | + 'post_status' => array('publish'), |
|
142 | 142 | 'posts_per_page' => -1, |
143 | 143 | ), |
144 | - ) ); |
|
144 | + )); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
148 | 148 | * Define the metabox and field configurations. |
149 | 149 | */ |
150 | 150 | public function featured_metabox() { |
151 | - $cmb = new_cmb2_box( array( |
|
151 | + $cmb = new_cmb2_box(array( |
|
152 | 152 | 'id' => $this->slug . '_featured_metabox_tip', |
153 | - 'title' => __( 'Featured', 'lsx-health-plan' ), |
|
154 | - 'object_types' => array( $this->slug ), // Post type |
|
153 | + 'title' => __('Featured', 'lsx-health-plan'), |
|
154 | + 'object_types' => array($this->slug), // Post type |
|
155 | 155 | 'context' => 'side', |
156 | 156 | 'priority' => 'high', |
157 | 157 | 'show_names' => true, |
158 | - ) ); |
|
159 | - $cmb->add_field( array( |
|
160 | - 'name' => __( 'Featured', 'lsx-health-plan' ), |
|
161 | - 'desc' => __( 'Enable the checkbox to feature this tip, featured tips display in any page that has the tip shortcode: [lsx_health_plan_featured_tips_block]' ), |
|
158 | + )); |
|
159 | + $cmb->add_field(array( |
|
160 | + 'name' => __('Featured', 'lsx-health-plan'), |
|
161 | + 'desc' => __('Enable the checkbox to feature this tip, featured tips display in any page that has the tip shortcode: [lsx_health_plan_featured_tips_block]'), |
|
162 | 162 | 'id' => $this->slug . '_featured_tip', |
163 | 163 | 'type' => 'checkbox', |
164 | 164 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
165 | - ) ); |
|
165 | + )); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | } |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | * Contructor |
31 | 31 | */ |
32 | 32 | public function __construct() { |
33 | - add_action( 'init', array( $this, 'register_post_type' ) ); |
|
34 | - add_action( 'init', array( $this, 'taxonomy_setup' ) ); |
|
35 | - add_filter( 'lsx_health_plan_single_template', array( $this, 'enable_post_type' ), 10, 1 ); |
|
36 | - add_action( 'cmb2_admin_init', array( $this, 'details_metaboxes' ), 5 ); |
|
37 | - add_action( 'cmb2_admin_init', array( $this, 'plan_connections' ), 5 ); |
|
38 | - add_filter( 'pre_get_posts', array( $this, 'set_parent_only' ), 10, 1 ); |
|
33 | + add_action('init', array($this, 'register_post_type')); |
|
34 | + add_action('init', array($this, 'taxonomy_setup')); |
|
35 | + add_filter('lsx_health_plan_single_template', array($this, 'enable_post_type'), 10, 1); |
|
36 | + add_action('cmb2_admin_init', array($this, 'details_metaboxes'), 5); |
|
37 | + add_action('cmb2_admin_init', array($this, 'plan_connections'), 5); |
|
38 | + add_filter('pre_get_posts', array($this, 'set_parent_only'), 10, 1); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public static function get_instance() { |
49 | 49 | // If the single instance hasn't been set, set it now. |
50 | - if ( null === self::$instance ) { |
|
50 | + if (null === self::$instance) { |
|
51 | 51 | self::$instance = new self(); |
52 | 52 | } |
53 | 53 | return self::$instance; |
@@ -57,21 +57,21 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function register_post_type() { |
59 | 59 | $labels = array( |
60 | - 'name' => esc_html__( 'Plan', 'lsx-health-plan' ), |
|
61 | - 'singular_name' => esc_html__( 'Plans', 'lsx-health-plan' ), |
|
62 | - 'add_new' => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ), |
|
63 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
64 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
65 | - 'new_item' => esc_html__( 'New', 'lsx-health-plan' ), |
|
66 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
67 | - 'view_item' => esc_html__( 'View', 'lsx-health-plan' ), |
|
68 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
69 | - 'not_found' => esc_html__( 'None found', 'lsx-health-plan' ), |
|
70 | - 'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ), |
|
60 | + 'name' => esc_html__('Plan', 'lsx-health-plan'), |
|
61 | + 'singular_name' => esc_html__('Plans', 'lsx-health-plan'), |
|
62 | + 'add_new' => esc_html_x('Add New', 'post type general name', 'lsx-health-plan'), |
|
63 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
64 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
65 | + 'new_item' => esc_html__('New', 'lsx-health-plan'), |
|
66 | + 'all_items' => esc_html__('All', 'lsx-health-plan'), |
|
67 | + 'view_item' => esc_html__('View', 'lsx-health-plan'), |
|
68 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
69 | + 'not_found' => esc_html__('None found', 'lsx-health-plan'), |
|
70 | + 'not_found_in_trash' => esc_html__('None found in Trash', 'lsx-health-plan'), |
|
71 | 71 | 'parent_item_colon' => '', |
72 | - 'menu_name' => esc_html__( 'Plans', 'lsx-health-plan' ), |
|
72 | + 'menu_name' => esc_html__('Plans', 'lsx-health-plan'), |
|
73 | 73 | ); |
74 | - $args = array( |
|
74 | + $args = array( |
|
75 | 75 | 'labels' => $labels, |
76 | 76 | 'public' => true, |
77 | 77 | 'publicly_queryable' => true, |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | 'menu_icon' => 'dashicons-welcome-write-blog', |
82 | 82 | 'query_var' => true, |
83 | 83 | 'rewrite' => array( |
84 | - 'slug' => \lsx_health_plan\functions\get_option( 'plan_single_slug', 'plan' ), |
|
84 | + 'slug' => \lsx_health_plan\functions\get_option('plan_single_slug', 'plan'), |
|
85 | 85 | ), |
86 | 86 | 'capability_type' => 'page', |
87 | - 'has_archive' => \lsx_health_plan\functions\get_option( 'endpoint_plan_archive', 'plans' ), |
|
87 | + 'has_archive' => \lsx_health_plan\functions\get_option('endpoint_plan_archive', 'plans'), |
|
88 | 88 | 'hierarchical' => true, |
89 | 89 | 'menu_position' => null, |
90 | 90 | 'supports' => array( |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | 'page-attributes', |
95 | 95 | ), |
96 | 96 | ); |
97 | - register_post_type( 'plan', $args ); |
|
97 | + register_post_type('plan', $args); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -102,17 +102,17 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function taxonomy_setup() { |
104 | 104 | $labels = array( |
105 | - 'name' => esc_html_x( 'Week', 'taxonomy general name', 'lsx-health-plan' ), |
|
106 | - 'singular_name' => esc_html_x( 'Week', 'taxonomy singular name', 'lsx-health-plan' ), |
|
107 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
108 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
109 | - 'parent_item' => esc_html__( 'Parent', 'lsx-health-plan' ), |
|
110 | - 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ), |
|
111 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
112 | - 'update_item' => esc_html__( 'Update', 'lsx-health-plan' ), |
|
113 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
114 | - 'new_item_name' => esc_html__( 'New Name', 'lsx-health-plan' ), |
|
115 | - 'menu_name' => esc_html__( 'Weeks', 'lsx-health-plan' ), |
|
105 | + 'name' => esc_html_x('Week', 'taxonomy general name', 'lsx-health-plan'), |
|
106 | + 'singular_name' => esc_html_x('Week', 'taxonomy singular name', 'lsx-health-plan'), |
|
107 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
108 | + 'all_items' => esc_html__('All', 'lsx-health-plan'), |
|
109 | + 'parent_item' => esc_html__('Parent', 'lsx-health-plan'), |
|
110 | + 'parent_item_colon' => esc_html__('Parent:', 'lsx-health-plan'), |
|
111 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
112 | + 'update_item' => esc_html__('Update', 'lsx-health-plan'), |
|
113 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
114 | + 'new_item_name' => esc_html__('New Name', 'lsx-health-plan'), |
|
115 | + 'menu_name' => esc_html__('Weeks', 'lsx-health-plan'), |
|
116 | 116 | ); |
117 | 117 | |
118 | 118 | $args = array( |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | ), |
127 | 127 | ); |
128 | 128 | |
129 | - register_taxonomy( 'week', array( 'plan' ), $args ); |
|
129 | + register_taxonomy('week', array('plan'), $args); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * @param array $post_types |
136 | 136 | * @return array |
137 | 137 | */ |
138 | - public function enable_post_type( $post_types = array() ) { |
|
138 | + public function enable_post_type($post_types = array()) { |
|
139 | 139 | $post_types[] = $this->slug; |
140 | 140 | return $post_types; |
141 | 141 | } |
@@ -144,33 +144,33 @@ discard block |
||
144 | 144 | * Define the metabox and field configurations. |
145 | 145 | */ |
146 | 146 | public function details_metaboxes() { |
147 | - $cmb = new_cmb2_box( array( |
|
147 | + $cmb = new_cmb2_box(array( |
|
148 | 148 | 'id' => $this->slug . '_details_metabox', |
149 | - 'title' => __( 'Details', 'lsx-health-plan' ), |
|
150 | - 'object_types' => array( $this->slug ), // Post type |
|
149 | + 'title' => __('Details', 'lsx-health-plan'), |
|
150 | + 'object_types' => array($this->slug), // Post type |
|
151 | 151 | 'context' => 'normal', |
152 | 152 | 'priority' => 'high', |
153 | 153 | 'show_names' => true, |
154 | - ) ); |
|
154 | + )); |
|
155 | 155 | |
156 | 156 | $warmup_type = 'page'; |
157 | - if ( false !== \lsx_health_plan\functions\get_option( 'exercise_enabled', false ) ) { |
|
158 | - $warmup_type = array( 'page', 'workout' ); |
|
157 | + if (false !== \lsx_health_plan\functions\get_option('exercise_enabled', false)) { |
|
158 | + $warmup_type = array('page', 'workout'); |
|
159 | 159 | } |
160 | - $cmb->add_field( array( |
|
161 | - 'name' => __( 'Warmup', 'lsx-health-plan' ), |
|
162 | - 'desc' => __( 'Connect the warm up page that applies to this day plan using the field provided.', 'lsx-health-plan' ), |
|
160 | + $cmb->add_field(array( |
|
161 | + 'name' => __('Warmup', 'lsx-health-plan'), |
|
162 | + 'desc' => __('Connect the warm up page that applies to this day plan using the field provided.', 'lsx-health-plan'), |
|
163 | 163 | 'id' => $this->slug . '_warmup', |
164 | 164 | 'type' => 'post_search_ajax', |
165 | 165 | // Optional : |
166 | - 'limit' => 3, // Limit selection to X items only (default 1) |
|
166 | + 'limit' => 3, // Limit selection to X items only (default 1) |
|
167 | 167 | 'sortable' => true, // Allow selected items to be sortable (default false) |
168 | 168 | 'query_args' => array( |
169 | 169 | 'post_type' => $warmup_type, |
170 | - 'post_status' => array( 'publish' ), |
|
170 | + 'post_status' => array('publish'), |
|
171 | 171 | 'posts_per_page' => -1, |
172 | 172 | ), |
173 | - ) ); |
|
173 | + )); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | /** |
@@ -182,8 +182,8 @@ discard block |
||
182 | 182 | $cmb = new_cmb2_box( |
183 | 183 | array( |
184 | 184 | 'id' => $this->slug . '_connections_metabox', |
185 | - 'title' => __( 'Plans', 'lsx-health-plan' ), |
|
186 | - 'object_types' => array( 'workout', 'meal', 'tip', 'recipe' ), |
|
185 | + 'title' => __('Plans', 'lsx-health-plan'), |
|
186 | + 'object_types' => array('workout', 'meal', 'tip', 'recipe'), |
|
187 | 187 | 'context' => 'normal', |
188 | 188 | 'priority' => 'high', |
189 | 189 | 'show_names' => true, |
@@ -191,15 +191,15 @@ discard block |
||
191 | 191 | ); |
192 | 192 | $cmb->add_field( |
193 | 193 | array( |
194 | - 'name' => __( 'Plan', 'lsx-health-plan' ), |
|
194 | + 'name' => __('Plan', 'lsx-health-plan'), |
|
195 | 195 | 'id' => 'connected_plans', |
196 | - 'desc' => __( 'Connect this to the day plan it applies to, using the field provided.', 'lsx-health-plan' ), |
|
196 | + 'desc' => __('Connect this to the day plan it applies to, using the field provided.', 'lsx-health-plan'), |
|
197 | 197 | 'type' => 'post_search_ajax', |
198 | 198 | 'limit' => 15, |
199 | 199 | 'sortable' => true, |
200 | 200 | 'query_args' => array( |
201 | - 'post_type' => array( 'plan' ), |
|
202 | - 'post_status' => array( 'publish' ), |
|
201 | + 'post_type' => array('plan'), |
|
202 | + 'post_status' => array('publish'), |
|
203 | 203 | 'posts_per_page' => -1, |
204 | 204 | ), |
205 | 205 | ) |
@@ -212,9 +212,9 @@ discard block |
||
212 | 212 | * @param object $wp_query |
213 | 213 | * @return array |
214 | 214 | */ |
215 | - public function set_parent_only( $wp_query ) { |
|
216 | - if ( ! is_admin() && $wp_query->is_main_query() && $wp_query->is_post_type_archive() && 'plan' === $wp_query->get_query_var( 'post_type' ) ) { |
|
217 | - $wp_query->set( 'parent', '0' ); |
|
215 | + public function set_parent_only($wp_query) { |
|
216 | + if ( ! is_admin() && $wp_query->is_main_query() && $wp_query->is_post_type_archive() && 'plan' === $wp_query->get_query_var('post_type')) { |
|
217 | + $wp_query->set('parent', '0'); |
|
218 | 218 | } |
219 | 219 | return $wp_query; |
220 | 220 | } |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | * Contructor |
31 | 31 | */ |
32 | 32 | public function __construct() { |
33 | - add_action( 'init', array( $this, 'register_post_type' ) ); |
|
34 | - add_action( 'admin_menu', array( $this, 'register_menus' ) ); |
|
35 | - add_filter( 'lsx_health_plan_single_template', array( $this, 'enable_post_type' ), 10, 1 ); |
|
36 | - add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 ); |
|
37 | - add_action( 'cmb2_admin_init', array( $this, 'details_metaboxes' ) ); |
|
33 | + add_action('init', array($this, 'register_post_type')); |
|
34 | + add_action('admin_menu', array($this, 'register_menus')); |
|
35 | + add_filter('lsx_health_plan_single_template', array($this, 'enable_post_type'), 10, 1); |
|
36 | + add_filter('lsx_health_plan_connections', array($this, 'enable_connections'), 10, 1); |
|
37 | + add_action('cmb2_admin_init', array($this, 'details_metaboxes')); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public static function get_instance() { |
48 | 48 | // If the single instance hasn't been set, set it now. |
49 | - if ( null === self::$instance ) { |
|
49 | + if (null === self::$instance) { |
|
50 | 50 | self::$instance = new self(); |
51 | 51 | } |
52 | 52 | return self::$instance; |
@@ -56,21 +56,21 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function register_post_type() { |
58 | 58 | $labels = array( |
59 | - 'name' => esc_html__( 'Video', 'lsx-health-plan' ), |
|
60 | - 'singular_name' => esc_html__( 'Videos', 'lsx-health-plan' ), |
|
61 | - 'add_new' => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ), |
|
62 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
63 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
64 | - 'new_item' => esc_html__( 'New', 'lsx-health-plan' ), |
|
65 | - 'all_items' => esc_html__( 'All', 'lsx-health-plan' ), |
|
66 | - 'view_item' => esc_html__( 'View', 'lsx-health-plan' ), |
|
67 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
68 | - 'not_found' => esc_html__( 'None found', 'lsx-health-plan' ), |
|
69 | - 'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ), |
|
59 | + 'name' => esc_html__('Video', 'lsx-health-plan'), |
|
60 | + 'singular_name' => esc_html__('Videos', 'lsx-health-plan'), |
|
61 | + 'add_new' => esc_html_x('Add New', 'post type general name', 'lsx-health-plan'), |
|
62 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
63 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
64 | + 'new_item' => esc_html__('New', 'lsx-health-plan'), |
|
65 | + 'all_items' => esc_html__('All', 'lsx-health-plan'), |
|
66 | + 'view_item' => esc_html__('View', 'lsx-health-plan'), |
|
67 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
68 | + 'not_found' => esc_html__('None found', 'lsx-health-plan'), |
|
69 | + 'not_found_in_trash' => esc_html__('None found in Trash', 'lsx-health-plan'), |
|
70 | 70 | 'parent_item_colon' => '', |
71 | - 'menu_name' => esc_html__( 'Videos', 'lsx-health-plan' ), |
|
71 | + 'menu_name' => esc_html__('Videos', 'lsx-health-plan'), |
|
72 | 72 | ); |
73 | - $args = array( |
|
73 | + $args = array( |
|
74 | 74 | 'labels' => $labels, |
75 | 75 | 'public' => true, |
76 | 76 | 'publicly_queryable' => true, |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | 'editor', |
90 | 90 | ), |
91 | 91 | ); |
92 | - register_post_type( 'video', $args ); |
|
92 | + register_post_type('video', $args); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @return void |
99 | 99 | */ |
100 | 100 | public function register_menus() { |
101 | - add_submenu_page( 'edit.php?post_type=workout', esc_html__( 'Videos', 'lsx-health-plan' ), esc_html__( 'Videos', 'lsx-health-plan' ), 'edit_posts', 'edit.php?post_type=video' ); |
|
101 | + add_submenu_page('edit.php?post_type=workout', esc_html__('Videos', 'lsx-health-plan'), esc_html__('Videos', 'lsx-health-plan'), 'edit_posts', 'edit.php?post_type=video'); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * @param array $post_types |
108 | 108 | * @return array |
109 | 109 | */ |
110 | - public function enable_post_type( $post_types = array() ) { |
|
110 | + public function enable_post_type($post_types = array()) { |
|
111 | 111 | $post_types[] = $this->slug; |
112 | 112 | return $post_types; |
113 | 113 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * @param array $connections |
119 | 119 | * @return void |
120 | 120 | */ |
121 | - public function enable_connections( $connections = array() ) { |
|
121 | + public function enable_connections($connections = array()) { |
|
122 | 122 | $connections['video']['connected_plans'] = 'connected_videos'; |
123 | 123 | $connections['plan']['connected_videos'] = 'connected_plans'; |
124 | 124 | $connections['video']['connected_workouts'] = 'connected_videos'; |
@@ -130,35 +130,35 @@ discard block |
||
130 | 130 | * Define the metabox and field configurations. |
131 | 131 | */ |
132 | 132 | public function details_metaboxes() { |
133 | - $cmb = new_cmb2_box( array( |
|
133 | + $cmb = new_cmb2_box(array( |
|
134 | 134 | 'id' => $this->slug . '_details_metabox', |
135 | - 'title' => __( 'Video Details', 'lsx-health-plan' ), |
|
136 | - 'object_types' => array( $this->slug ), // Post type |
|
135 | + 'title' => __('Video Details', 'lsx-health-plan'), |
|
136 | + 'object_types' => array($this->slug), // Post type |
|
137 | 137 | 'context' => 'normal', |
138 | 138 | 'priority' => 'high', |
139 | 139 | 'show_names' => true, |
140 | - ) ); |
|
141 | - $cmb->add_field( array( |
|
142 | - 'name' => __( 'Featured Video', 'lsx-health-plan' ), |
|
143 | - 'desc' => __( 'Enable the checkbox to feature this video, featured videos display in any page that has the video shortcode: [lsx_health_plan_featured_videos_block]', 'lsx-health-plan' ), |
|
140 | + )); |
|
141 | + $cmb->add_field(array( |
|
142 | + 'name' => __('Featured Video', 'lsx-health-plan'), |
|
143 | + 'desc' => __('Enable the checkbox to feature this video, featured videos display in any page that has the video shortcode: [lsx_health_plan_featured_videos_block]', 'lsx-health-plan'), |
|
144 | 144 | 'id' => $this->slug . '_featured_video', |
145 | 145 | 'type' => 'checkbox', |
146 | 146 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
147 | - ) ); |
|
148 | - $cmb->add_field( array( |
|
149 | - 'name' => __( 'Youtube Source', 'lsx-health-plan' ), |
|
150 | - 'desc' => __( 'Drop in the url for your video from YouTube in this field, i.e: "https://www.youtube.com/watch?v=9xwazD5SyVg"', 'lsx-health-plan' ), |
|
147 | + )); |
|
148 | + $cmb->add_field(array( |
|
149 | + 'name' => __('Youtube Source', 'lsx-health-plan'), |
|
150 | + 'desc' => __('Drop in the url for your video from YouTube in this field, i.e: "https://www.youtube.com/watch?v=9xwazD5SyVg"', 'lsx-health-plan'), |
|
151 | 151 | 'id' => $this->slug . '_youtube_source', |
152 | 152 | 'type' => 'oembed', |
153 | 153 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
154 | - ) ); |
|
155 | - $cmb->add_field( array( |
|
156 | - 'name' => __( 'Giphy Source', 'lsx-health-plan' ), |
|
157 | - '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' ), |
|
154 | + )); |
|
155 | + $cmb->add_field(array( |
|
156 | + 'name' => __('Giphy Source', 'lsx-health-plan'), |
|
157 | + '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'), |
|
158 | 158 | 'id' => $this->slug . '_giphy_source', |
159 | 159 | 'type' => 'textarea_code', |
160 | 160 | 'show_on_cb' => 'cmb2_hide_if_no_cats', |
161 | - ) ); |
|
161 | + )); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | // /** |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | * Contructor |
31 | 31 | */ |
32 | 32 | public function __construct() { |
33 | - add_action( 'cmb2_admin_init', array( $this, 'downloads_post_type_metaboxes' ), 5 ); |
|
34 | - add_action( 'cmb2_admin_init', array( $this, 'download_connections' ), 5 ); |
|
35 | - add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 ); |
|
33 | + add_action('cmb2_admin_init', array($this, 'downloads_post_type_metaboxes'), 5); |
|
34 | + add_action('cmb2_admin_init', array($this, 'download_connections'), 5); |
|
35 | + add_filter('lsx_health_plan_connections', array($this, 'enable_connections'), 10, 1); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public static function get_instance() { |
46 | 46 | // If the single instance hasn't been set, set it now. |
47 | - if ( null === self::$instance ) { |
|
47 | + if (null === self::$instance) { |
|
48 | 48 | self::$instance = new self(); |
49 | 49 | } |
50 | 50 | return self::$instance; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * @param array $connections |
57 | 57 | * @return void |
58 | 58 | */ |
59 | - public function enable_connections( $connections = array() ) { |
|
59 | + public function enable_connections($connections = array()) { |
|
60 | 60 | $connections['dlm_download']['connected_pages'] = 'connected_downloads'; |
61 | 61 | $connections['dlm_download']['connected_workouts'] = 'connected_downloads'; |
62 | 62 | $connections['dlm_download']['connected_meals'] = 'connected_downloads'; |
@@ -74,66 +74,66 @@ discard block |
||
74 | 74 | * Define the metabox and field configurations. |
75 | 75 | */ |
76 | 76 | public function downloads_post_type_metaboxes() { |
77 | - $cmb = new_cmb2_box( array( |
|
77 | + $cmb = new_cmb2_box(array( |
|
78 | 78 | 'id' => $this->slug . '_connections_metabox', |
79 | - 'title' => __( 'Connections', 'lsx-health-plan' ), |
|
80 | - 'object_types' => array( 'dlm_download' ), // Post type |
|
79 | + 'title' => __('Connections', 'lsx-health-plan'), |
|
80 | + 'object_types' => array('dlm_download'), // Post type |
|
81 | 81 | 'context' => 'normal', |
82 | 82 | 'priority' => 'high', |
83 | 83 | 'show_names' => true, |
84 | - ) ); |
|
85 | - $cmb->add_field( array( |
|
86 | - 'name' => __( 'Pages', 'lsx-health-plan' ), |
|
84 | + )); |
|
85 | + $cmb->add_field(array( |
|
86 | + 'name' => __('Pages', 'lsx-health-plan'), |
|
87 | 87 | 'id' => 'connected_pages', |
88 | 88 | 'type' => 'post_search_ajax', |
89 | 89 | // Optional : |
90 | - 'limit' => 10, // Limit selection to X items only (default 1) |
|
90 | + 'limit' => 10, // Limit selection to X items only (default 1) |
|
91 | 91 | 'sortable' => true, // Allow selected items to be sortable (default false) |
92 | 92 | 'query_args' => array( |
93 | - 'post_type' => array( 'page' ), |
|
94 | - 'post_status' => array( 'publish' ), |
|
93 | + 'post_type' => array('page'), |
|
94 | + 'post_status' => array('publish'), |
|
95 | 95 | 'posts_per_page' => -1, |
96 | 96 | ), |
97 | - ) ); |
|
98 | - $cmb->add_field( array( |
|
99 | - 'name' => __( 'Workouts', 'lsx-health-plan' ), |
|
97 | + )); |
|
98 | + $cmb->add_field(array( |
|
99 | + 'name' => __('Workouts', 'lsx-health-plan'), |
|
100 | 100 | 'id' => 'connected_workouts', |
101 | 101 | 'type' => 'post_search_ajax', |
102 | 102 | // Optional : |
103 | - 'limit' => 10, // Limit selection to X items only (default 1) |
|
103 | + 'limit' => 10, // Limit selection to X items only (default 1) |
|
104 | 104 | 'sortable' => true, // Allow selected items to be sortable (default false) |
105 | 105 | 'query_args' => array( |
106 | - 'post_type' => array( 'workout' ), |
|
107 | - 'post_status' => array( 'publish' ), |
|
106 | + 'post_type' => array('workout'), |
|
107 | + 'post_status' => array('publish'), |
|
108 | 108 | 'posts_per_page' => -1, |
109 | 109 | ), |
110 | - ) ); |
|
111 | - $cmb->add_field( array( |
|
112 | - 'name' => __( 'Meals', 'lsx-health-plan' ), |
|
110 | + )); |
|
111 | + $cmb->add_field(array( |
|
112 | + 'name' => __('Meals', 'lsx-health-plan'), |
|
113 | 113 | 'id' => 'connected_meals', |
114 | 114 | 'type' => 'post_search_ajax', |
115 | 115 | // Optional : |
116 | - 'limit' => 10, // Limit selection to X items only (default 1) |
|
117 | - 'sortable' => true, // Allow selected items to be sortable (default false) |
|
116 | + 'limit' => 10, // Limit selection to X items only (default 1) |
|
117 | + 'sortable' => true, // Allow selected items to be sortable (default false) |
|
118 | 118 | 'query_args' => array( |
119 | - 'post_type' => array( 'meal' ), |
|
120 | - 'post_status' => array( 'publish' ), |
|
119 | + 'post_type' => array('meal'), |
|
120 | + 'post_status' => array('publish'), |
|
121 | 121 | 'posts_per_page' => -1, |
122 | 122 | ), |
123 | - ) ); |
|
124 | - $cmb->add_field( array( |
|
125 | - 'name' => __( 'Recipe', 'lsx-health-plan' ), |
|
123 | + )); |
|
124 | + $cmb->add_field(array( |
|
125 | + 'name' => __('Recipe', 'lsx-health-plan'), |
|
126 | 126 | 'id' => 'connected_recipes', |
127 | 127 | 'type' => 'post_search_ajax', |
128 | 128 | // Optional : |
129 | 129 | 'limit' => 10, // Limit selection to X items only (default 1) |
130 | 130 | 'sortable' => true, // Allow selected items to be sortable (default false) |
131 | 131 | 'query_args' => array( |
132 | - 'post_type' => array( 'recipe' ), |
|
133 | - 'post_status' => array( 'publish' ), |
|
132 | + 'post_type' => array('recipe'), |
|
133 | + 'post_status' => array('publish'), |
|
134 | 134 | 'posts_per_page' => -1, |
135 | 135 | ), |
136 | - ) ); |
|
136 | + )); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -142,27 +142,27 @@ discard block |
||
142 | 142 | * @return void |
143 | 143 | */ |
144 | 144 | public function download_connections() { |
145 | - $cmb = new_cmb2_box( array( |
|
145 | + $cmb = new_cmb2_box(array( |
|
146 | 146 | 'id' => $this->slug . '_metabox', |
147 | - 'title' => __( 'Downloads', 'lsx-health-plan' ), |
|
148 | - 'object_types' => array( 'workout', 'meal', 'recipe' ), // Post type |
|
147 | + 'title' => __('Downloads', 'lsx-health-plan'), |
|
148 | + 'object_types' => array('workout', 'meal', 'recipe'), // Post type |
|
149 | 149 | 'context' => 'normal', |
150 | 150 | 'priority' => 'high', |
151 | 151 | 'show_names' => true, |
152 | - ) ); |
|
153 | - $cmb->add_field( array( |
|
154 | - 'name' => __( 'Downloads', 'lsx-health-plan' ), |
|
155 | - 'desc' => __( "Add the pdf's connected to this day plan, using the field provided.", 'lsx-health-plan' ), |
|
152 | + )); |
|
153 | + $cmb->add_field(array( |
|
154 | + 'name' => __('Downloads', 'lsx-health-plan'), |
|
155 | + 'desc' => __("Add the pdf's connected to this day plan, using the field provided.", 'lsx-health-plan'), |
|
156 | 156 | 'id' => 'connected_downloads', |
157 | 157 | 'type' => 'post_search_ajax', |
158 | 158 | // Optional |
159 | - 'limit' => 15, // Limit selection to X items only (default 1) |
|
159 | + 'limit' => 15, // Limit selection to X items only (default 1) |
|
160 | 160 | 'sortable' => true, // Allow selected items to be sortable (default false) |
161 | 161 | 'query_args' => array( |
162 | - 'post_type' => array( 'dlm_download' ), |
|
163 | - 'post_status' => array( 'publish' ), |
|
162 | + 'post_type' => array('dlm_download'), |
|
163 | + 'post_status' => array('publish'), |
|
164 | 164 | 'posts_per_page' => -1, |
165 | 165 | ), |
166 | - ) ); |
|
166 | + )); |
|
167 | 167 | } |
168 | 168 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * Contructor |
22 | 22 | */ |
23 | 23 | public function __construct() { |
24 | - add_filter( 'wpua_profile_title', array( $this, 'profile_title' ), 10, 1 ); |
|
24 | + add_filter('wpua_profile_title', array($this, 'profile_title'), 10, 1); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public static function get_instance() { |
35 | 35 | // If the single instance hasn't been set, set it now. |
36 | - if ( null === self::$instance ) { |
|
36 | + if (null === self::$instance) { |
|
37 | 37 | self::$instance = new self(); |
38 | 38 | } |
39 | 39 | return self::$instance; |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | * @param string $title |
46 | 46 | * @return string |
47 | 47 | */ |
48 | - public function profile_title( $title ) { |
|
49 | - $title = '<h3>' . __( 'My Profile', 'lsx-health-plan' ) . '</h3>'; |
|
50 | - $title .= '<p class="tagline">' . __( 'Please upload an image of yourself in .jpeg format. Images should be square, to best fit the cropping area, and files sizes kept below 500kb.', 'lsx-health-plan' ) . '</p>'; |
|
48 | + public function profile_title($title) { |
|
49 | + $title = '<h3>' . __('My Profile', 'lsx-health-plan') . '</h3>'; |
|
50 | + $title .= '<p class="tagline">' . __('Please upload an image of yourself in .jpeg format. Images should be square, to best fit the cropping area, and files sizes kept below 500kb.', 'lsx-health-plan') . '</p>'; |
|
51 | 51 | return $title; |
52 | 52 | } |
53 | 53 | } |