@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | 'scaling' => 'h', |
64 | 64 | 'enable_tour_ref_column' => '', |
65 | 65 | ); |
66 | - $this->fields = array_keys( $this->defaults ); |
|
67 | - add_action( 'admin_init', array( $this, 'save_options' ) ); |
|
66 | + $this->fields = array_keys($this->defaults); |
|
67 | + add_action('admin_init', array($this, 'save_options')); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public static function get_instance() { |
76 | 76 | // If the single instance hasn't been set, set it now. |
77 | - if ( ! isset( self::$instance ) ) { |
|
77 | + if (!isset(self::$instance)) { |
|
78 | 78 | self::$instance = new self(); |
79 | 79 | } |
80 | 80 | return self::$instance; |
@@ -85,25 +85,25 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function display_page() { |
87 | 87 | $options = lsx_wetu_get_options(); |
88 | - foreach ( $options as $key => $value ) { |
|
89 | - $value = trim( $value ); |
|
88 | + foreach ($options as $key => $value) { |
|
89 | + $value = trim($value); |
|
90 | 90 | } |
91 | - $options = wp_parse_args( $options, $this->defaults ); |
|
91 | + $options = wp_parse_args($options, $this->defaults); |
|
92 | 92 | ?> |
93 | 93 | <div class="wrap"> |
94 | 94 | <form method="post" class=""> |
95 | - <?php wp_nonce_field( 'lsx_wetu_importer_save', 'lsx_wetu_importer_save_options' ); ?> |
|
96 | - <h1><?php esc_html_e( 'General', 'lsx-wetu-importer' ); ?></h1> |
|
95 | + <?php wp_nonce_field('lsx_wetu_importer_save', 'lsx_wetu_importer_save_options'); ?> |
|
96 | + <h1><?php esc_html_e('General', 'lsx-wetu-importer'); ?></h1> |
|
97 | 97 | <table class="form-table"> |
98 | 98 | <tbody> |
99 | 99 | <tr class="form-field"> |
100 | 100 | <th scope="row"> |
101 | - <label for="wetu_api_key"> <?php esc_html_e( 'API Key', 'lsx-wetu-importer' ); ?></label> |
|
101 | + <label for="wetu_api_key"> <?php esc_html_e('API Key', 'lsx-wetu-importer'); ?></label> |
|
102 | 102 | </th> |
103 | 103 | <td> |
104 | 104 | <input data-toggle="tooltip" data-placement="top" title="The API key can be found on your My Account page of your WETU account." type="text" value="<?php |
105 | - if ( isset( $options['api_key'] ) ) { |
|
106 | - echo esc_attr( $options['api_key'] ); |
|
105 | + if (isset($options['api_key'])) { |
|
106 | + echo esc_attr($options['api_key']); |
|
107 | 107 | } |
108 | 108 | ?>" name="api_key" /> |
109 | 109 | <button type="button" onclick="return false;" title="The API key can be found on your My Account page of your WETU account." id="doc-tooltip" class="dashicons dashicons-editor-help tooltip"> |
@@ -114,226 +114,226 @@ discard block |
||
114 | 114 | </tbody> |
115 | 115 | </table> |
116 | 116 | |
117 | - <h1><?php esc_html_e( 'Tours', 'lsx-wetu-importer' ); ?></h1> |
|
117 | + <h1><?php esc_html_e('Tours', 'lsx-wetu-importer'); ?></h1> |
|
118 | 118 | <table class="form-table"> |
119 | 119 | <tbody> |
120 | 120 | <tr class="form-field -wrap"> |
121 | 121 | <th scope="row"> |
122 | - <label for="disable_tour_title"><?php esc_html_e( 'Enable Custom Titles', 'lsx-wetu-importer' ); ?></label> |
|
122 | + <label for="disable_tour_title"><?php esc_html_e('Enable Custom Titles', 'lsx-wetu-importer'); ?></label> |
|
123 | 123 | </th> |
124 | 124 | <td> |
125 | 125 | <input type="checkbox" |
126 | 126 | <?php |
127 | - if ( isset( $options['disable_tour_title'] ) && '' !== $options['disable_tour_title'] ) { |
|
128 | - echo esc_attr( 'checked="checked"' ); |
|
127 | + if (isset($options['disable_tour_title']) && '' !== $options['disable_tour_title']) { |
|
128 | + echo esc_attr('checked="checked"'); |
|
129 | 129 | } |
130 | 130 | ?> |
131 | 131 | name="disable_tour_title" /> |
132 | 132 | |
133 | - <small><?php esc_html_e( 'If you are going to manage your tour descriptions on this site and not on WETU then enable this setting.', 'lsx-wetu-importer' ); ?></small> |
|
133 | + <small><?php esc_html_e('If you are going to manage your tour descriptions on this site and not on WETU then enable this setting.', 'lsx-wetu-importer'); ?></small> |
|
134 | 134 | </td> |
135 | 135 | </tr> |
136 | 136 | <tr class="form-field -wrap"> |
137 | 137 | <th scope="row"> |
138 | - <label for="disable_tour_descriptions"><?php esc_html_e( 'Disable Descriptions', 'lsx-wetu-importer' ); ?></label> |
|
138 | + <label for="disable_tour_descriptions"><?php esc_html_e('Disable Descriptions', 'lsx-wetu-importer'); ?></label> |
|
139 | 139 | </th> |
140 | 140 | <td> |
141 | 141 | <input type="checkbox" |
142 | 142 | <?php |
143 | - if ( isset( $options['disable_tour_descriptions'] ) && '' !== $options['disable_tour_descriptions'] ) { |
|
144 | - echo esc_attr( 'checked="checked"' ); |
|
143 | + if (isset($options['disable_tour_descriptions']) && '' !== $options['disable_tour_descriptions']) { |
|
144 | + echo esc_attr('checked="checked"'); |
|
145 | 145 | } |
146 | 146 | ?> |
147 | 147 | name="disable_tour_descriptions" /> |
148 | 148 | |
149 | - <small><?php esc_html_e( 'If you are going to manage your tour descriptions on this site and not on WETU then enable this setting.', 'lsx-wetu-importer' ); ?></small> |
|
149 | + <small><?php esc_html_e('If you are going to manage your tour descriptions on this site and not on WETU then enable this setting.', 'lsx-wetu-importer'); ?></small> |
|
150 | 150 | </td> |
151 | 151 | </tr> |
152 | 152 | <tr class="form-field -wrap"> |
153 | 153 | <th scope="row"> |
154 | - <label for="disable_tour_tags"><?php esc_html_e( 'Disable Tags / Travel Styles', 'lsx-wetu-importer' ); ?></label> |
|
154 | + <label for="disable_tour_tags"><?php esc_html_e('Disable Tags / Travel Styles', 'lsx-wetu-importer'); ?></label> |
|
155 | 155 | </th> |
156 | 156 | <td> |
157 | 157 | <input type="checkbox" |
158 | 158 | <?php |
159 | - if ( isset( $options['disable_tour_tags'] ) && '' !== $options['disable_tour_tags'] ) { |
|
160 | - echo esc_attr( 'checked="checked"' ); |
|
159 | + if (isset($options['disable_tour_tags']) && '' !== $options['disable_tour_tags']) { |
|
160 | + echo esc_attr('checked="checked"'); |
|
161 | 161 | } |
162 | 162 | ?> |
163 | 163 | name="disable_tour_tags" /> |
164 | 164 | |
165 | - <small><?php esc_html_e( 'Disable this is you dont want the option available on the import screen.', 'lsx-wetu-importer' ); ?></small> |
|
165 | + <small><?php esc_html_e('Disable this is you dont want the option available on the import screen.', 'lsx-wetu-importer'); ?></small> |
|
166 | 166 | </td> |
167 | 167 | </tr> |
168 | 168 | |
169 | 169 | <tr class="form-field -wrap"> |
170 | 170 | <th scope="row"> |
171 | - <label for="enable_tour_ref_column"><?php esc_html_e( 'Enable Reference Column', 'lsx-wetu-importer' ); ?></label> |
|
171 | + <label for="enable_tour_ref_column"><?php esc_html_e('Enable Reference Column', 'lsx-wetu-importer'); ?></label> |
|
172 | 172 | </th> |
173 | 173 | <td> |
174 | 174 | <input type="checkbox" |
175 | 175 | <?php |
176 | - if ( isset( $options['enable_tour_ref_column'] ) && '' !== $options['enable_tour_ref_column'] ) { |
|
177 | - echo esc_attr( 'checked="checked"' ); |
|
176 | + if (isset($options['enable_tour_ref_column']) && '' !== $options['enable_tour_ref_column']) { |
|
177 | + echo esc_attr('checked="checked"'); |
|
178 | 178 | } |
179 | 179 | ?> |
180 | 180 | name="enable_tour_ref_column" /> |
181 | - <small><?php esc_html_e( 'Enables the use of the WETU Reference Column for better tours management.', 'lsx-wetu-importer' ); ?></small> |
|
181 | + <small><?php esc_html_e('Enables the use of the WETU Reference Column for better tours management.', 'lsx-wetu-importer'); ?></small> |
|
182 | 182 | </td> |
183 | 183 | </tr> |
184 | 184 | |
185 | 185 | <tr class="form-field -wrap"> |
186 | 186 | <th scope="row"> |
187 | - <label for="enable_tour_featured_random"><?php esc_html_e( 'Randomize Featured Image', 'lsx-wetu-importer' ); ?></label> |
|
187 | + <label for="enable_tour_featured_random"><?php esc_html_e('Randomize Featured Image', 'lsx-wetu-importer'); ?></label> |
|
188 | 188 | </th> |
189 | 189 | <td> |
190 | 190 | <input type="checkbox" |
191 | 191 | <?php |
192 | - if ( isset( $options['enable_tour_featured_random'] ) && '' !== $options['enable_tour_featured_random'] ) { |
|
193 | - echo esc_attr( 'checked="checked"' ); |
|
192 | + if (isset($options['enable_tour_featured_random']) && '' !== $options['enable_tour_featured_random']) { |
|
193 | + echo esc_attr('checked="checked"'); |
|
194 | 194 | } |
195 | 195 | ?> |
196 | 196 | name="enable_tour_featured_random" /> |
197 | - <small><?php esc_html_e( 'This will randomize the featured image from the destination gallery.', 'lsx-wetu-importer' ); ?></small> |
|
197 | + <small><?php esc_html_e('This will randomize the featured image from the destination gallery.', 'lsx-wetu-importer'); ?></small> |
|
198 | 198 | </td> |
199 | 199 | </tr> |
200 | 200 | </tbody> |
201 | 201 | </table> |
202 | 202 | |
203 | - <h1><?php esc_html_e( 'Accommodation', 'lsx-wetu-importer' ); ?></h1> |
|
203 | + <h1><?php esc_html_e('Accommodation', 'lsx-wetu-importer'); ?></h1> |
|
204 | 204 | |
205 | 205 | <table class="form-table"> |
206 | 206 | <tbody> |
207 | 207 | <tr class="form-field -wrap"> |
208 | 208 | <th scope="row"> |
209 | - <label for="disable_accommodation_title"><?php esc_html_e( 'Enable Custom Titles', 'lsx-wetu-importer' ); ?></label> |
|
209 | + <label for="disable_accommodation_title"><?php esc_html_e('Enable Custom Titles', 'lsx-wetu-importer'); ?></label> |
|
210 | 210 | </th> |
211 | 211 | <td> |
212 | 212 | <input type="checkbox" |
213 | 213 | <?php |
214 | - if ( isset( $options['disable_accommodation_title'] ) && '' !== $options['disable_accommodation_title'] ) { |
|
215 | - echo esc_attr( 'checked="checked"' ); |
|
214 | + if (isset($options['disable_accommodation_title']) && '' !== $options['disable_accommodation_title']) { |
|
215 | + echo esc_attr('checked="checked"'); |
|
216 | 216 | } |
217 | 217 | ?> |
218 | 218 | name="disable_accommodation_title" /> |
219 | 219 | |
220 | - <small><?php esc_html_e( 'If you are going to manage your tour descriptions on this site and not on WETU then enable this setting.', 'lsx-wetu-importer' ); ?></small> |
|
220 | + <small><?php esc_html_e('If you are going to manage your tour descriptions on this site and not on WETU then enable this setting.', 'lsx-wetu-importer'); ?></small> |
|
221 | 221 | </td> |
222 | 222 | </tr> |
223 | 223 | <tr class="form-field -wrap"> |
224 | 224 | <th scope="row"> |
225 | - <label for="disable_accommodation_descriptions"><?php esc_html_e( 'Disable Descriptions', 'lsx-wetu-importer' ); ?></label> |
|
225 | + <label for="disable_accommodation_descriptions"><?php esc_html_e('Disable Descriptions', 'lsx-wetu-importer'); ?></label> |
|
226 | 226 | </th> |
227 | 227 | <td> |
228 | 228 | <input type="checkbox" |
229 | 229 | <?php |
230 | - if ( isset( $options['disable_accommodation_descriptions'] ) && '' !== $options['disable_accommodation_descriptions'] ) { |
|
231 | - echo esc_attr( 'checked="checked"' ); |
|
230 | + if (isset($options['disable_accommodation_descriptions']) && '' !== $options['disable_accommodation_descriptions']) { |
|
231 | + echo esc_attr('checked="checked"'); |
|
232 | 232 | } |
233 | 233 | ?> |
234 | 234 | name="disable_accommodation_descriptions" /> |
235 | - <small><?php esc_html_e( 'If you are going to edit the accommodation descriptions imported then enable this setting.', 'lsx-wetu-importer' ); ?></small> |
|
235 | + <small><?php esc_html_e('If you are going to edit the accommodation descriptions imported then enable this setting.', 'lsx-wetu-importer'); ?></small> |
|
236 | 236 | </td> |
237 | 237 | </tr> |
238 | 238 | <tr class="form-field -wrap"> |
239 | 239 | <th scope="row"> |
240 | - <label for="disable_accommodation_filtering"><?php esc_html_e( 'Disable Description Filtering', 'lsx-wetu-importer' ); ?></label> |
|
240 | + <label for="disable_accommodation_filtering"><?php esc_html_e('Disable Description Filtering', 'lsx-wetu-importer'); ?></label> |
|
241 | 241 | </th> |
242 | 242 | <td> |
243 | 243 | <input type="checkbox" |
244 | 244 | <?php |
245 | - if ( isset( $options['disable_accommodation_filtering'] ) && '' !== $options['disable_accommodation_filtering'] ) { |
|
246 | - echo esc_attr( 'checked="checked"' ); |
|
245 | + if (isset($options['disable_accommodation_filtering']) && '' !== $options['disable_accommodation_filtering']) { |
|
246 | + echo esc_attr('checked="checked"'); |
|
247 | 247 | } |
248 | 248 | ?> |
249 | 249 | name="disable_accommodation_filtering" /> |
250 | - <small><?php esc_html_e( 'This will stop the HTML from being stripped out of the description.', 'lsx-wetu-importer' ); ?></small> |
|
250 | + <small><?php esc_html_e('This will stop the HTML from being stripped out of the description.', 'lsx-wetu-importer'); ?></small> |
|
251 | 251 | </td> |
252 | 252 | </tr> |
253 | 253 | |
254 | 254 | <tr class="form-field -wrap"> |
255 | 255 | <th scope="row"> |
256 | - <label for="disable_accommodation_excerpts"><?php esc_html_e( 'Disable Excerpts', 'lsx-wetu-importer' ); ?></label> |
|
256 | + <label for="disable_accommodation_excerpts"><?php esc_html_e('Disable Excerpts', 'lsx-wetu-importer'); ?></label> |
|
257 | 257 | </th> |
258 | 258 | <td> |
259 | 259 | <input type="checkbox" |
260 | 260 | <?php |
261 | - if ( isset( $options['disable_accommodation_excerpts'] ) && '' !== $options['disable_accommodation_excerpts'] ) { |
|
262 | - echo esc_attr( 'checked="checked"' ); |
|
261 | + if (isset($options['disable_accommodation_excerpts']) && '' !== $options['disable_accommodation_excerpts']) { |
|
262 | + echo esc_attr('checked="checked"'); |
|
263 | 263 | } |
264 | 264 | ?> |
265 | 265 | name="disable_accommodation_excerpts" /> |
266 | - <small><?php esc_html_e( 'If you are going to edit the accommodation excerpts then enable this setting.', 'lsx-wetu-importer' ); ?></small> |
|
266 | + <small><?php esc_html_e('If you are going to edit the accommodation excerpts then enable this setting.', 'lsx-wetu-importer'); ?></small> |
|
267 | 267 | </td> |
268 | 268 | </tr> |
269 | 269 | </tbody> |
270 | 270 | </table> |
271 | 271 | |
272 | - <h1><?php esc_html_e( 'Destinations', 'lsx-wetu-importer' ); ?></h1> |
|
272 | + <h1><?php esc_html_e('Destinations', 'lsx-wetu-importer'); ?></h1> |
|
273 | 273 | |
274 | 274 | <table class="form-table"> |
275 | 275 | <tbody> |
276 | 276 | <tr class="form-field -wrap"> |
277 | 277 | <th scope="row"> |
278 | - <label for="disable_destination_title"><?php esc_html_e( 'Enable Custom Titles', 'lsx-wetu-importer' ); ?></label> |
|
278 | + <label for="disable_destination_title"><?php esc_html_e('Enable Custom Titles', 'lsx-wetu-importer'); ?></label> |
|
279 | 279 | </th> |
280 | 280 | <td> |
281 | 281 | <input type="checkbox" |
282 | 282 | <?php |
283 | - if ( isset( $options['disable_destination_title'] ) && '' !== $options['disable_destination_title'] ) { |
|
284 | - echo esc_attr( 'checked="checked"' ); |
|
283 | + if (isset($options['disable_destination_title']) && '' !== $options['disable_destination_title']) { |
|
284 | + echo esc_attr('checked="checked"'); |
|
285 | 285 | } |
286 | 286 | ?> |
287 | 287 | name="disable_destination_title" /> |
288 | 288 | |
289 | - <small><?php esc_html_e( 'If you are going to manage your tour descriptions on this site and not on WETU then enable this setting.', 'lsx-wetu-importer' ); ?></small> |
|
289 | + <small><?php esc_html_e('If you are going to manage your tour descriptions on this site and not on WETU then enable this setting.', 'lsx-wetu-importer'); ?></small> |
|
290 | 290 | </td> |
291 | 291 | </tr> |
292 | 292 | <tr class="form-field -wrap"> |
293 | 293 | <th scope="row"> |
294 | - <label for="disable_destination_descriptions"><?php esc_html_e( 'Disable Descriptions', 'lsx-wetu-importer' ); ?></label> |
|
294 | + <label for="disable_destination_descriptions"><?php esc_html_e('Disable Descriptions', 'lsx-wetu-importer'); ?></label> |
|
295 | 295 | </th> |
296 | 296 | <td> |
297 | 297 | <input type="checkbox" |
298 | 298 | <?php |
299 | - if ( isset( $options['disable_destination_descriptions'] ) && '' !== $options['disable_destination_descriptions'] ) { |
|
300 | - echo esc_attr( 'checked="checked"' ); |
|
299 | + if (isset($options['disable_destination_descriptions']) && '' !== $options['disable_destination_descriptions']) { |
|
300 | + echo esc_attr('checked="checked"'); |
|
301 | 301 | } |
302 | 302 | ?> |
303 | 303 | name="disable_destination_descriptions" /> |
304 | - <small><?php esc_html_e( 'If you are going to edit the destination descriptions on this site then enable this setting.', 'lsx-wetu-importer' ); ?></small> |
|
304 | + <small><?php esc_html_e('If you are going to edit the destination descriptions on this site then enable this setting.', 'lsx-wetu-importer'); ?></small> |
|
305 | 305 | </td> |
306 | 306 | </tr> |
307 | 307 | </tbody> |
308 | 308 | </table> |
309 | 309 | |
310 | - <h1><?php esc_html_e( 'Images', 'lsx-wetu-importer' ); ?></h1> |
|
310 | + <h1><?php esc_html_e('Images', 'lsx-wetu-importer'); ?></h1> |
|
311 | 311 | |
312 | 312 | <table class="form-table"> |
313 | 313 | <tbody> |
314 | 314 | <tr class="form-field -wrap"> |
315 | 315 | <th scope="row"> |
316 | - <label for="image_replacing"><?php esc_html_e( 'Replace Images', 'lsx-wetu-importer' ); ?></label> |
|
316 | + <label for="image_replacing"><?php esc_html_e('Replace Images', 'lsx-wetu-importer'); ?></label> |
|
317 | 317 | </th> |
318 | 318 | <td> |
319 | 319 | <input type="checkbox" |
320 | 320 | <?php |
321 | - if ( isset( $options['image_replacing'] ) && '' !== $options['image_replacing'] ) { |
|
322 | - echo esc_attr( 'checked="checked"' ); |
|
321 | + if (isset($options['image_replacing']) && '' !== $options['image_replacing']) { |
|
322 | + echo esc_attr('checked="checked"'); |
|
323 | 323 | } |
324 | 324 | ?> |
325 | 325 | name="image_replacing" /> |
326 | - <p><?php esc_html_e( 'Do you want your images to be replaced on each import.', 'lsx-wetu-importer' ); ?></p> |
|
326 | + <p><?php esc_html_e('Do you want your images to be replaced on each import.', 'lsx-wetu-importer'); ?></p> |
|
327 | 327 | </td> |
328 | 328 | </tr> |
329 | 329 | <tr class="form-field -wrap"> |
330 | 330 | <th scope="row"> |
331 | - <label for="image_limit"> <?php esc_html_e( 'Limit the amount of images imported to the gallery', 'lsx-wetu-importer' ); ?></label> |
|
331 | + <label for="image_limit"> <?php esc_html_e('Limit the amount of images imported to the gallery', 'lsx-wetu-importer'); ?></label> |
|
332 | 332 | </th> |
333 | 333 | <td> |
334 | 334 | <input placeholder="" type="text" value="<?php |
335 | - if ( isset( $options['image_limit'] ) && '' !== $options['image_limit'] ) { |
|
336 | - echo esc_attr( $options['image_limit'] ); |
|
335 | + if (isset($options['image_limit']) && '' !== $options['image_limit']) { |
|
336 | + echo esc_attr($options['image_limit']); |
|
337 | 337 | } |
338 | 338 | ?>" |
339 | 339 | name="image_limit" /> |
@@ -342,13 +342,13 @@ discard block |
||
342 | 342 | |
343 | 343 | <tr class="form-field -wrap"> |
344 | 344 | <th scope="row"> |
345 | - <label for="image_scaling"><?php esc_html_e( 'Enable Image Scaling', 'lsx-wetu-importer' ); ?></label> |
|
345 | + <label for="image_scaling"><?php esc_html_e('Enable Image Scaling', 'lsx-wetu-importer'); ?></label> |
|
346 | 346 | </th> |
347 | 347 | <td> |
348 | 348 | <input type="checkbox" |
349 | 349 | <?php |
350 | - if ( isset( $options['image_scaling'] ) && '' !== $options['image_scaling'] ) { |
|
351 | - echo esc_attr( 'checked="checked"' ); |
|
350 | + if (isset($options['image_scaling']) && '' !== $options['image_scaling']) { |
|
351 | + echo esc_attr('checked="checked"'); |
|
352 | 352 | } |
353 | 353 | ?> |
354 | 354 | name="image_scaling" /> |
@@ -356,12 +356,12 @@ discard block |
||
356 | 356 | </tr> |
357 | 357 | <tr class="form-field -wrap"> |
358 | 358 | <th scope="row"> |
359 | - <label for="width"> <?php esc_html_e( 'Width (px)', 'lsx-wetu-importer' ); ?></label> |
|
359 | + <label for="width"> <?php esc_html_e('Width (px)', 'lsx-wetu-importer'); ?></label> |
|
360 | 360 | </th> |
361 | 361 | <td> |
362 | 362 | <input placeholder="800" type="text" value="<?php |
363 | - if ( isset( $options['width'] ) && '' !== $options['width'] ) { |
|
364 | - echo esc_attr( $options['width'] ); |
|
363 | + if (isset($options['width']) && '' !== $options['width']) { |
|
364 | + echo esc_attr($options['width']); |
|
365 | 365 | } |
366 | 366 | ?>" |
367 | 367 | name="width" /> |
@@ -369,12 +369,12 @@ discard block |
||
369 | 369 | </tr> |
370 | 370 | <tr class="form-field -wrap"> |
371 | 371 | <th scope="row"> |
372 | - <label for="height"> <?php esc_html_e( 'Height (px)', 'lsx-wetu-importer' ); ?></label> |
|
372 | + <label for="height"> <?php esc_html_e('Height (px)', 'lsx-wetu-importer'); ?></label> |
|
373 | 373 | </th> |
374 | 374 | <td> |
375 | 375 | <input placeholder="600" type="text" value="<?php |
376 | - if ( isset( $options['height'] ) && '' !== $options['height'] ) { |
|
377 | - echo esc_attr( $options['height'] ); |
|
376 | + if (isset($options['height']) && '' !== $options['height']) { |
|
377 | + echo esc_attr($options['height']); |
|
378 | 378 | } |
379 | 379 | ?>" |
380 | 380 | name="height" /> |
@@ -383,63 +383,63 @@ discard block |
||
383 | 383 | |
384 | 384 | <tr class="form-field -wrap image-settings"> |
385 | 385 | <th scope="row"> |
386 | - <label for="scaling"> <?php esc_html_e( 'Scaling', 'lsx-wetu-importer' ); ?></label> |
|
386 | + <label for="scaling"> <?php esc_html_e('Scaling', 'lsx-wetu-importer'); ?></label> |
|
387 | 387 | </th> |
388 | 388 | <td> |
389 | 389 | <input type="radio" |
390 | 390 | <?php |
391 | - if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'raw' === $options['scaling'] ) { |
|
392 | - echo esc_attr( 'checked="checked"' ); |
|
391 | + if (isset($options['scaling']) && '' !== $options['scaling'] && 'raw' === $options['scaling']) { |
|
392 | + echo esc_attr('checked="checked"'); |
|
393 | 393 | } |
394 | 394 | ?> |
395 | - name="scaling" value="raw" /> <?php esc_html_e( 'Get the Full size image, no cropping takes place.', 'lsx-wetu-importer' ); ?><br /> |
|
395 | + name="scaling" value="raw" /> <?php esc_html_e('Get the Full size image, no cropping takes place.', 'lsx-wetu-importer'); ?><br /> |
|
396 | 396 | <input type="radio" |
397 | 397 | <?php |
398 | - if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'c' === $options['scaling'] ) { |
|
399 | - echo esc_attr( 'checked="checked"' ); |
|
398 | + if (isset($options['scaling']) && '' !== $options['scaling'] && 'c' === $options['scaling']) { |
|
399 | + echo esc_attr('checked="checked"'); |
|
400 | 400 | } |
401 | 401 | ?> |
402 | - name="scaling" value="c" /> <?php esc_html_e( 'Crop image to fit fully into the frame, Crop is taken from middle, preserving as much of the image as possible.', 'lsx-wetu-importer' ); ?><br /> |
|
402 | + name="scaling" value="c" /> <?php esc_html_e('Crop image to fit fully into the frame, Crop is taken from middle, preserving as much of the image as possible.', 'lsx-wetu-importer'); ?><br /> |
|
403 | 403 | <input type="radio" |
404 | 404 | <?php |
405 | - if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'h' === $options['scaling'] ) { |
|
406 | - echo esc_attr( 'checked="checked"' ); |
|
405 | + if (isset($options['scaling']) && '' !== $options['scaling'] && 'h' === $options['scaling']) { |
|
406 | + echo esc_attr('checked="checked"'); |
|
407 | 407 | } |
408 | 408 | ?> |
409 | - name="scaling" value="h" /> <?php esc_html_e( 'Crop image to fit fully into the frame, but resize to height first, then crop on width if needed', 'lsx-wetu-importer' ); ?><br /> |
|
409 | + name="scaling" value="h" /> <?php esc_html_e('Crop image to fit fully into the frame, but resize to height first, then crop on width if needed', 'lsx-wetu-importer'); ?><br /> |
|
410 | 410 | <input type="radio" |
411 | 411 | <?php |
412 | - if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'w' === $options['scaling'] ) { |
|
413 | - echo esc_attr( 'checked="checked"' ); |
|
412 | + if (isset($options['scaling']) && '' !== $options['scaling'] && 'w' === $options['scaling']) { |
|
413 | + echo esc_attr('checked="checked"'); |
|
414 | 414 | } |
415 | 415 | ?> |
416 | - name="scaling" value="w" /> <?php esc_html_e( 'Crop image to fit fully into the frame, but resize to width first, then crop on height if needed', 'lsx-wetu-importer' ); ?><br /> |
|
416 | + name="scaling" value="w" /> <?php esc_html_e('Crop image to fit fully into the frame, but resize to width first, then crop on height if needed', 'lsx-wetu-importer'); ?><br /> |
|
417 | 417 | <input type="radio" |
418 | 418 | <?php |
419 | - if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'nf' === $options['scaling'] ) { |
|
420 | - echo esc_attr( 'checked="checked"' ); |
|
419 | + if (isset($options['scaling']) && '' !== $options['scaling'] && 'nf' === $options['scaling']) { |
|
420 | + echo esc_attr('checked="checked"'); |
|
421 | 421 | } |
422 | 422 | ?> |
423 | - name="scaling" value="nf" /> <?php esc_html_e( 'Resize the image to fit within the frame. but pad the image with white to ensure the resolution matches the frame', 'lsx-wetu-importer' ); ?><br /> |
|
423 | + name="scaling" value="nf" /> <?php esc_html_e('Resize the image to fit within the frame. but pad the image with white to ensure the resolution matches the frame', 'lsx-wetu-importer'); ?><br /> |
|
424 | 424 | <input type="radio" |
425 | 425 | <?php |
426 | - if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'n' === $options['scaling'] ) { |
|
427 | - echo esc_attr( 'checked="checked"' ); |
|
426 | + if (isset($options['scaling']) && '' !== $options['scaling'] && 'n' === $options['scaling']) { |
|
427 | + echo esc_attr('checked="checked"'); |
|
428 | 428 | } |
429 | 429 | ?> |
430 | - name="scaling" value="n" /> <?php esc_html_e( 'Resize the image to fit within the frame. but do not upscale the image.', 'lsx-wetu-importer' ); ?><br /> |
|
430 | + name="scaling" value="n" /> <?php esc_html_e('Resize the image to fit within the frame. but do not upscale the image.', 'lsx-wetu-importer'); ?><br /> |
|
431 | 431 | <input type="radio" |
432 | 432 | <?php |
433 | - if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'W' === $options['scaling'] ) { |
|
434 | - echo esc_attr( 'checked="checked"' ); |
|
433 | + if (isset($options['scaling']) && '' !== $options['scaling'] && 'W' === $options['scaling']) { |
|
434 | + echo esc_attr('checked="checked"'); |
|
435 | 435 | } |
436 | 436 | ?> |
437 | - name="scaling" value="W" /> <?php esc_html_e( 'Resize the image to fit within the frame. Image will not exceed specified dimensions', 'lsx-wetu-importer' ); ?> |
|
437 | + name="scaling" value="W" /> <?php esc_html_e('Resize the image to fit within the frame. Image will not exceed specified dimensions', 'lsx-wetu-importer'); ?> |
|
438 | 438 | </td> |
439 | 439 | </tr> |
440 | 440 | </tbody> |
441 | 441 | </table> |
442 | - <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="<?php esc_html_e( 'Save Changes', 'lsx-wetu-importer' ); ?>"></p> |
|
442 | + <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="<?php esc_html_e('Save Changes', 'lsx-wetu-importer'); ?>"></p> |
|
443 | 443 | </form> |
444 | 444 | </div> |
445 | 445 | <?php |
@@ -451,17 +451,17 @@ discard block |
||
451 | 451 | * @return void |
452 | 452 | */ |
453 | 453 | public function save_options() { |
454 | - if ( ! isset( $_POST['lsx_wetu_importer_save_options'] ) || ! wp_verify_nonce( $_POST['lsx_wetu_importer_save_options'], 'lsx_wetu_importer_save' ) ) { |
|
454 | + if (!isset($_POST['lsx_wetu_importer_save_options']) || !wp_verify_nonce($_POST['lsx_wetu_importer_save_options'], 'lsx_wetu_importer_save')) { |
|
455 | 455 | return; |
456 | 456 | } |
457 | 457 | $data_to_save = array(); |
458 | - foreach ( $this->defaults as $key => $field ) { |
|
459 | - if ( isset( $_POST[ $key ] ) ) { |
|
460 | - $data_to_save[ $key ] = sanitize_text_field( $_POST[ $key ] ); |
|
461 | - } else { |
|
462 | - $data_to_save[ $key ] = ''; |
|
458 | + foreach ($this->defaults as $key => $field) { |
|
459 | + if (isset($_POST[$key])) { |
|
460 | + $data_to_save[$key] = sanitize_text_field($_POST[$key]); |
|
461 | + }else { |
|
462 | + $data_to_save[$key] = ''; |
|
463 | 463 | } |
464 | 464 | } |
465 | - update_option( 'lsx_wetu_importer_settings', $data_to_save ); |
|
465 | + update_option('lsx_wetu_importer_settings', $data_to_save); |
|
466 | 466 | } |
467 | 467 | } |