@@ -8,46 +8,46 @@ |
||
8 | 8 | */ |
9 | 9 | class WP_User_Avatar { |
10 | 10 | |
11 | - /** |
|
12 | - * Holds class instance |
|
13 | - * |
|
14 | - * @since 1.0.0 |
|
15 | - * |
|
16 | - * @var object \lsx_health_plan\classes\Woocommerce() |
|
17 | - */ |
|
18 | - protected static $instance = null; |
|
11 | + /** |
|
12 | + * Holds class instance |
|
13 | + * |
|
14 | + * @since 1.0.0 |
|
15 | + * |
|
16 | + * @var object \lsx_health_plan\classes\Woocommerce() |
|
17 | + */ |
|
18 | + protected static $instance = null; |
|
19 | 19 | |
20 | - /** |
|
21 | - * Constructor |
|
22 | - */ |
|
23 | - public function __construct() { |
|
24 | - add_filter( 'wpua_profile_title', array( $this, 'profile_title' ), 10, 1 ); |
|
25 | - } |
|
20 | + /** |
|
21 | + * Constructor |
|
22 | + */ |
|
23 | + public function __construct() { |
|
24 | + add_filter( 'wpua_profile_title', array( $this, 'profile_title' ), 10, 1 ); |
|
25 | + } |
|
26 | 26 | |
27 | - /** |
|
28 | - * Return an instance of this class. |
|
29 | - * |
|
30 | - * @since 1.0.0 |
|
31 | - * |
|
32 | - * @return object \lsx_health_plan\classes\Woocommerce() A single instance of this class. |
|
33 | - */ |
|
34 | - public static function get_instance() { |
|
35 | - // If the single instance hasn't been set, set it now. |
|
36 | - if ( null === self::$instance ) { |
|
37 | - self::$instance = new self(); |
|
38 | - } |
|
39 | - return self::$instance; |
|
40 | - } |
|
27 | + /** |
|
28 | + * Return an instance of this class. |
|
29 | + * |
|
30 | + * @since 1.0.0 |
|
31 | + * |
|
32 | + * @return object \lsx_health_plan\classes\Woocommerce() A single instance of this class. |
|
33 | + */ |
|
34 | + public static function get_instance() { |
|
35 | + // If the single instance hasn't been set, set it now. |
|
36 | + if ( null === self::$instance ) { |
|
37 | + self::$instance = new self(); |
|
38 | + } |
|
39 | + return self::$instance; |
|
40 | + } |
|
41 | 41 | |
42 | - /** |
|
43 | - * Changes the profile title |
|
44 | - * |
|
45 | - * @param string $title |
|
46 | - * @return string |
|
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>'; |
|
51 | - return $title; |
|
52 | - } |
|
42 | + /** |
|
43 | + * Changes the profile title |
|
44 | + * |
|
45 | + * @param string $title |
|
46 | + * @return string |
|
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>'; |
|
51 | + return $title; |
|
52 | + } |
|
53 | 53 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * Constructor |
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 | } |
@@ -10,186 +10,186 @@ discard block |
||
10 | 10 | */ |
11 | 11 | class Settings_Theme { |
12 | 12 | |
13 | - /** |
|
14 | - * Holds class instance |
|
15 | - * |
|
16 | - * @since 1.0.0 |
|
17 | - * |
|
18 | - * @var object \lsx_health_plan\classes\admin\Settings_Theme() |
|
19 | - */ |
|
20 | - protected static $instance = null; |
|
13 | + /** |
|
14 | + * Holds class instance |
|
15 | + * |
|
16 | + * @since 1.0.0 |
|
17 | + * |
|
18 | + * @var object \lsx_health_plan\classes\admin\Settings_Theme() |
|
19 | + */ |
|
20 | + protected static $instance = null; |
|
21 | 21 | |
22 | - /** |
|
23 | - * Will return true if this is the LSX Search settings page. |
|
24 | - * |
|
25 | - * @var array |
|
26 | - */ |
|
27 | - public $is_options_page = false; |
|
22 | + /** |
|
23 | + * Will return true if this is the LSX Search settings page. |
|
24 | + * |
|
25 | + * @var array |
|
26 | + */ |
|
27 | + public $is_options_page = false; |
|
28 | 28 | |
29 | - /** |
|
30 | - * Holds the id and labels for the navigation. |
|
31 | - * |
|
32 | - * @var array |
|
33 | - */ |
|
34 | - public $navigation = array(); |
|
29 | + /** |
|
30 | + * Holds the id and labels for the navigation. |
|
31 | + * |
|
32 | + * @var array |
|
33 | + */ |
|
34 | + public $navigation = array(); |
|
35 | 35 | |
36 | - /** |
|
37 | - * Constructor |
|
38 | - */ |
|
39 | - public function __construct() { |
|
40 | - add_filter( 'cmb2_enqueue_css', array( $this, 'disable_cmb2_styles' ), 1, 1 ); |
|
41 | - add_action( 'cmb2_before_form', array( $this, 'generate_navigation' ), 10, 4 ); |
|
42 | - add_action( 'cmb2_before_title_field_row', array( $this, 'output_tab_open_div' ), 10, 1 ); |
|
43 | - add_action( 'cmb2_after_tab_closing_field_row', array( $this, 'output_tab_closing_div' ), 10, 1 ); |
|
44 | - add_action( 'cmb2_render_tab_closing', array( $this, 'cmb2_render_callback_for_tab_closing' ), 10, 5 ); |
|
45 | - add_filter( 'cmb2_sanitize_tab_closing', array( $this, 'cmb2_sanitize_tab_closing_callback' ), 10, 2 ); |
|
46 | - add_action( 'cmb2_after_form', array( $this, 'navigation_js' ), 10, 4 ); |
|
47 | - add_filter( 'cmb2_options_page_redirect_url', array( $this, 'add_tab_argument' ), 10, 1 ); |
|
48 | - } |
|
36 | + /** |
|
37 | + * Constructor |
|
38 | + */ |
|
39 | + public function __construct() { |
|
40 | + add_filter( 'cmb2_enqueue_css', array( $this, 'disable_cmb2_styles' ), 1, 1 ); |
|
41 | + add_action( 'cmb2_before_form', array( $this, 'generate_navigation' ), 10, 4 ); |
|
42 | + add_action( 'cmb2_before_title_field_row', array( $this, 'output_tab_open_div' ), 10, 1 ); |
|
43 | + add_action( 'cmb2_after_tab_closing_field_row', array( $this, 'output_tab_closing_div' ), 10, 1 ); |
|
44 | + add_action( 'cmb2_render_tab_closing', array( $this, 'cmb2_render_callback_for_tab_closing' ), 10, 5 ); |
|
45 | + add_filter( 'cmb2_sanitize_tab_closing', array( $this, 'cmb2_sanitize_tab_closing_callback' ), 10, 2 ); |
|
46 | + add_action( 'cmb2_after_form', array( $this, 'navigation_js' ), 10, 4 ); |
|
47 | + add_filter( 'cmb2_options_page_redirect_url', array( $this, 'add_tab_argument' ), 10, 1 ); |
|
48 | + } |
|
49 | 49 | |
50 | - /** |
|
51 | - * Return an instance of this class. |
|
52 | - * |
|
53 | - * @since 1.0.0 |
|
54 | - * |
|
55 | - * @return object \lsx_health_plan\classes\admin\Settings_Theme() A single instance of this class. |
|
56 | - */ |
|
57 | - public static function get_instance() { |
|
58 | - // If the single instance hasn't been set, set it now. |
|
59 | - if ( null == self::$instance ) { |
|
60 | - self::$instance = new self(); |
|
61 | - } |
|
62 | - return self::$instance; |
|
63 | - } |
|
50 | + /** |
|
51 | + * Return an instance of this class. |
|
52 | + * |
|
53 | + * @since 1.0.0 |
|
54 | + * |
|
55 | + * @return object \lsx_health_plan\classes\admin\Settings_Theme() A single instance of this class. |
|
56 | + */ |
|
57 | + public static function get_instance() { |
|
58 | + // If the single instance hasn't been set, set it now. |
|
59 | + if ( null == self::$instance ) { |
|
60 | + self::$instance = new self(); |
|
61 | + } |
|
62 | + return self::$instance; |
|
63 | + } |
|
64 | 64 | |
65 | - /** |
|
66 | - * Disable CMB2 styles on front end forms. |
|
67 | - * |
|
68 | - * @return bool $enabled Whether to enable (enqueue) styles. |
|
69 | - */ |
|
70 | - public function disable_cmb2_styles( $enabled ) { |
|
71 | - if ( is_admin() ) { |
|
72 | - $current_screen = get_current_screen(); |
|
73 | - if ( is_object( $current_screen ) && 'plan_page_lsx_health_plan_options' === $current_screen->id ) { |
|
74 | - $enabled = false; |
|
75 | - } |
|
76 | - } |
|
77 | - return $enabled; |
|
78 | - } |
|
65 | + /** |
|
66 | + * Disable CMB2 styles on front end forms. |
|
67 | + * |
|
68 | + * @return bool $enabled Whether to enable (enqueue) styles. |
|
69 | + */ |
|
70 | + public function disable_cmb2_styles( $enabled ) { |
|
71 | + if ( is_admin() ) { |
|
72 | + $current_screen = get_current_screen(); |
|
73 | + if ( is_object( $current_screen ) && 'plan_page_lsx_health_plan_options' === $current_screen->id ) { |
|
74 | + $enabled = false; |
|
75 | + } |
|
76 | + } |
|
77 | + return $enabled; |
|
78 | + } |
|
79 | 79 | |
80 | - /** |
|
81 | - * Generates the tabbed navigation for the settings page. |
|
82 | - * |
|
83 | - * @param string $cmb_id |
|
84 | - * @param string $object_id |
|
85 | - * @param string $object_type |
|
86 | - * @param object $cmb2_obj |
|
87 | - * @return void |
|
88 | - */ |
|
89 | - public function generate_navigation( $cmb_id, $object_id, $object_type, $cmb2_obj ) { |
|
90 | - if ( 'lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type ) { |
|
91 | - $this->navigation = array(); |
|
92 | - $this->is_options_page = true; |
|
93 | - if ( isset( $cmb2_obj->meta_box['fields'] ) && ! empty( $cmb2_obj->meta_box['fields'] ) ) { |
|
94 | - foreach ( $cmb2_obj->meta_box['fields'] as $field_index => $field ) { |
|
95 | - if ( 'title' === $field['type'] ) { |
|
96 | - $this->navigation[ $field_index ] = $field['name']; |
|
97 | - } |
|
98 | - } |
|
99 | - } |
|
100 | - $this->output_navigation(); |
|
101 | - } |
|
102 | - } |
|
80 | + /** |
|
81 | + * Generates the tabbed navigation for the settings page. |
|
82 | + * |
|
83 | + * @param string $cmb_id |
|
84 | + * @param string $object_id |
|
85 | + * @param string $object_type |
|
86 | + * @param object $cmb2_obj |
|
87 | + * @return void |
|
88 | + */ |
|
89 | + public function generate_navigation( $cmb_id, $object_id, $object_type, $cmb2_obj ) { |
|
90 | + if ( 'lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type ) { |
|
91 | + $this->navigation = array(); |
|
92 | + $this->is_options_page = true; |
|
93 | + if ( isset( $cmb2_obj->meta_box['fields'] ) && ! empty( $cmb2_obj->meta_box['fields'] ) ) { |
|
94 | + foreach ( $cmb2_obj->meta_box['fields'] as $field_index => $field ) { |
|
95 | + if ( 'title' === $field['type'] ) { |
|
96 | + $this->navigation[ $field_index ] = $field['name']; |
|
97 | + } |
|
98 | + } |
|
99 | + } |
|
100 | + $this->output_navigation(); |
|
101 | + } |
|
102 | + } |
|
103 | 103 | |
104 | - /** |
|
105 | - * Outputs the WP style navigation for the Settings page. |
|
106 | - * |
|
107 | - * @return void |
|
108 | - */ |
|
109 | - public function output_navigation() { |
|
110 | - if ( ! empty( $this->navigation ) ) { |
|
111 | - ?> |
|
104 | + /** |
|
105 | + * Outputs the WP style navigation for the Settings page. |
|
106 | + * |
|
107 | + * @return void |
|
108 | + */ |
|
109 | + public function output_navigation() { |
|
110 | + if ( ! empty( $this->navigation ) ) { |
|
111 | + ?> |
|
112 | 112 | <div class="wp-filter hide-if-no-js"> |
113 | 113 | <ul class="filter-links"> |
114 | 114 | <?php |
115 | - $first_tab = true; |
|
116 | - $total = count( $this->navigation ); |
|
117 | - $count = 0; |
|
118 | - $separator = ' |'; |
|
119 | - $selected_tab = ''; |
|
120 | - if ( isset( $_GET['cmb_tab'] ) && '' !== $_GET['cmb_tab'] ) { |
|
121 | - $selected_tab = sanitize_text_field( $_GET['cmb_tab'] ); |
|
122 | - $selected_tab = 'settings_' . $selected_tab; |
|
123 | - } |
|
124 | - foreach ( $this->navigation as $key => $label ) { |
|
125 | - $count++; |
|
126 | - $current_css = ''; |
|
127 | - if ( ( true === $first_tab && '' === $selected_tab ) || $key === $selected_tab ) { |
|
128 | - $first_tab = false; |
|
129 | - $current_css = 'current'; |
|
130 | - } |
|
131 | - if ( $count === $total ) { |
|
132 | - $separator = ''; |
|
133 | - } |
|
134 | - ?> |
|
115 | + $first_tab = true; |
|
116 | + $total = count( $this->navigation ); |
|
117 | + $count = 0; |
|
118 | + $separator = ' |'; |
|
119 | + $selected_tab = ''; |
|
120 | + if ( isset( $_GET['cmb_tab'] ) && '' !== $_GET['cmb_tab'] ) { |
|
121 | + $selected_tab = sanitize_text_field( $_GET['cmb_tab'] ); |
|
122 | + $selected_tab = 'settings_' . $selected_tab; |
|
123 | + } |
|
124 | + foreach ( $this->navigation as $key => $label ) { |
|
125 | + $count++; |
|
126 | + $current_css = ''; |
|
127 | + if ( ( true === $first_tab && '' === $selected_tab ) || $key === $selected_tab ) { |
|
128 | + $first_tab = false; |
|
129 | + $current_css = 'current'; |
|
130 | + } |
|
131 | + if ( $count === $total ) { |
|
132 | + $separator = ''; |
|
133 | + } |
|
134 | + ?> |
|
135 | 135 | <li><a href="#" class="<?php echo esc_attr( $current_css ); ?>" data-sort="<?php echo esc_attr( $key ); ?>_tab"><?php echo esc_attr( $label ); ?></a><?php echo esc_attr( $separator ); ?></li> |
136 | 136 | <?php |
137 | - } |
|
138 | - ?> |
|
137 | + } |
|
138 | + ?> |
|
139 | 139 | </ul> |
140 | 140 | </div> |
141 | 141 | <?php |
142 | - } |
|
143 | - } |
|
142 | + } |
|
143 | + } |
|
144 | 144 | |
145 | - /** |
|
146 | - * Outputs the opening tab div. |
|
147 | - * |
|
148 | - * @param object $field CMB2_Field(); |
|
149 | - * @return void |
|
150 | - */ |
|
151 | - public function output_tab_open_div( $field ) { |
|
152 | - if ( true === $this->is_options_page && isset( $field->args['type'] ) && 'title' === $field->args['type'] ) { |
|
153 | - ?> |
|
145 | + /** |
|
146 | + * Outputs the opening tab div. |
|
147 | + * |
|
148 | + * @param object $field CMB2_Field(); |
|
149 | + * @return void |
|
150 | + */ |
|
151 | + public function output_tab_open_div( $field ) { |
|
152 | + if ( true === $this->is_options_page && isset( $field->args['type'] ) && 'title' === $field->args['type'] ) { |
|
153 | + ?> |
|
154 | 154 | <div id="<?php echo esc_attr( $field->args['id'] ); ?>_tab" class="tab tab-nav hidden"> |
155 | 155 | <?php |
156 | - } |
|
157 | - } |
|
156 | + } |
|
157 | + } |
|
158 | 158 | |
159 | - /** |
|
160 | - * Outputs the opening closing div. |
|
161 | - * |
|
162 | - * @param object $field CMB2_Field(); |
|
163 | - * @return void |
|
164 | - */ |
|
165 | - public function output_tab_closing_div( $field ) { |
|
166 | - if ( true === $this->is_options_page && isset( $field->args['type'] ) && 'tab_closing' === $field->args['type'] ) { |
|
167 | - ?> |
|
159 | + /** |
|
160 | + * Outputs the opening closing div. |
|
161 | + * |
|
162 | + * @param object $field CMB2_Field(); |
|
163 | + * @return void |
|
164 | + */ |
|
165 | + public function output_tab_closing_div( $field ) { |
|
166 | + if ( true === $this->is_options_page && isset( $field->args['type'] ) && 'tab_closing' === $field->args['type'] ) { |
|
167 | + ?> |
|
168 | 168 | </div> |
169 | 169 | <?php |
170 | - } |
|
171 | - } |
|
170 | + } |
|
171 | + } |
|
172 | 172 | |
173 | - public function cmb2_render_callback_for_tab_closing( $field, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
174 | - return; |
|
175 | - } |
|
173 | + public function cmb2_render_callback_for_tab_closing( $field, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
174 | + return; |
|
175 | + } |
|
176 | 176 | |
177 | - public function cmb2_sanitize_tab_closing_callback( $override_value, $value ) { |
|
178 | - return ''; |
|
179 | - } |
|
177 | + public function cmb2_sanitize_tab_closing_callback( $override_value, $value ) { |
|
178 | + return ''; |
|
179 | + } |
|
180 | 180 | |
181 | - /** |
|
182 | - * Outputs the Script for the tabbed navigation. |
|
183 | - * |
|
184 | - * @param string $cmb_id |
|
185 | - * @param string $object_id |
|
186 | - * @param string $object_type |
|
187 | - * @param object $cmb2_obj |
|
188 | - * @return void |
|
189 | - */ |
|
190 | - public function navigation_js( $cmb_id, $object_id, $object_type, $cmb2_obj ) { |
|
191 | - if ( 'lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type ) { |
|
192 | - ?> |
|
181 | + /** |
|
182 | + * Outputs the Script for the tabbed navigation. |
|
183 | + * |
|
184 | + * @param string $cmb_id |
|
185 | + * @param string $object_id |
|
186 | + * @param string $object_type |
|
187 | + * @param object $cmb2_obj |
|
188 | + * @return void |
|
189 | + */ |
|
190 | + public function navigation_js( $cmb_id, $object_id, $object_type, $cmb2_obj ) { |
|
191 | + if ( 'lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type ) { |
|
192 | + ?> |
|
193 | 193 | <script> |
194 | 194 | var LSX_HP_CMB2 = Object.create( null ); |
195 | 195 | |
@@ -261,25 +261,25 @@ discard block |
||
261 | 261 | } )( jQuery, window, document ); |
262 | 262 | </script> |
263 | 263 | <?php |
264 | - } |
|
265 | - } |
|
264 | + } |
|
265 | + } |
|
266 | 266 | |
267 | - /** |
|
268 | - * This will add the tab selection to the url. |
|
269 | - * |
|
270 | - * @param string $url |
|
271 | - * @return void |
|
272 | - */ |
|
273 | - public function add_tab_argument( $url ) { |
|
274 | - if ( isset( $_POST['cmb_tab'] ) && '' !== $_POST['cmb_tab'] ) { // @codingStandardsIgnoreLine |
|
275 | - $tab_selection = sanitize_text_field( $_POST['cmb_tab'] ); // @codingStandardsIgnoreLine |
|
276 | - $tab_selection = str_replace( array( 'settings_', '_tab' ), '', $tab_selection ); // @codingStandardsIgnoreLine |
|
277 | - if ( 'single' !== $tab_selection ) { |
|
278 | - $url = add_query_arg( 'cmb_tab', $tab_selection, $url ); |
|
279 | - } else { |
|
280 | - $url = remove_query_arg( 'cmb_tab', $url ); |
|
281 | - } |
|
282 | - } |
|
283 | - return $url; |
|
284 | - } |
|
267 | + /** |
|
268 | + * This will add the tab selection to the url. |
|
269 | + * |
|
270 | + * @param string $url |
|
271 | + * @return void |
|
272 | + */ |
|
273 | + public function add_tab_argument( $url ) { |
|
274 | + if ( isset( $_POST['cmb_tab'] ) && '' !== $_POST['cmb_tab'] ) { // @codingStandardsIgnoreLine |
|
275 | + $tab_selection = sanitize_text_field( $_POST['cmb_tab'] ); // @codingStandardsIgnoreLine |
|
276 | + $tab_selection = str_replace( array( 'settings_', '_tab' ), '', $tab_selection ); // @codingStandardsIgnoreLine |
|
277 | + if ( 'single' !== $tab_selection ) { |
|
278 | + $url = add_query_arg( 'cmb_tab', $tab_selection, $url ); |
|
279 | + } else { |
|
280 | + $url = remove_query_arg( 'cmb_tab', $url ); |
|
281 | + } |
|
282 | + } |
|
283 | + return $url; |
|
284 | + } |
|
285 | 285 | } |
@@ -37,14 +37,14 @@ discard block |
||
37 | 37 | * Constructor |
38 | 38 | */ |
39 | 39 | public function __construct() { |
40 | - add_filter( 'cmb2_enqueue_css', array( $this, 'disable_cmb2_styles' ), 1, 1 ); |
|
41 | - add_action( 'cmb2_before_form', array( $this, 'generate_navigation' ), 10, 4 ); |
|
42 | - add_action( 'cmb2_before_title_field_row', array( $this, 'output_tab_open_div' ), 10, 1 ); |
|
43 | - add_action( 'cmb2_after_tab_closing_field_row', array( $this, 'output_tab_closing_div' ), 10, 1 ); |
|
44 | - add_action( 'cmb2_render_tab_closing', array( $this, 'cmb2_render_callback_for_tab_closing' ), 10, 5 ); |
|
45 | - add_filter( 'cmb2_sanitize_tab_closing', array( $this, 'cmb2_sanitize_tab_closing_callback' ), 10, 2 ); |
|
46 | - add_action( 'cmb2_after_form', array( $this, 'navigation_js' ), 10, 4 ); |
|
47 | - add_filter( 'cmb2_options_page_redirect_url', array( $this, 'add_tab_argument' ), 10, 1 ); |
|
40 | + add_filter('cmb2_enqueue_css', array($this, 'disable_cmb2_styles'), 1, 1); |
|
41 | + add_action('cmb2_before_form', array($this, 'generate_navigation'), 10, 4); |
|
42 | + add_action('cmb2_before_title_field_row', array($this, 'output_tab_open_div'), 10, 1); |
|
43 | + add_action('cmb2_after_tab_closing_field_row', array($this, 'output_tab_closing_div'), 10, 1); |
|
44 | + add_action('cmb2_render_tab_closing', array($this, 'cmb2_render_callback_for_tab_closing'), 10, 5); |
|
45 | + add_filter('cmb2_sanitize_tab_closing', array($this, 'cmb2_sanitize_tab_closing_callback'), 10, 2); |
|
46 | + add_action('cmb2_after_form', array($this, 'navigation_js'), 10, 4); |
|
47 | + add_filter('cmb2_options_page_redirect_url', array($this, 'add_tab_argument'), 10, 1); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public static function get_instance() { |
58 | 58 | // If the single instance hasn't been set, set it now. |
59 | - if ( null == self::$instance ) { |
|
59 | + if (null == self::$instance) { |
|
60 | 60 | self::$instance = new self(); |
61 | 61 | } |
62 | 62 | return self::$instance; |
@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | * |
68 | 68 | * @return bool $enabled Whether to enable (enqueue) styles. |
69 | 69 | */ |
70 | - public function disable_cmb2_styles( $enabled ) { |
|
71 | - if ( is_admin() ) { |
|
70 | + public function disable_cmb2_styles($enabled) { |
|
71 | + if (is_admin()) { |
|
72 | 72 | $current_screen = get_current_screen(); |
73 | - if ( is_object( $current_screen ) && 'plan_page_lsx_health_plan_options' === $current_screen->id ) { |
|
73 | + if (is_object($current_screen) && 'plan_page_lsx_health_plan_options' === $current_screen->id) { |
|
74 | 74 | $enabled = false; |
75 | 75 | } |
76 | 76 | } |
@@ -86,14 +86,14 @@ discard block |
||
86 | 86 | * @param object $cmb2_obj |
87 | 87 | * @return void |
88 | 88 | */ |
89 | - public function generate_navigation( $cmb_id, $object_id, $object_type, $cmb2_obj ) { |
|
90 | - if ( 'lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type ) { |
|
89 | + public function generate_navigation($cmb_id, $object_id, $object_type, $cmb2_obj) { |
|
90 | + if ('lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type) { |
|
91 | 91 | $this->navigation = array(); |
92 | 92 | $this->is_options_page = true; |
93 | - if ( isset( $cmb2_obj->meta_box['fields'] ) && ! empty( $cmb2_obj->meta_box['fields'] ) ) { |
|
94 | - foreach ( $cmb2_obj->meta_box['fields'] as $field_index => $field ) { |
|
95 | - if ( 'title' === $field['type'] ) { |
|
96 | - $this->navigation[ $field_index ] = $field['name']; |
|
93 | + if (isset($cmb2_obj->meta_box['fields']) && ! empty($cmb2_obj->meta_box['fields'])) { |
|
94 | + foreach ($cmb2_obj->meta_box['fields'] as $field_index => $field) { |
|
95 | + if ('title' === $field['type']) { |
|
96 | + $this->navigation[$field_index] = $field['name']; |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | } |
@@ -107,32 +107,32 @@ discard block |
||
107 | 107 | * @return void |
108 | 108 | */ |
109 | 109 | public function output_navigation() { |
110 | - if ( ! empty( $this->navigation ) ) { |
|
110 | + if ( ! empty($this->navigation)) { |
|
111 | 111 | ?> |
112 | 112 | <div class="wp-filter hide-if-no-js"> |
113 | 113 | <ul class="filter-links"> |
114 | 114 | <?php |
115 | 115 | $first_tab = true; |
116 | - $total = count( $this->navigation ); |
|
116 | + $total = count($this->navigation); |
|
117 | 117 | $count = 0; |
118 | 118 | $separator = ' |'; |
119 | 119 | $selected_tab = ''; |
120 | - if ( isset( $_GET['cmb_tab'] ) && '' !== $_GET['cmb_tab'] ) { |
|
121 | - $selected_tab = sanitize_text_field( $_GET['cmb_tab'] ); |
|
120 | + if (isset($_GET['cmb_tab']) && '' !== $_GET['cmb_tab']) { |
|
121 | + $selected_tab = sanitize_text_field($_GET['cmb_tab']); |
|
122 | 122 | $selected_tab = 'settings_' . $selected_tab; |
123 | 123 | } |
124 | - foreach ( $this->navigation as $key => $label ) { |
|
124 | + foreach ($this->navigation as $key => $label) { |
|
125 | 125 | $count++; |
126 | 126 | $current_css = ''; |
127 | - if ( ( true === $first_tab && '' === $selected_tab ) || $key === $selected_tab ) { |
|
127 | + if ((true === $first_tab && '' === $selected_tab) || $key === $selected_tab) { |
|
128 | 128 | $first_tab = false; |
129 | 129 | $current_css = 'current'; |
130 | 130 | } |
131 | - if ( $count === $total ) { |
|
131 | + if ($count === $total) { |
|
132 | 132 | $separator = ''; |
133 | 133 | } |
134 | 134 | ?> |
135 | - <li><a href="#" class="<?php echo esc_attr( $current_css ); ?>" data-sort="<?php echo esc_attr( $key ); ?>_tab"><?php echo esc_attr( $label ); ?></a><?php echo esc_attr( $separator ); ?></li> |
|
135 | + <li><a href="#" class="<?php echo esc_attr($current_css); ?>" data-sort="<?php echo esc_attr($key); ?>_tab"><?php echo esc_attr($label); ?></a><?php echo esc_attr($separator); ?></li> |
|
136 | 136 | <?php |
137 | 137 | } |
138 | 138 | ?> |
@@ -148,10 +148,10 @@ discard block |
||
148 | 148 | * @param object $field CMB2_Field(); |
149 | 149 | * @return void |
150 | 150 | */ |
151 | - public function output_tab_open_div( $field ) { |
|
152 | - if ( true === $this->is_options_page && isset( $field->args['type'] ) && 'title' === $field->args['type'] ) { |
|
151 | + public function output_tab_open_div($field) { |
|
152 | + if (true === $this->is_options_page && isset($field->args['type']) && 'title' === $field->args['type']) { |
|
153 | 153 | ?> |
154 | - <div id="<?php echo esc_attr( $field->args['id'] ); ?>_tab" class="tab tab-nav hidden"> |
|
154 | + <div id="<?php echo esc_attr($field->args['id']); ?>_tab" class="tab tab-nav hidden"> |
|
155 | 155 | <?php |
156 | 156 | } |
157 | 157 | } |
@@ -162,19 +162,19 @@ discard block |
||
162 | 162 | * @param object $field CMB2_Field(); |
163 | 163 | * @return void |
164 | 164 | */ |
165 | - public function output_tab_closing_div( $field ) { |
|
166 | - if ( true === $this->is_options_page && isset( $field->args['type'] ) && 'tab_closing' === $field->args['type'] ) { |
|
165 | + public function output_tab_closing_div($field) { |
|
166 | + if (true === $this->is_options_page && isset($field->args['type']) && 'tab_closing' === $field->args['type']) { |
|
167 | 167 | ?> |
168 | 168 | </div> |
169 | 169 | <?php |
170 | 170 | } |
171 | 171 | } |
172 | 172 | |
173 | - public function cmb2_render_callback_for_tab_closing( $field, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
173 | + public function cmb2_render_callback_for_tab_closing($field, $escaped_value, $object_id, $object_type, $field_type_object) { |
|
174 | 174 | return; |
175 | 175 | } |
176 | 176 | |
177 | - public function cmb2_sanitize_tab_closing_callback( $override_value, $value ) { |
|
177 | + public function cmb2_sanitize_tab_closing_callback($override_value, $value) { |
|
178 | 178 | return ''; |
179 | 179 | } |
180 | 180 | |
@@ -187,8 +187,8 @@ discard block |
||
187 | 187 | * @param object $cmb2_obj |
188 | 188 | * @return void |
189 | 189 | */ |
190 | - public function navigation_js( $cmb_id, $object_id, $object_type, $cmb2_obj ) { |
|
191 | - if ( 'lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type ) { |
|
190 | + public function navigation_js($cmb_id, $object_id, $object_type, $cmb2_obj) { |
|
191 | + if ('lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type) { |
|
192 | 192 | ?> |
193 | 193 | <script> |
194 | 194 | var LSX_HP_CMB2 = Object.create( null ); |
@@ -270,14 +270,14 @@ discard block |
||
270 | 270 | * @param string $url |
271 | 271 | * @return void |
272 | 272 | */ |
273 | - public function add_tab_argument( $url ) { |
|
274 | - if ( isset( $_POST['cmb_tab'] ) && '' !== $_POST['cmb_tab'] ) { // @codingStandardsIgnoreLine |
|
275 | - $tab_selection = sanitize_text_field( $_POST['cmb_tab'] ); // @codingStandardsIgnoreLine |
|
276 | - $tab_selection = str_replace( array( 'settings_', '_tab' ), '', $tab_selection ); // @codingStandardsIgnoreLine |
|
277 | - if ( 'single' !== $tab_selection ) { |
|
278 | - $url = add_query_arg( 'cmb_tab', $tab_selection, $url ); |
|
273 | + public function add_tab_argument($url) { |
|
274 | + if (isset($_POST['cmb_tab']) && '' !== $_POST['cmb_tab']) { // @codingStandardsIgnoreLine |
|
275 | + $tab_selection = sanitize_text_field($_POST['cmb_tab']); // @codingStandardsIgnoreLine |
|
276 | + $tab_selection = str_replace(array('settings_', '_tab'), '', $tab_selection); // @codingStandardsIgnoreLine |
|
277 | + if ('single' !== $tab_selection) { |
|
278 | + $url = add_query_arg('cmb_tab', $tab_selection, $url); |
|
279 | 279 | } else { |
280 | - $url = remove_query_arg( 'cmb_tab', $url ); |
|
280 | + $url = remove_query_arg('cmb_tab', $url); |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 | return $url; |
@@ -12,52 +12,52 @@ |
||
12 | 12 | */ |
13 | 13 | class Exercise { |
14 | 14 | |
15 | - /** |
|
16 | - * Holds class instance |
|
17 | - * |
|
18 | - * @since 1.0.0 |
|
19 | - * |
|
20 | - * @var object \lsx_health_plan\classes\admin\Exercise() |
|
21 | - */ |
|
22 | - protected static $instance = null; |
|
15 | + /** |
|
16 | + * Holds class instance |
|
17 | + * |
|
18 | + * @since 1.0.0 |
|
19 | + * |
|
20 | + * @var object \lsx_health_plan\classes\admin\Exercise() |
|
21 | + */ |
|
22 | + protected static $instance = null; |
|
23 | 23 | |
24 | - /** |
|
25 | - * Constructor |
|
26 | - */ |
|
27 | - public function __construct() { |
|
28 | - add_action( 'lsx_hp_settings_page_exercise_top', array( $this, 'settings' ), 1, 1 ); |
|
29 | - } |
|
24 | + /** |
|
25 | + * Constructor |
|
26 | + */ |
|
27 | + public function __construct() { |
|
28 | + add_action( 'lsx_hp_settings_page_exercise_top', array( $this, 'settings' ), 1, 1 ); |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * Return an instance of this class. |
|
33 | - * |
|
34 | - * @since 1.0.0 |
|
35 | - * |
|
36 | - * @return object \lsx_health_plan\classes\admin\Exercise() A single instance of this class. |
|
37 | - */ |
|
38 | - public static function get_instance() { |
|
39 | - // If the single instance hasn't been set, set it now. |
|
40 | - if ( null === self::$instance ) { |
|
41 | - self::$instance = new self(); |
|
42 | - } |
|
43 | - return self::$instance; |
|
44 | - } |
|
31 | + /** |
|
32 | + * Return an instance of this class. |
|
33 | + * |
|
34 | + * @since 1.0.0 |
|
35 | + * |
|
36 | + * @return object \lsx_health_plan\classes\admin\Exercise() A single instance of this class. |
|
37 | + */ |
|
38 | + public static function get_instance() { |
|
39 | + // If the single instance hasn't been set, set it now. |
|
40 | + if ( null === self::$instance ) { |
|
41 | + self::$instance = new self(); |
|
42 | + } |
|
43 | + return self::$instance; |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * Registers the general settings. |
|
48 | - * |
|
49 | - * @param object $cmb new_cmb2_box(). |
|
50 | - * @return void |
|
51 | - */ |
|
52 | - public function settings( $cmb ) { |
|
53 | - $cmb->add_field( |
|
54 | - array( |
|
55 | - 'id' => 'exercise_archive_description', |
|
56 | - 'type' => 'wysiwyg', |
|
57 | - 'name' => __( 'Archive Description', 'lsx-health-plan' ), |
|
58 | - 'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ), |
|
59 | - ) |
|
60 | - ); |
|
61 | - } |
|
46 | + /** |
|
47 | + * Registers the general settings. |
|
48 | + * |
|
49 | + * @param object $cmb new_cmb2_box(). |
|
50 | + * @return void |
|
51 | + */ |
|
52 | + public function settings( $cmb ) { |
|
53 | + $cmb->add_field( |
|
54 | + array( |
|
55 | + 'id' => 'exercise_archive_description', |
|
56 | + 'type' => 'wysiwyg', |
|
57 | + 'name' => __( 'Archive Description', 'lsx-health-plan' ), |
|
58 | + 'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ), |
|
59 | + ) |
|
60 | + ); |
|
61 | + } |
|
62 | 62 | } |
63 | 63 | Exercise::get_instance(); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * Constructor |
26 | 26 | */ |
27 | 27 | public function __construct() { |
28 | - add_action( 'lsx_hp_settings_page_exercise_top', array( $this, 'settings' ), 1, 1 ); |
|
28 | + add_action('lsx_hp_settings_page_exercise_top', array($this, 'settings'), 1, 1); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public static function get_instance() { |
39 | 39 | // If the single instance hasn't been set, set it now. |
40 | - if ( null === self::$instance ) { |
|
40 | + if (null === self::$instance) { |
|
41 | 41 | self::$instance = new self(); |
42 | 42 | } |
43 | 43 | return self::$instance; |
@@ -49,13 +49,13 @@ discard block |
||
49 | 49 | * @param object $cmb new_cmb2_box(). |
50 | 50 | * @return void |
51 | 51 | */ |
52 | - public function settings( $cmb ) { |
|
52 | + public function settings($cmb) { |
|
53 | 53 | $cmb->add_field( |
54 | 54 | array( |
55 | 55 | 'id' => 'exercise_archive_description', |
56 | 56 | 'type' => 'wysiwyg', |
57 | - 'name' => __( 'Archive Description', 'lsx-health-plan' ), |
|
58 | - 'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ), |
|
57 | + 'name' => __('Archive Description', 'lsx-health-plan'), |
|
58 | + 'description' => __('This will show up on the post type archive.', 'lsx-health-plan'), |
|
59 | 59 | ) |
60 | 60 | ); |
61 | 61 | } |
@@ -12,115 +12,115 @@ |
||
12 | 12 | */ |
13 | 13 | class Workout { |
14 | 14 | |
15 | - /** |
|
16 | - * Holds class instance |
|
17 | - * |
|
18 | - * @since 1.0.0 |
|
19 | - * |
|
20 | - * @var object \lsx_health_plan\classes\admin\Workout() |
|
21 | - */ |
|
22 | - protected static $instance = null; |
|
15 | + /** |
|
16 | + * Holds class instance |
|
17 | + * |
|
18 | + * @since 1.0.0 |
|
19 | + * |
|
20 | + * @var object \lsx_health_plan\classes\admin\Workout() |
|
21 | + */ |
|
22 | + protected static $instance = null; |
|
23 | 23 | |
24 | - /** |
|
25 | - * Constructor |
|
26 | - */ |
|
27 | - public function __construct() { |
|
28 | - add_action( 'lsx_hp_settings_page_workout_top', array( $this, 'settings' ), 1, 1 ); |
|
29 | - } |
|
24 | + /** |
|
25 | + * Constructor |
|
26 | + */ |
|
27 | + public function __construct() { |
|
28 | + add_action( 'lsx_hp_settings_page_workout_top', array( $this, 'settings' ), 1, 1 ); |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * Return an instance of this class. |
|
33 | - * |
|
34 | - * @since 1.0.0 |
|
35 | - * |
|
36 | - * @return object \lsx_health_plan\classes\admin\Workout() A single instance of this class. |
|
37 | - */ |
|
38 | - public static function get_instance() { |
|
39 | - // If the single instance hasn't been set, set it now. |
|
40 | - if ( null === self::$instance ) { |
|
41 | - self::$instance = new self(); |
|
42 | - } |
|
43 | - return self::$instance; |
|
44 | - } |
|
31 | + /** |
|
32 | + * Return an instance of this class. |
|
33 | + * |
|
34 | + * @since 1.0.0 |
|
35 | + * |
|
36 | + * @return object \lsx_health_plan\classes\admin\Workout() A single instance of this class. |
|
37 | + */ |
|
38 | + public static function get_instance() { |
|
39 | + // If the single instance hasn't been set, set it now. |
|
40 | + if ( null === self::$instance ) { |
|
41 | + self::$instance = new self(); |
|
42 | + } |
|
43 | + return self::$instance; |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * Registers the general settings. |
|
48 | - * |
|
49 | - * @param object $cmb new_cmb2_box(). |
|
50 | - * @return void |
|
51 | - */ |
|
52 | - public function settings( $cmb ) { |
|
53 | - $cmb->add_field( |
|
54 | - array( |
|
55 | - 'id' => 'workout_tab_layout', |
|
56 | - 'type' => 'select', |
|
57 | - 'name' => __( 'Workout Tab Layout', 'lsx-health-plan' ), |
|
58 | - 'description' => __( 'Choose the layout for the workouts.', 'lsx-health-plan' ), |
|
59 | - 'options' => array( |
|
60 | - 'table' => __( 'Table', 'lsx-health-plan' ), |
|
61 | - 'list' => __( 'List', 'lsx-health-plan' ), |
|
62 | - 'grid' => __( 'Grid', 'lsx-health-plan' ), |
|
63 | - ), |
|
64 | - ) |
|
65 | - ); |
|
66 | - $cmb->add_field( |
|
67 | - array( |
|
68 | - 'id' => 'workout_tab_link', |
|
69 | - 'type' => 'select', |
|
70 | - 'name' => __( 'Workout Tab Link', 'lsx-health-plan' ), |
|
71 | - 'description' => __( 'Choose to show the excerpt, full content or nothing.', 'lsx-health-plan' ), |
|
72 | - 'options' => array( |
|
73 | - '' => __( 'None', 'lsx-health-plan' ), |
|
74 | - 'single' => __( 'Single', 'lsx-health-plan' ), |
|
75 | - 'modal' => __( 'Modal', 'lsx-health-plan' ), |
|
76 | - ), |
|
77 | - 'default' => 'modal', |
|
78 | - ) |
|
79 | - ); |
|
80 | - $cmb->add_field( |
|
81 | - array( |
|
82 | - 'id' => 'workout_tab_modal_content', |
|
83 | - 'type' => 'select', |
|
84 | - 'name' => __( 'Modal Content', 'lsx-health-plan' ), |
|
85 | - 'description' => __( 'Choose to show the excerpt, full content or nothing. For the modal content only', 'lsx-health-plan' ), |
|
86 | - 'options' => array( |
|
87 | - '' => __( 'None', 'lsx-health-plan' ), |
|
88 | - 'excerpt' => __( 'Excerpt', 'lsx-health-plan' ), |
|
89 | - 'full' => __( 'Full Content', 'lsx-health-plan' ), |
|
90 | - ), |
|
91 | - 'default' => '', |
|
92 | - ) |
|
93 | - ); |
|
94 | - $cmb->add_field( |
|
95 | - array( |
|
96 | - 'id' => 'workout_tab_columns', |
|
97 | - 'type' => 'select', |
|
98 | - 'name' => __( 'Grid Columns', 'lsx-health-plan' ), |
|
99 | - 'description' => __( 'If you are displaying a grid, set the amount of columns you want to use.', 'lsx-health-plan' ), |
|
100 | - 'options' => array( |
|
101 | - '12' => __( '1', 'lsx-health-plan' ), |
|
102 | - '6' => __( '2', 'lsx-health-plan' ), |
|
103 | - '4' => __( '3', 'lsx-health-plan' ), |
|
104 | - '3' => __( '4', 'lsx-health-plan' ), |
|
105 | - '2' => __( '6', 'lsx-health-plan' ), |
|
106 | - ), |
|
107 | - 'default' => '4', |
|
108 | - ) |
|
109 | - ); |
|
110 | - $cmb->add_field( |
|
111 | - array( |
|
112 | - 'id' => 'workout_tab_content', |
|
113 | - 'type' => 'select', |
|
114 | - 'name' => __( 'Grid Content', 'lsx-health-plan' ), |
|
115 | - 'description' => __( 'Choose to show the excerpt, full content or nothing. For the grid layout only', 'lsx-health-plan' ), |
|
116 | - 'options' => array( |
|
117 | - '' => __( 'None', 'lsx-health-plan' ), |
|
118 | - 'excerpt' => __( 'Excerpt', 'lsx-health-plan' ), |
|
119 | - 'full' => __( 'Full Content', 'lsx-health-plan' ), |
|
120 | - ), |
|
121 | - 'default' => '', |
|
122 | - ) |
|
123 | - ); |
|
124 | - } |
|
46 | + /** |
|
47 | + * Registers the general settings. |
|
48 | + * |
|
49 | + * @param object $cmb new_cmb2_box(). |
|
50 | + * @return void |
|
51 | + */ |
|
52 | + public function settings( $cmb ) { |
|
53 | + $cmb->add_field( |
|
54 | + array( |
|
55 | + 'id' => 'workout_tab_layout', |
|
56 | + 'type' => 'select', |
|
57 | + 'name' => __( 'Workout Tab Layout', 'lsx-health-plan' ), |
|
58 | + 'description' => __( 'Choose the layout for the workouts.', 'lsx-health-plan' ), |
|
59 | + 'options' => array( |
|
60 | + 'table' => __( 'Table', 'lsx-health-plan' ), |
|
61 | + 'list' => __( 'List', 'lsx-health-plan' ), |
|
62 | + 'grid' => __( 'Grid', 'lsx-health-plan' ), |
|
63 | + ), |
|
64 | + ) |
|
65 | + ); |
|
66 | + $cmb->add_field( |
|
67 | + array( |
|
68 | + 'id' => 'workout_tab_link', |
|
69 | + 'type' => 'select', |
|
70 | + 'name' => __( 'Workout Tab Link', 'lsx-health-plan' ), |
|
71 | + 'description' => __( 'Choose to show the excerpt, full content or nothing.', 'lsx-health-plan' ), |
|
72 | + 'options' => array( |
|
73 | + '' => __( 'None', 'lsx-health-plan' ), |
|
74 | + 'single' => __( 'Single', 'lsx-health-plan' ), |
|
75 | + 'modal' => __( 'Modal', 'lsx-health-plan' ), |
|
76 | + ), |
|
77 | + 'default' => 'modal', |
|
78 | + ) |
|
79 | + ); |
|
80 | + $cmb->add_field( |
|
81 | + array( |
|
82 | + 'id' => 'workout_tab_modal_content', |
|
83 | + 'type' => 'select', |
|
84 | + 'name' => __( 'Modal Content', 'lsx-health-plan' ), |
|
85 | + 'description' => __( 'Choose to show the excerpt, full content or nothing. For the modal content only', 'lsx-health-plan' ), |
|
86 | + 'options' => array( |
|
87 | + '' => __( 'None', 'lsx-health-plan' ), |
|
88 | + 'excerpt' => __( 'Excerpt', 'lsx-health-plan' ), |
|
89 | + 'full' => __( 'Full Content', 'lsx-health-plan' ), |
|
90 | + ), |
|
91 | + 'default' => '', |
|
92 | + ) |
|
93 | + ); |
|
94 | + $cmb->add_field( |
|
95 | + array( |
|
96 | + 'id' => 'workout_tab_columns', |
|
97 | + 'type' => 'select', |
|
98 | + 'name' => __( 'Grid Columns', 'lsx-health-plan' ), |
|
99 | + 'description' => __( 'If you are displaying a grid, set the amount of columns you want to use.', 'lsx-health-plan' ), |
|
100 | + 'options' => array( |
|
101 | + '12' => __( '1', 'lsx-health-plan' ), |
|
102 | + '6' => __( '2', 'lsx-health-plan' ), |
|
103 | + '4' => __( '3', 'lsx-health-plan' ), |
|
104 | + '3' => __( '4', 'lsx-health-plan' ), |
|
105 | + '2' => __( '6', 'lsx-health-plan' ), |
|
106 | + ), |
|
107 | + 'default' => '4', |
|
108 | + ) |
|
109 | + ); |
|
110 | + $cmb->add_field( |
|
111 | + array( |
|
112 | + 'id' => 'workout_tab_content', |
|
113 | + 'type' => 'select', |
|
114 | + 'name' => __( 'Grid Content', 'lsx-health-plan' ), |
|
115 | + 'description' => __( 'Choose to show the excerpt, full content or nothing. For the grid layout only', 'lsx-health-plan' ), |
|
116 | + 'options' => array( |
|
117 | + '' => __( 'None', 'lsx-health-plan' ), |
|
118 | + 'excerpt' => __( 'Excerpt', 'lsx-health-plan' ), |
|
119 | + 'full' => __( 'Full Content', 'lsx-health-plan' ), |
|
120 | + ), |
|
121 | + 'default' => '', |
|
122 | + ) |
|
123 | + ); |
|
124 | + } |
|
125 | 125 | } |
126 | 126 | Workout::get_instance(); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * Constructor |
26 | 26 | */ |
27 | 27 | public function __construct() { |
28 | - add_action( 'lsx_hp_settings_page_workout_top', array( $this, 'settings' ), 1, 1 ); |
|
28 | + add_action('lsx_hp_settings_page_workout_top', array($this, 'settings'), 1, 1); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public static function get_instance() { |
39 | 39 | // If the single instance hasn't been set, set it now. |
40 | - if ( null === self::$instance ) { |
|
40 | + if (null === self::$instance) { |
|
41 | 41 | self::$instance = new self(); |
42 | 42 | } |
43 | 43 | return self::$instance; |
@@ -49,17 +49,17 @@ discard block |
||
49 | 49 | * @param object $cmb new_cmb2_box(). |
50 | 50 | * @return void |
51 | 51 | */ |
52 | - public function settings( $cmb ) { |
|
52 | + public function settings($cmb) { |
|
53 | 53 | $cmb->add_field( |
54 | 54 | array( |
55 | 55 | 'id' => 'workout_tab_layout', |
56 | 56 | 'type' => 'select', |
57 | - 'name' => __( 'Workout Tab Layout', 'lsx-health-plan' ), |
|
58 | - 'description' => __( 'Choose the layout for the workouts.', 'lsx-health-plan' ), |
|
57 | + 'name' => __('Workout Tab Layout', 'lsx-health-plan'), |
|
58 | + 'description' => __('Choose the layout for the workouts.', 'lsx-health-plan'), |
|
59 | 59 | 'options' => array( |
60 | - 'table' => __( 'Table', 'lsx-health-plan' ), |
|
61 | - 'list' => __( 'List', 'lsx-health-plan' ), |
|
62 | - 'grid' => __( 'Grid', 'lsx-health-plan' ), |
|
60 | + 'table' => __('Table', 'lsx-health-plan'), |
|
61 | + 'list' => __('List', 'lsx-health-plan'), |
|
62 | + 'grid' => __('Grid', 'lsx-health-plan'), |
|
63 | 63 | ), |
64 | 64 | ) |
65 | 65 | ); |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | array( |
68 | 68 | 'id' => 'workout_tab_link', |
69 | 69 | 'type' => 'select', |
70 | - 'name' => __( 'Workout Tab Link', 'lsx-health-plan' ), |
|
71 | - 'description' => __( 'Choose to show the excerpt, full content or nothing.', 'lsx-health-plan' ), |
|
70 | + 'name' => __('Workout Tab Link', 'lsx-health-plan'), |
|
71 | + 'description' => __('Choose to show the excerpt, full content or nothing.', 'lsx-health-plan'), |
|
72 | 72 | 'options' => array( |
73 | - '' => __( 'None', 'lsx-health-plan' ), |
|
74 | - 'single' => __( 'Single', 'lsx-health-plan' ), |
|
75 | - 'modal' => __( 'Modal', 'lsx-health-plan' ), |
|
73 | + '' => __('None', 'lsx-health-plan'), |
|
74 | + 'single' => __('Single', 'lsx-health-plan'), |
|
75 | + 'modal' => __('Modal', 'lsx-health-plan'), |
|
76 | 76 | ), |
77 | 77 | 'default' => 'modal', |
78 | 78 | ) |
@@ -81,12 +81,12 @@ discard block |
||
81 | 81 | array( |
82 | 82 | 'id' => 'workout_tab_modal_content', |
83 | 83 | 'type' => 'select', |
84 | - 'name' => __( 'Modal Content', 'lsx-health-plan' ), |
|
85 | - 'description' => __( 'Choose to show the excerpt, full content or nothing. For the modal content only', 'lsx-health-plan' ), |
|
84 | + 'name' => __('Modal Content', 'lsx-health-plan'), |
|
85 | + 'description' => __('Choose to show the excerpt, full content or nothing. For the modal content only', 'lsx-health-plan'), |
|
86 | 86 | 'options' => array( |
87 | - '' => __( 'None', 'lsx-health-plan' ), |
|
88 | - 'excerpt' => __( 'Excerpt', 'lsx-health-plan' ), |
|
89 | - 'full' => __( 'Full Content', 'lsx-health-plan' ), |
|
87 | + '' => __('None', 'lsx-health-plan'), |
|
88 | + 'excerpt' => __('Excerpt', 'lsx-health-plan'), |
|
89 | + 'full' => __('Full Content', 'lsx-health-plan'), |
|
90 | 90 | ), |
91 | 91 | 'default' => '', |
92 | 92 | ) |
@@ -95,14 +95,14 @@ discard block |
||
95 | 95 | array( |
96 | 96 | 'id' => 'workout_tab_columns', |
97 | 97 | 'type' => 'select', |
98 | - 'name' => __( 'Grid Columns', 'lsx-health-plan' ), |
|
99 | - 'description' => __( 'If you are displaying a grid, set the amount of columns you want to use.', 'lsx-health-plan' ), |
|
98 | + 'name' => __('Grid Columns', 'lsx-health-plan'), |
|
99 | + 'description' => __('If you are displaying a grid, set the amount of columns you want to use.', 'lsx-health-plan'), |
|
100 | 100 | 'options' => array( |
101 | - '12' => __( '1', 'lsx-health-plan' ), |
|
102 | - '6' => __( '2', 'lsx-health-plan' ), |
|
103 | - '4' => __( '3', 'lsx-health-plan' ), |
|
104 | - '3' => __( '4', 'lsx-health-plan' ), |
|
105 | - '2' => __( '6', 'lsx-health-plan' ), |
|
101 | + '12' => __('1', 'lsx-health-plan'), |
|
102 | + '6' => __('2', 'lsx-health-plan'), |
|
103 | + '4' => __('3', 'lsx-health-plan'), |
|
104 | + '3' => __('4', 'lsx-health-plan'), |
|
105 | + '2' => __('6', 'lsx-health-plan'), |
|
106 | 106 | ), |
107 | 107 | 'default' => '4', |
108 | 108 | ) |
@@ -111,12 +111,12 @@ discard block |
||
111 | 111 | array( |
112 | 112 | 'id' => 'workout_tab_content', |
113 | 113 | 'type' => 'select', |
114 | - 'name' => __( 'Grid Content', 'lsx-health-plan' ), |
|
115 | - 'description' => __( 'Choose to show the excerpt, full content or nothing. For the grid layout only', 'lsx-health-plan' ), |
|
114 | + 'name' => __('Grid Content', 'lsx-health-plan'), |
|
115 | + 'description' => __('Choose to show the excerpt, full content or nothing. For the grid layout only', 'lsx-health-plan'), |
|
116 | 116 | 'options' => array( |
117 | - '' => __( 'None', 'lsx-health-plan' ), |
|
118 | - 'excerpt' => __( 'Excerpt', 'lsx-health-plan' ), |
|
119 | - 'full' => __( 'Full Content', 'lsx-health-plan' ), |
|
117 | + '' => __('None', 'lsx-health-plan'), |
|
118 | + 'excerpt' => __('Excerpt', 'lsx-health-plan'), |
|
119 | + 'full' => __('Full Content', 'lsx-health-plan'), |
|
120 | 120 | ), |
121 | 121 | 'default' => '', |
122 | 122 | ) |
@@ -12,52 +12,52 @@ |
||
12 | 12 | */ |
13 | 13 | class Recipe { |
14 | 14 | |
15 | - /** |
|
16 | - * Holds class instance |
|
17 | - * |
|
18 | - * @since 1.0.0 |
|
19 | - * |
|
20 | - * @var object \lsx_health_plan\classes\admin\Recipe() |
|
21 | - */ |
|
22 | - protected static $instance = null; |
|
15 | + /** |
|
16 | + * Holds class instance |
|
17 | + * |
|
18 | + * @since 1.0.0 |
|
19 | + * |
|
20 | + * @var object \lsx_health_plan\classes\admin\Recipe() |
|
21 | + */ |
|
22 | + protected static $instance = null; |
|
23 | 23 | |
24 | - /** |
|
25 | - * Constructor |
|
26 | - */ |
|
27 | - public function __construct() { |
|
28 | - add_action( 'lsx_hp_settings_page_recipe_top', array( $this, 'settings' ), 1, 1 ); |
|
29 | - } |
|
24 | + /** |
|
25 | + * Constructor |
|
26 | + */ |
|
27 | + public function __construct() { |
|
28 | + add_action( 'lsx_hp_settings_page_recipe_top', array( $this, 'settings' ), 1, 1 ); |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * Return an instance of this class. |
|
33 | - * |
|
34 | - * @since 1.0.0 |
|
35 | - * |
|
36 | - * @return object \lsx_health_plan\classes\admin\Recipe() A single instance of this class. |
|
37 | - */ |
|
38 | - public static function get_instance() { |
|
39 | - // If the single instance hasn't been set, set it now. |
|
40 | - if ( null === self::$instance ) { |
|
41 | - self::$instance = new self(); |
|
42 | - } |
|
43 | - return self::$instance; |
|
44 | - } |
|
31 | + /** |
|
32 | + * Return an instance of this class. |
|
33 | + * |
|
34 | + * @since 1.0.0 |
|
35 | + * |
|
36 | + * @return object \lsx_health_plan\classes\admin\Recipe() A single instance of this class. |
|
37 | + */ |
|
38 | + public static function get_instance() { |
|
39 | + // If the single instance hasn't been set, set it now. |
|
40 | + if ( null === self::$instance ) { |
|
41 | + self::$instance = new self(); |
|
42 | + } |
|
43 | + return self::$instance; |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * Registers the general settings. |
|
48 | - * |
|
49 | - * @param object $cmb new_cmb2_box(). |
|
50 | - * @return void |
|
51 | - */ |
|
52 | - public function settings( $cmb ) { |
|
53 | - $cmb->add_field( |
|
54 | - array( |
|
55 | - 'id' => 'recipe_archive_description', |
|
56 | - 'type' => 'wysiwyg', |
|
57 | - 'name' => __( 'Archive Description', 'lsx-health-plan' ), |
|
58 | - 'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ), |
|
59 | - ) |
|
60 | - ); |
|
61 | - } |
|
46 | + /** |
|
47 | + * Registers the general settings. |
|
48 | + * |
|
49 | + * @param object $cmb new_cmb2_box(). |
|
50 | + * @return void |
|
51 | + */ |
|
52 | + public function settings( $cmb ) { |
|
53 | + $cmb->add_field( |
|
54 | + array( |
|
55 | + 'id' => 'recipe_archive_description', |
|
56 | + 'type' => 'wysiwyg', |
|
57 | + 'name' => __( 'Archive Description', 'lsx-health-plan' ), |
|
58 | + 'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ), |
|
59 | + ) |
|
60 | + ); |
|
61 | + } |
|
62 | 62 | } |
63 | 63 | Recipe::get_instance(); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * Constructor |
26 | 26 | */ |
27 | 27 | public function __construct() { |
28 | - add_action( 'lsx_hp_settings_page_recipe_top', array( $this, 'settings' ), 1, 1 ); |
|
28 | + add_action('lsx_hp_settings_page_recipe_top', array($this, 'settings'), 1, 1); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public static function get_instance() { |
39 | 39 | // If the single instance hasn't been set, set it now. |
40 | - if ( null === self::$instance ) { |
|
40 | + if (null === self::$instance) { |
|
41 | 41 | self::$instance = new self(); |
42 | 42 | } |
43 | 43 | return self::$instance; |
@@ -49,13 +49,13 @@ discard block |
||
49 | 49 | * @param object $cmb new_cmb2_box(). |
50 | 50 | * @return void |
51 | 51 | */ |
52 | - public function settings( $cmb ) { |
|
52 | + public function settings($cmb) { |
|
53 | 53 | $cmb->add_field( |
54 | 54 | array( |
55 | 55 | 'id' => 'recipe_archive_description', |
56 | 56 | 'type' => 'wysiwyg', |
57 | - 'name' => __( 'Archive Description', 'lsx-health-plan' ), |
|
58 | - 'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ), |
|
57 | + 'name' => __('Archive Description', 'lsx-health-plan'), |
|
58 | + 'description' => __('This will show up on the post type archive.', 'lsx-health-plan'), |
|
59 | 59 | ) |
60 | 60 | ); |
61 | 61 | } |
@@ -12,54 +12,54 @@ |
||
12 | 12 | */ |
13 | 13 | class Plan { |
14 | 14 | |
15 | - /** |
|
16 | - * Holds class instance |
|
17 | - * |
|
18 | - * @since 1.0.0 |
|
19 | - * |
|
20 | - * @var object \lsx_health_plan\classes\admin\Plan() |
|
21 | - */ |
|
22 | - protected static $instance = null; |
|
15 | + /** |
|
16 | + * Holds class instance |
|
17 | + * |
|
18 | + * @since 1.0.0 |
|
19 | + * |
|
20 | + * @var object \lsx_health_plan\classes\admin\Plan() |
|
21 | + */ |
|
22 | + protected static $instance = null; |
|
23 | 23 | |
24 | - /** |
|
25 | - * Constructor |
|
26 | - */ |
|
27 | - public function __construct() { |
|
28 | - add_action( 'lsx_hp_settings_page_plan_top', array( $this, 'settings' ), 1, 1 ); |
|
29 | - } |
|
24 | + /** |
|
25 | + * Constructor |
|
26 | + */ |
|
27 | + public function __construct() { |
|
28 | + add_action( 'lsx_hp_settings_page_plan_top', array( $this, 'settings' ), 1, 1 ); |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * Return an instance of this class. |
|
33 | - * |
|
34 | - * @since 1.0.0 |
|
35 | - * |
|
36 | - * @return object \lsx_health_plan\classes\admin\Plan() A single instance of this class. |
|
37 | - */ |
|
38 | - public static function get_instance() { |
|
39 | - // If the single instance hasn't been set, set it now. |
|
40 | - if ( null === self::$instance ) { |
|
41 | - self::$instance = new self(); |
|
42 | - } |
|
43 | - return self::$instance; |
|
44 | - } |
|
31 | + /** |
|
32 | + * Return an instance of this class. |
|
33 | + * |
|
34 | + * @since 1.0.0 |
|
35 | + * |
|
36 | + * @return object \lsx_health_plan\classes\admin\Plan() A single instance of this class. |
|
37 | + */ |
|
38 | + public static function get_instance() { |
|
39 | + // If the single instance hasn't been set, set it now. |
|
40 | + if ( null === self::$instance ) { |
|
41 | + self::$instance = new self(); |
|
42 | + } |
|
43 | + return self::$instance; |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * Registers the general settings. |
|
48 | - * |
|
49 | - * @param object $cmb new_cmb2_box(). |
|
50 | - * @return void |
|
51 | - */ |
|
52 | - public function settings( $cmb ) { |
|
53 | - $cmb->add_field( |
|
54 | - array( |
|
55 | - 'name' => __( 'Plan Filters', 'lsx-health-plan' ), |
|
56 | - 'id' => 'plan_filters_disabled', |
|
57 | - 'type' => 'checkbox', |
|
58 | - 'value' => 1, |
|
59 | - 'default' => 0, |
|
60 | - 'description' => __( 'Toggle the display of the tab filters on the post type archive.', 'lsx-health-plan' ), |
|
61 | - ) |
|
62 | - ); |
|
63 | - } |
|
46 | + /** |
|
47 | + * Registers the general settings. |
|
48 | + * |
|
49 | + * @param object $cmb new_cmb2_box(). |
|
50 | + * @return void |
|
51 | + */ |
|
52 | + public function settings( $cmb ) { |
|
53 | + $cmb->add_field( |
|
54 | + array( |
|
55 | + 'name' => __( 'Plan Filters', 'lsx-health-plan' ), |
|
56 | + 'id' => 'plan_filters_disabled', |
|
57 | + 'type' => 'checkbox', |
|
58 | + 'value' => 1, |
|
59 | + 'default' => 0, |
|
60 | + 'description' => __( 'Toggle the display of the tab filters on the post type archive.', 'lsx-health-plan' ), |
|
61 | + ) |
|
62 | + ); |
|
63 | + } |
|
64 | 64 | } |
65 | 65 | Plan::get_instance(); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * Constructor |
26 | 26 | */ |
27 | 27 | public function __construct() { |
28 | - add_action( 'lsx_hp_settings_page_plan_top', array( $this, 'settings' ), 1, 1 ); |
|
28 | + add_action('lsx_hp_settings_page_plan_top', array($this, 'settings'), 1, 1); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public static function get_instance() { |
39 | 39 | // If the single instance hasn't been set, set it now. |
40 | - if ( null === self::$instance ) { |
|
40 | + if (null === self::$instance) { |
|
41 | 41 | self::$instance = new self(); |
42 | 42 | } |
43 | 43 | return self::$instance; |
@@ -49,15 +49,15 @@ discard block |
||
49 | 49 | * @param object $cmb new_cmb2_box(). |
50 | 50 | * @return void |
51 | 51 | */ |
52 | - public function settings( $cmb ) { |
|
52 | + public function settings($cmb) { |
|
53 | 53 | $cmb->add_field( |
54 | 54 | array( |
55 | - 'name' => __( 'Plan Filters', 'lsx-health-plan' ), |
|
55 | + 'name' => __('Plan Filters', 'lsx-health-plan'), |
|
56 | 56 | 'id' => 'plan_filters_disabled', |
57 | 57 | 'type' => 'checkbox', |
58 | 58 | 'value' => 1, |
59 | 59 | 'default' => 0, |
60 | - 'description' => __( 'Toggle the display of the tab filters on the post type archive.', 'lsx-health-plan' ), |
|
60 | + 'description' => __('Toggle the display of the tab filters on the post type archive.', 'lsx-health-plan'), |
|
61 | 61 | ) |
62 | 62 | ); |
63 | 63 | } |
@@ -8,86 +8,86 @@ |
||
8 | 8 | */ |
9 | 9 | class Setup { |
10 | 10 | |
11 | - /** |
|
12 | - * Holds class instance |
|
13 | - * |
|
14 | - * @since 1.0.0 |
|
15 | - * |
|
16 | - * @var object \lsx_health_plan\classes\Setup() |
|
17 | - */ |
|
18 | - protected static $instance = null; |
|
11 | + /** |
|
12 | + * Holds class instance |
|
13 | + * |
|
14 | + * @since 1.0.0 |
|
15 | + * |
|
16 | + * @var object \lsx_health_plan\classes\Setup() |
|
17 | + */ |
|
18 | + protected static $instance = null; |
|
19 | 19 | |
20 | - /** |
|
21 | - * @var object \lsx_health_plan\classes\Post_Type(); |
|
22 | - */ |
|
23 | - public $post_types; |
|
20 | + /** |
|
21 | + * @var object \lsx_health_plan\classes\Post_Type(); |
|
22 | + */ |
|
23 | + public $post_types; |
|
24 | 24 | |
25 | - /** |
|
26 | - * Constructor |
|
27 | - */ |
|
28 | - public function __construct() { |
|
29 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
30 | - add_action( 'wp_head', array( $this, 'load_shortcodes' ) ); |
|
31 | - $this->load_classes(); |
|
32 | - } |
|
25 | + /** |
|
26 | + * Constructor |
|
27 | + */ |
|
28 | + public function __construct() { |
|
29 | + add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
30 | + add_action( 'wp_head', array( $this, 'load_shortcodes' ) ); |
|
31 | + $this->load_classes(); |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * Return an instance of this class. |
|
36 | - * |
|
37 | - * @since 1.0.0 |
|
38 | - * |
|
39 | - * @return object \lsx_health_plan\classes\Setup() A single instance of this class. |
|
40 | - */ |
|
41 | - public static function get_instance() { |
|
34 | + /** |
|
35 | + * Return an instance of this class. |
|
36 | + * |
|
37 | + * @since 1.0.0 |
|
38 | + * |
|
39 | + * @return object \lsx_health_plan\classes\Setup() A single instance of this class. |
|
40 | + */ |
|
41 | + public static function get_instance() { |
|
42 | 42 | |
43 | - // If the single instance hasn't been set, set it now. |
|
44 | - if ( null === self::$instance ) { |
|
45 | - self::$instance = new self(); |
|
46 | - } |
|
43 | + // If the single instance hasn't been set, set it now. |
|
44 | + if ( null === self::$instance ) { |
|
45 | + self::$instance = new self(); |
|
46 | + } |
|
47 | 47 | |
48 | - return self::$instance; |
|
48 | + return self::$instance; |
|
49 | 49 | |
50 | - } |
|
50 | + } |
|
51 | 51 | |
52 | - /** |
|
53 | - * Adds text domain. |
|
54 | - */ |
|
55 | - public function load_plugin_textdomain() { |
|
56 | - load_plugin_textdomain( 'lsx-health-plan', false, basename( LSX_HEALTH_PLAN_PATH ) . '/languages' ); |
|
57 | - } |
|
52 | + /** |
|
53 | + * Adds text domain. |
|
54 | + */ |
|
55 | + public function load_plugin_textdomain() { |
|
56 | + load_plugin_textdomain( 'lsx-health-plan', false, basename( LSX_HEALTH_PLAN_PATH ) . '/languages' ); |
|
57 | + } |
|
58 | 58 | |
59 | - /** |
|
60 | - * Registers our shortcodes. |
|
61 | - * |
|
62 | - * @return void |
|
63 | - */ |
|
64 | - public function load_classes() { |
|
65 | - require_once LSX_HEALTH_PLAN_PATH . 'classes/class-post-type.php'; |
|
66 | - $this->post_types = Post_Type::get_instance(); |
|
67 | - } |
|
59 | + /** |
|
60 | + * Registers our shortcodes. |
|
61 | + * |
|
62 | + * @return void |
|
63 | + */ |
|
64 | + public function load_classes() { |
|
65 | + require_once LSX_HEALTH_PLAN_PATH . 'classes/class-post-type.php'; |
|
66 | + $this->post_types = Post_Type::get_instance(); |
|
67 | + } |
|
68 | 68 | |
69 | - /** |
|
70 | - * Registers our shortcodes. |
|
71 | - * |
|
72 | - * @return void |
|
73 | - */ |
|
74 | - public function load_shortcodes() { |
|
75 | - add_shortcode( 'lsx_health_plan_restricted_content', '\lsx_health_plan\shortcodes\restricted_content' ); |
|
76 | - add_shortcode( 'lsx_health_plan_my_profile_tabs', '\lsx_health_plan\shortcodes\my_profile_tabs' ); |
|
77 | - add_shortcode( 'lsx_health_plan_my_profile_block', '\lsx_health_plan\shortcodes\my_profile_box' ); |
|
78 | - add_shortcode( 'lsx_health_plan_all_plans_block', '\lsx_health_plan\shortcodes\all_plans_box' ); |
|
79 | - add_shortcode( 'lsx_health_plan_day_plan_block', '\lsx_health_plan\shortcodes\day_plan_box' ); |
|
80 | - add_shortcode( 'lsx_health_plan_account_notices', '\lsx_health_plan\shortcodes\account_notices' ); |
|
69 | + /** |
|
70 | + * Registers our shortcodes. |
|
71 | + * |
|
72 | + * @return void |
|
73 | + */ |
|
74 | + public function load_shortcodes() { |
|
75 | + add_shortcode( 'lsx_health_plan_restricted_content', '\lsx_health_plan\shortcodes\restricted_content' ); |
|
76 | + add_shortcode( 'lsx_health_plan_my_profile_tabs', '\lsx_health_plan\shortcodes\my_profile_tabs' ); |
|
77 | + add_shortcode( 'lsx_health_plan_my_profile_block', '\lsx_health_plan\shortcodes\my_profile_box' ); |
|
78 | + add_shortcode( 'lsx_health_plan_all_plans_block', '\lsx_health_plan\shortcodes\all_plans_box' ); |
|
79 | + add_shortcode( 'lsx_health_plan_day_plan_block', '\lsx_health_plan\shortcodes\day_plan_box' ); |
|
80 | + add_shortcode( 'lsx_health_plan_account_notices', '\lsx_health_plan\shortcodes\account_notices' ); |
|
81 | 81 | |
82 | - if ( post_type_exists( 'video' ) ) { |
|
83 | - add_shortcode( 'lsx_health_plan_featured_video_block', '\lsx_health_plan\shortcodes\feature_video_box' ); |
|
84 | - } |
|
85 | - if ( post_type_exists( 'recipe' ) ) { |
|
86 | - add_shortcode( 'lsx_health_plan_featured_recipes_block', '\lsx_health_plan\shortcodes\feature_recipes_box' ); |
|
87 | - } |
|
88 | - if ( post_type_exists( 'tip' ) ) { |
|
89 | - add_shortcode( 'lsx_health_plan_featured_tips_block', '\lsx_health_plan\shortcodes\feature_tips_box' ); |
|
90 | - } |
|
91 | - add_shortcode( 'lsx_health_plan_items', '\lsx_health_plan\shortcodes\exercise_box' ); |
|
92 | - } |
|
82 | + if ( post_type_exists( 'video' ) ) { |
|
83 | + add_shortcode( 'lsx_health_plan_featured_video_block', '\lsx_health_plan\shortcodes\feature_video_box' ); |
|
84 | + } |
|
85 | + if ( post_type_exists( 'recipe' ) ) { |
|
86 | + add_shortcode( 'lsx_health_plan_featured_recipes_block', '\lsx_health_plan\shortcodes\feature_recipes_box' ); |
|
87 | + } |
|
88 | + if ( post_type_exists( 'tip' ) ) { |
|
89 | + add_shortcode( 'lsx_health_plan_featured_tips_block', '\lsx_health_plan\shortcodes\feature_tips_box' ); |
|
90 | + } |
|
91 | + add_shortcode( 'lsx_health_plan_items', '\lsx_health_plan\shortcodes\exercise_box' ); |
|
92 | + } |
|
93 | 93 | } |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | * Constructor |
27 | 27 | */ |
28 | 28 | public function __construct() { |
29 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
30 | - add_action( 'wp_head', array( $this, 'load_shortcodes' ) ); |
|
29 | + add_action('init', array($this, 'load_plugin_textdomain')); |
|
30 | + add_action('wp_head', array($this, 'load_shortcodes')); |
|
31 | 31 | $this->load_classes(); |
32 | 32 | } |
33 | 33 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public static function get_instance() { |
42 | 42 | |
43 | 43 | // If the single instance hasn't been set, set it now. |
44 | - if ( null === self::$instance ) { |
|
44 | + if (null === self::$instance) { |
|
45 | 45 | self::$instance = new self(); |
46 | 46 | } |
47 | 47 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * Adds text domain. |
54 | 54 | */ |
55 | 55 | public function load_plugin_textdomain() { |
56 | - load_plugin_textdomain( 'lsx-health-plan', false, basename( LSX_HEALTH_PLAN_PATH ) . '/languages' ); |
|
56 | + load_plugin_textdomain('lsx-health-plan', false, basename(LSX_HEALTH_PLAN_PATH) . '/languages'); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -72,22 +72,22 @@ discard block |
||
72 | 72 | * @return void |
73 | 73 | */ |
74 | 74 | public function load_shortcodes() { |
75 | - add_shortcode( 'lsx_health_plan_restricted_content', '\lsx_health_plan\shortcodes\restricted_content' ); |
|
76 | - add_shortcode( 'lsx_health_plan_my_profile_tabs', '\lsx_health_plan\shortcodes\my_profile_tabs' ); |
|
77 | - add_shortcode( 'lsx_health_plan_my_profile_block', '\lsx_health_plan\shortcodes\my_profile_box' ); |
|
78 | - add_shortcode( 'lsx_health_plan_all_plans_block', '\lsx_health_plan\shortcodes\all_plans_box' ); |
|
79 | - add_shortcode( 'lsx_health_plan_day_plan_block', '\lsx_health_plan\shortcodes\day_plan_box' ); |
|
80 | - add_shortcode( 'lsx_health_plan_account_notices', '\lsx_health_plan\shortcodes\account_notices' ); |
|
75 | + add_shortcode('lsx_health_plan_restricted_content', '\lsx_health_plan\shortcodes\restricted_content'); |
|
76 | + add_shortcode('lsx_health_plan_my_profile_tabs', '\lsx_health_plan\shortcodes\my_profile_tabs'); |
|
77 | + add_shortcode('lsx_health_plan_my_profile_block', '\lsx_health_plan\shortcodes\my_profile_box'); |
|
78 | + add_shortcode('lsx_health_plan_all_plans_block', '\lsx_health_plan\shortcodes\all_plans_box'); |
|
79 | + add_shortcode('lsx_health_plan_day_plan_block', '\lsx_health_plan\shortcodes\day_plan_box'); |
|
80 | + add_shortcode('lsx_health_plan_account_notices', '\lsx_health_plan\shortcodes\account_notices'); |
|
81 | 81 | |
82 | - if ( post_type_exists( 'video' ) ) { |
|
83 | - add_shortcode( 'lsx_health_plan_featured_video_block', '\lsx_health_plan\shortcodes\feature_video_box' ); |
|
82 | + if (post_type_exists('video')) { |
|
83 | + add_shortcode('lsx_health_plan_featured_video_block', '\lsx_health_plan\shortcodes\feature_video_box'); |
|
84 | 84 | } |
85 | - if ( post_type_exists( 'recipe' ) ) { |
|
86 | - add_shortcode( 'lsx_health_plan_featured_recipes_block', '\lsx_health_plan\shortcodes\feature_recipes_box' ); |
|
85 | + if (post_type_exists('recipe')) { |
|
86 | + add_shortcode('lsx_health_plan_featured_recipes_block', '\lsx_health_plan\shortcodes\feature_recipes_box'); |
|
87 | 87 | } |
88 | - if ( post_type_exists( 'tip' ) ) { |
|
89 | - add_shortcode( 'lsx_health_plan_featured_tips_block', '\lsx_health_plan\shortcodes\feature_tips_box' ); |
|
88 | + if (post_type_exists('tip')) { |
|
89 | + add_shortcode('lsx_health_plan_featured_tips_block', '\lsx_health_plan\shortcodes\feature_tips_box'); |
|
90 | 90 | } |
91 | - add_shortcode( 'lsx_health_plan_items', '\lsx_health_plan\shortcodes\exercise_box' ); |
|
91 | + add_shortcode('lsx_health_plan_items', '\lsx_health_plan\shortcodes\exercise_box'); |
|
92 | 92 | } |
93 | 93 | } |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | * @return void |
12 | 12 | */ |
13 | 13 | function lsx_hp_plan_archive_filters() { |
14 | - if ( is_post_type_archive( 'plan' ) && function_exists( 'wc_get_page_id' ) && false === apply_filters( 'lsx_hp_disable_plan_archive_filters', false ) ) { |
|
15 | - ?> |
|
14 | + if ( is_post_type_archive( 'plan' ) && function_exists( 'wc_get_page_id' ) && false === apply_filters( 'lsx_hp_disable_plan_archive_filters', false ) ) { |
|
15 | + ?> |
|
16 | 16 | <div id="type-nav"> |
17 | 17 | <ul class="nav nav-pills lsx-type-nav-filter"> |
18 | 18 | <li class="active"><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter="*"><?php esc_html_e( 'All', 'lsx-health-plan' ); ?></a></li> |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | </ul> |
23 | 23 | </div> |
24 | 24 | <?php |
25 | - } |
|
25 | + } |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -31,27 +31,27 @@ discard block |
||
31 | 31 | * @return string |
32 | 32 | */ |
33 | 33 | function lsx_hp_plan_get_classes() { |
34 | - $classes = 'filter-free'; |
|
35 | - if ( \lsx_health_plan\functions\woocommerce\plan_has_products() ) { |
|
36 | - $products = \lsx_health_plan\functions\woocommerce\get_plan_products(); |
|
37 | - $linked_product = wc_get_product( $products[0] ); |
|
38 | - $price = $linked_product->get_price( 'raw' ); |
|
39 | - if ( empty( $price ) ) { |
|
40 | - $classes = 'filter-free'; |
|
41 | - } else { |
|
42 | - $classes = 'filter-paid'; |
|
43 | - } |
|
34 | + $classes = 'filter-free'; |
|
35 | + if ( \lsx_health_plan\functions\woocommerce\plan_has_products() ) { |
|
36 | + $products = \lsx_health_plan\functions\woocommerce\get_plan_products(); |
|
37 | + $linked_product = wc_get_product( $products[0] ); |
|
38 | + $price = $linked_product->get_price( 'raw' ); |
|
39 | + if ( empty( $price ) ) { |
|
40 | + $classes = 'filter-free'; |
|
41 | + } else { |
|
42 | + $classes = 'filter-paid'; |
|
43 | + } |
|
44 | 44 | |
45 | - $featured = get_post_meta( get_the_ID(), 'plan_featured_plan', true ); |
|
46 | - if ( false !== $featured && '' !== $featured ) { |
|
47 | - $classes .= ' filter-featured'; |
|
48 | - } |
|
49 | - } |
|
50 | - return $classes; |
|
45 | + $featured = get_post_meta( get_the_ID(), 'plan_featured_plan', true ); |
|
46 | + if ( false !== $featured && '' !== $featured ) { |
|
47 | + $classes .= ' filter-featured'; |
|
48 | + } |
|
49 | + } |
|
50 | + return $classes; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | function lsx_health_plan_back_to_plan_button() { |
54 | - ?> |
|
54 | + ?> |
|
55 | 55 | <div class="back-plan-btn"> |
56 | 56 | <a class="btn" href="<?php the_permalink(); ?>"><?php esc_html_e( 'Back To Plan', 'lsx-health-plan' ); ?></a> |
57 | 57 | </div> |
@@ -11,14 +11,14 @@ discard block |
||
11 | 11 | * @return void |
12 | 12 | */ |
13 | 13 | function lsx_hp_plan_archive_filters() { |
14 | - if ( is_post_type_archive( 'plan' ) && function_exists( 'wc_get_page_id' ) && false === apply_filters( 'lsx_hp_disable_plan_archive_filters', false ) ) { |
|
14 | + if (is_post_type_archive('plan') && function_exists('wc_get_page_id') && false === apply_filters('lsx_hp_disable_plan_archive_filters', false)) { |
|
15 | 15 | ?> |
16 | 16 | <div id="type-nav"> |
17 | 17 | <ul class="nav nav-pills lsx-type-nav-filter"> |
18 | - <li class="active"><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter="*"><?php esc_html_e( 'All', 'lsx-health-plan' ); ?></a></li> |
|
19 | - <li><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter=".filter-free"><?php esc_html_e( 'Free', 'lsx-health-plan' ); ?></a></li> |
|
20 | - <li><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter=".filter-paid"><?php esc_html_e( 'Paid', 'lsx-health-plan' ); ?></a></li> |
|
21 | - <li><a href="<?php echo empty( $group_selected ) ? '#' : esc_url( get_post_type_archive_link( 'plan' ) ); ?>" data-filter=".filter-featured"><?php esc_html_e( 'Featured', 'lsx-health-plan' ); ?></a></li> |
|
18 | + <li class="active"><a href="<?php echo empty($group_selected) ? '#' : esc_url(get_post_type_archive_link('plan')); ?>" data-filter="*"><?php esc_html_e('All', 'lsx-health-plan'); ?></a></li> |
|
19 | + <li><a href="<?php echo empty($group_selected) ? '#' : esc_url(get_post_type_archive_link('plan')); ?>" data-filter=".filter-free"><?php esc_html_e('Free', 'lsx-health-plan'); ?></a></li> |
|
20 | + <li><a href="<?php echo empty($group_selected) ? '#' : esc_url(get_post_type_archive_link('plan')); ?>" data-filter=".filter-paid"><?php esc_html_e('Paid', 'lsx-health-plan'); ?></a></li> |
|
21 | + <li><a href="<?php echo empty($group_selected) ? '#' : esc_url(get_post_type_archive_link('plan')); ?>" data-filter=".filter-featured"><?php esc_html_e('Featured', 'lsx-health-plan'); ?></a></li> |
|
22 | 22 | </ul> |
23 | 23 | </div> |
24 | 24 | <?php |
@@ -32,18 +32,18 @@ discard block |
||
32 | 32 | */ |
33 | 33 | function lsx_hp_plan_get_classes() { |
34 | 34 | $classes = 'filter-free'; |
35 | - if ( \lsx_health_plan\functions\woocommerce\plan_has_products() ) { |
|
35 | + if (\lsx_health_plan\functions\woocommerce\plan_has_products()) { |
|
36 | 36 | $products = \lsx_health_plan\functions\woocommerce\get_plan_products(); |
37 | - $linked_product = wc_get_product( $products[0] ); |
|
38 | - $price = $linked_product->get_price( 'raw' ); |
|
39 | - if ( empty( $price ) ) { |
|
37 | + $linked_product = wc_get_product($products[0]); |
|
38 | + $price = $linked_product->get_price('raw'); |
|
39 | + if (empty($price)) { |
|
40 | 40 | $classes = 'filter-free'; |
41 | 41 | } else { |
42 | 42 | $classes = 'filter-paid'; |
43 | 43 | } |
44 | 44 | |
45 | - $featured = get_post_meta( get_the_ID(), 'plan_featured_plan', true ); |
|
46 | - if ( false !== $featured && '' !== $featured ) { |
|
45 | + $featured = get_post_meta(get_the_ID(), 'plan_featured_plan', true); |
|
46 | + if (false !== $featured && '' !== $featured) { |
|
47 | 47 | $classes .= ' filter-featured'; |
48 | 48 | } |
49 | 49 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | function lsx_health_plan_back_to_plan_button() { |
54 | 54 | ?> |
55 | 55 | <div class="back-plan-btn"> |
56 | - <a class="btn" href="<?php the_permalink(); ?>"><?php esc_html_e( 'Back To Plan', 'lsx-health-plan' ); ?></a> |
|
56 | + <a class="btn" href="<?php the_permalink(); ?>"><?php esc_html_e('Back To Plan', 'lsx-health-plan'); ?></a> |
|
57 | 57 | </div> |
58 | 58 | <?php |
59 | 59 | } |
@@ -114,13 +114,19 @@ |
||
114 | 114 | <div class="entry-tabs hp-entry-tabs"> |
115 | 115 | <ul class="nav nav-tabs"> |
116 | 116 | <?php foreach ( $tabs as $i => $tab ) : ?> |
117 | - <li<?php if ( 0 === $i ) echo ' class="active"'; ?>><a data-toggle="tab" href="#<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>"><?php echo esc_html( $tab['title'] ); ?></a></li> |
|
117 | + <li<?php if ( 0 === $i ) { |
|
118 | + echo ' class="active"'; |
|
119 | +} |
|
120 | +?>><a data-toggle="tab" href="#<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>"><?php echo esc_html( $tab['title'] ); ?></a></li> |
|
118 | 121 | <?php endforeach; ?> |
119 | 122 | </ul> |
120 | 123 | |
121 | 124 | <div class="tab-content"> |
122 | 125 | <?php foreach ( $tabs as $i => $tab ) : ?> |
123 | - <div id="<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>" class="tab-pane fade<?php if ( 0 === $i ) echo ' in active'; ?>"> |
|
126 | + <div id="<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>" class="tab-pane fade<?php if ( 0 === $i ) { |
|
127 | + echo ' in active'; |
|
128 | +} |
|
129 | +?>"> |
|
124 | 130 | <?php echo do_shortcode( $tab['shortcode'] ); ?> |
125 | 131 | <?php echo wp_kses_post( $tab['content'] ); ?> |
126 | 132 | </div> |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | $tab_experience['content'] = get_post_meta( get_the_ID(), 'team_member_experience', true ); |
9 | 9 | $tab_experience['shortcode'] = ''; |
10 | 10 | if ( ! empty( $tab_experience['content'] ) ) { |
11 | - $tabs[] = $tab_experience; |
|
11 | + $tabs[] = $tab_experience; |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | // Tab Featured plan |
@@ -19,36 +19,36 @@ discard block |
||
19 | 19 | |
20 | 20 | if ( ! empty( $tab_plans['posts'] ) ) { |
21 | 21 | |
22 | - $plan_content = ''; |
|
22 | + $plan_content = ''; |
|
23 | 23 | |
24 | - $include = implode( ',', $tab_plans['posts'] ); |
|
25 | - $args = array( |
|
26 | - 'orderby' => 'menu_order', |
|
27 | - 'order' => 'ASC', |
|
28 | - 'post_type' => 'plan', |
|
29 | - 'post__in' => $tab_plans['posts'], |
|
30 | - ); |
|
31 | - $plan_query = new WP_Query( $args ); |
|
24 | + $include = implode( ',', $tab_plans['posts'] ); |
|
25 | + $args = array( |
|
26 | + 'orderby' => 'menu_order', |
|
27 | + 'order' => 'ASC', |
|
28 | + 'post_type' => 'plan', |
|
29 | + 'post__in' => $tab_plans['posts'], |
|
30 | + ); |
|
31 | + $plan_query = new WP_Query( $args ); |
|
32 | 32 | |
33 | - $plan_content = '<div class="all-plans-block plan-grid block-all-plans-block team-member-plans"><div class="row">'; |
|
33 | + $plan_content = '<div class="all-plans-block plan-grid block-all-plans-block team-member-plans"><div class="row">'; |
|
34 | 34 | |
35 | - if ( $plan_query->have_posts() ) { |
|
36 | - add_action( 'lsx_sharing_is_disabled', '\lsx_health_plan\functions\triggers\disable_sharing', 10 ); |
|
37 | - while ( $plan_query->have_posts() ) { |
|
38 | - $plan_query->the_post(); |
|
39 | - ob_start(); |
|
40 | - include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-plan.php'; |
|
41 | - $plan_content .= ob_get_clean(); |
|
42 | - } |
|
43 | - wp_reset_postdata(); |
|
44 | - remove_action( 'lsx_sharing_is_disabled', '\lsx_health_plan\functions\triggers\disable_sharing', 10 ); |
|
45 | - } |
|
46 | - $plan_content .= '</div></div>'; |
|
35 | + if ( $plan_query->have_posts() ) { |
|
36 | + add_action( 'lsx_sharing_is_disabled', '\lsx_health_plan\functions\triggers\disable_sharing', 10 ); |
|
37 | + while ( $plan_query->have_posts() ) { |
|
38 | + $plan_query->the_post(); |
|
39 | + ob_start(); |
|
40 | + include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-plan.php'; |
|
41 | + $plan_content .= ob_get_clean(); |
|
42 | + } |
|
43 | + wp_reset_postdata(); |
|
44 | + remove_action( 'lsx_sharing_is_disabled', '\lsx_health_plan\functions\triggers\disable_sharing', 10 ); |
|
45 | + } |
|
46 | + $plan_content .= '</div></div>'; |
|
47 | 47 | |
48 | - $tab_plans['content'] = $plan_content; |
|
48 | + $tab_plans['content'] = $plan_content; |
|
49 | 49 | } |
50 | 50 | if ( ! empty( $tab_plans['content'] ) ) { |
51 | - $tabs[] = $tab_plans; |
|
51 | + $tabs[] = $tab_plans; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | |
@@ -59,15 +59,15 @@ discard block |
||
59 | 59 | $tab_testimonial['content'] = ''; |
60 | 60 | |
61 | 61 | if ( is_plugin_active( 'lsx-testimonials/lsx-testimonials.php' ) && ( ! empty( $tab_testimonial['posts'] ) ) ) { |
62 | - if ( count( $tab_testimonial['posts'] ) <= 2 ) { |
|
63 | - $columns = count( $tab_testimonial['posts'] ); |
|
64 | - } else { |
|
65 | - $columns = 3; |
|
66 | - } |
|
62 | + if ( count( $tab_testimonial['posts'] ) <= 2 ) { |
|
63 | + $columns = count( $tab_testimonial['posts'] ); |
|
64 | + } else { |
|
65 | + $columns = 3; |
|
66 | + } |
|
67 | 67 | |
68 | - $post_ids = join( ',', $tab_testimonial['posts'] ); |
|
69 | - $tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]'; |
|
70 | - $tabs[] = $tab_testimonial; |
|
68 | + $post_ids = join( ',', $tab_testimonial['posts'] ); |
|
69 | + $tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]'; |
|
70 | + $tabs[] = $tab_testimonial; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | if ( count( $tabs ) > 0 ) : ?> |
@@ -4,85 +4,85 @@ |
||
4 | 4 | $tabs = array(); |
5 | 5 | |
6 | 6 | // Tab Experience |
7 | -$tab_experience['title'] = esc_html__( 'Experience', 'lsx-team' ); |
|
8 | -$tab_experience['content'] = get_post_meta( get_the_ID(), 'team_member_experience', true ); |
|
7 | +$tab_experience['title'] = esc_html__('Experience', 'lsx-team'); |
|
8 | +$tab_experience['content'] = get_post_meta(get_the_ID(), 'team_member_experience', true); |
|
9 | 9 | $tab_experience['shortcode'] = ''; |
10 | -if ( ! empty( $tab_experience['content'] ) ) { |
|
10 | +if ( ! empty($tab_experience['content'])) { |
|
11 | 11 | $tabs[] = $tab_experience; |
12 | 12 | } |
13 | 13 | |
14 | 14 | // Tab Featured plan |
15 | -$tab_plans['title'] = esc_html__( 'Featured Plans', 'lsx-team' ); |
|
16 | -$tab_plans['posts'] = get_post_meta( get_the_ID(), 'connected_team_member_plan', true ); |
|
15 | +$tab_plans['title'] = esc_html__('Featured Plans', 'lsx-team'); |
|
16 | +$tab_plans['posts'] = get_post_meta(get_the_ID(), 'connected_team_member_plan', true); |
|
17 | 17 | $tab_plans['content'] = ''; |
18 | 18 | $tab_plans['shortcode'] = ''; |
19 | 19 | |
20 | -if ( ! empty( $tab_plans['posts'] ) ) { |
|
20 | +if ( ! empty($tab_plans['posts'])) { |
|
21 | 21 | |
22 | 22 | $plan_content = ''; |
23 | 23 | |
24 | - $include = implode( ',', $tab_plans['posts'] ); |
|
24 | + $include = implode(',', $tab_plans['posts']); |
|
25 | 25 | $args = array( |
26 | 26 | 'orderby' => 'menu_order', |
27 | 27 | 'order' => 'ASC', |
28 | 28 | 'post_type' => 'plan', |
29 | 29 | 'post__in' => $tab_plans['posts'], |
30 | 30 | ); |
31 | - $plan_query = new WP_Query( $args ); |
|
31 | + $plan_query = new WP_Query($args); |
|
32 | 32 | |
33 | 33 | $plan_content = '<div class="all-plans-block plan-grid block-all-plans-block team-member-plans"><div class="row">'; |
34 | 34 | |
35 | - if ( $plan_query->have_posts() ) { |
|
36 | - add_action( 'lsx_sharing_is_disabled', '\lsx_health_plan\functions\triggers\disable_sharing', 10 ); |
|
37 | - while ( $plan_query->have_posts() ) { |
|
35 | + if ($plan_query->have_posts()) { |
|
36 | + add_action('lsx_sharing_is_disabled', '\lsx_health_plan\functions\triggers\disable_sharing', 10); |
|
37 | + while ($plan_query->have_posts()) { |
|
38 | 38 | $plan_query->the_post(); |
39 | 39 | ob_start(); |
40 | 40 | include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-plan.php'; |
41 | 41 | $plan_content .= ob_get_clean(); |
42 | 42 | } |
43 | 43 | wp_reset_postdata(); |
44 | - remove_action( 'lsx_sharing_is_disabled', '\lsx_health_plan\functions\triggers\disable_sharing', 10 ); |
|
44 | + remove_action('lsx_sharing_is_disabled', '\lsx_health_plan\functions\triggers\disable_sharing', 10); |
|
45 | 45 | } |
46 | 46 | $plan_content .= '</div></div>'; |
47 | 47 | |
48 | 48 | $tab_plans['content'] = $plan_content; |
49 | 49 | } |
50 | -if ( ! empty( $tab_plans['content'] ) ) { |
|
50 | +if ( ! empty($tab_plans['content'])) { |
|
51 | 51 | $tabs[] = $tab_plans; |
52 | 52 | } |
53 | 53 | |
54 | 54 | |
55 | 55 | // Tab Testimonials |
56 | 56 | $tab_testimonial['post_type'] = 'testimonial'; |
57 | -$tab_testimonial['title'] = esc_html__( 'Testimonials', 'lsx-team' ); |
|
58 | -$tab_testimonial['posts'] = get_post_meta( get_the_ID(), 'testimonial_to_team', true ); |
|
57 | +$tab_testimonial['title'] = esc_html__('Testimonials', 'lsx-team'); |
|
58 | +$tab_testimonial['posts'] = get_post_meta(get_the_ID(), 'testimonial_to_team', true); |
|
59 | 59 | $tab_testimonial['content'] = ''; |
60 | 60 | |
61 | -if ( is_plugin_active( 'lsx-testimonials/lsx-testimonials.php' ) && ( ! empty( $tab_testimonial['posts'] ) ) ) { |
|
62 | - if ( count( $tab_testimonial['posts'] ) <= 2 ) { |
|
63 | - $columns = count( $tab_testimonial['posts'] ); |
|
61 | +if (is_plugin_active('lsx-testimonials/lsx-testimonials.php') && ( ! empty($tab_testimonial['posts']))) { |
|
62 | + if (count($tab_testimonial['posts']) <= 2) { |
|
63 | + $columns = count($tab_testimonial['posts']); |
|
64 | 64 | } else { |
65 | 65 | $columns = 3; |
66 | 66 | } |
67 | 67 | |
68 | - $post_ids = join( ',', $tab_testimonial['posts'] ); |
|
68 | + $post_ids = join(',', $tab_testimonial['posts']); |
|
69 | 69 | $tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]'; |
70 | 70 | $tabs[] = $tab_testimonial; |
71 | 71 | } |
72 | 72 | |
73 | -if ( count( $tabs ) > 0 ) : ?> |
|
73 | +if (count($tabs) > 0) : ?> |
|
74 | 74 | <div class="entry-tabs hp-entry-tabs"> |
75 | 75 | <ul class="nav nav-tabs"> |
76 | - <?php foreach ( $tabs as $i => $tab ) : ?> |
|
77 | - <li<?php if ( 0 === $i ) echo ' class="active"'; ?>><a data-toggle="tab" href="#<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>"><?php echo esc_html( $tab['title'] ); ?></a></li> |
|
76 | + <?php foreach ($tabs as $i => $tab) : ?> |
|
77 | + <li<?php if (0 === $i) echo ' class="active"'; ?>><a data-toggle="tab" href="#<?php echo esc_attr(sanitize_title($tab['title'])); ?>"><?php echo esc_html($tab['title']); ?></a></li> |
|
78 | 78 | <?php endforeach; ?> |
79 | 79 | </ul> |
80 | 80 | |
81 | 81 | <div class="tab-content"> |
82 | - <?php foreach ( $tabs as $i => $tab ) : ?> |
|
83 | - <div id="<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>" class="tab-pane fade<?php if ( 0 === $i ) echo ' in active'; ?>"> |
|
84 | - <?php echo do_shortcode( $tab['shortcode'] ); ?> |
|
85 | - <?php echo wp_kses_post( $tab['content'] ); ?> |
|
82 | + <?php foreach ($tabs as $i => $tab) : ?> |
|
83 | + <div id="<?php echo esc_attr(sanitize_title($tab['title'])); ?>" class="tab-pane fade<?php if (0 === $i) echo ' in active'; ?>"> |
|
84 | + <?php echo do_shortcode($tab['shortcode']); ?> |
|
85 | + <?php echo wp_kses_post($tab['content']); ?> |
|
86 | 86 | </div> |
87 | 87 | <?php endforeach; ?> |
88 | 88 | </div> |