@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | 'scaling' => 'h', |
60 | 60 | 'enable_tour_ref_column' => '', |
61 | 61 | ); |
62 | - $this->fields = array_keys( $this->defaults ); |
|
63 | - add_action( 'admin_init', array( $this, 'save_options' ) ); |
|
62 | + $this->fields = array_keys($this->defaults); |
|
63 | + add_action('admin_init', array($this, 'save_options')); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public static function get_instance() { |
72 | 72 | // If the single instance hasn't been set, set it now. |
73 | - if ( ! isset( self::$instance ) ) { |
|
73 | + if (!isset(self::$instance)) { |
|
74 | 74 | self::$instance = new self(); |
75 | 75 | } |
76 | 76 | return self::$instance; |
@@ -81,25 +81,25 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function display_page() { |
83 | 83 | $options = lsx_wetu_get_options(); |
84 | - foreach ( $options as $key => $value ) { |
|
85 | - $value = trim( $value ); |
|
84 | + foreach ($options as $key => $value) { |
|
85 | + $value = trim($value); |
|
86 | 86 | } |
87 | - $options = wp_parse_args( $options, $this->defaults ); |
|
87 | + $options = wp_parse_args($options, $this->defaults); |
|
88 | 88 | ?> |
89 | 89 | <div class="wrap"> |
90 | 90 | <form method="post" class=""> |
91 | - <?php wp_nonce_field( 'lsx_wetu_importer_save', 'lsx_wetu_importer_save_options' ); ?> |
|
92 | - <h1><?php esc_html_e( 'General', 'lsx-wetu-importer' ); ?></h1> |
|
91 | + <?php wp_nonce_field('lsx_wetu_importer_save', 'lsx_wetu_importer_save_options'); ?> |
|
92 | + <h1><?php esc_html_e('General', 'lsx-wetu-importer'); ?></h1> |
|
93 | 93 | <table class="form-table"> |
94 | 94 | <tbody> |
95 | 95 | <tr class="form-field"> |
96 | 96 | <th scope="row"> |
97 | - <label for="wetu_api_key"> <?php esc_html_e( 'API Key', 'lsx-wetu-importer' ); ?></label> |
|
97 | + <label for="wetu_api_key"> <?php esc_html_e('API Key', 'lsx-wetu-importer'); ?></label> |
|
98 | 98 | </th> |
99 | 99 | <td> |
100 | 100 | <input type="text" value="<?php |
101 | - if ( isset( $options['api_key'] ) ) { |
|
102 | - echo esc_attr( $options['api_key'] ); |
|
101 | + if (isset($options['api_key'])) { |
|
102 | + echo esc_attr($options['api_key']); |
|
103 | 103 | } |
104 | 104 | ?>" name="api_key" /> |
105 | 105 | </td> |
@@ -107,162 +107,162 @@ discard block |
||
107 | 107 | </tbody> |
108 | 108 | </table> |
109 | 109 | |
110 | - <h1><?php esc_html_e( 'Tours', 'lsx-wetu-importer' ); ?></h1> |
|
110 | + <h1><?php esc_html_e('Tours', 'lsx-wetu-importer'); ?></h1> |
|
111 | 111 | <table class="form-table"> |
112 | 112 | <tbody> |
113 | 113 | <tr class="form-field -wrap"> |
114 | 114 | <th scope="row"> |
115 | - <label for="disable_tour_title"><?php esc_html_e( 'Enable Custom Titles', 'lsx-wetu-importer' ); ?></label> |
|
115 | + <label for="disable_tour_title"><?php esc_html_e('Enable Custom Titles', 'lsx-wetu-importer'); ?></label> |
|
116 | 116 | </th> |
117 | 117 | <td> |
118 | 118 | <input type="checkbox" |
119 | 119 | <?php |
120 | - if ( isset( $options['disable_tour_title'] ) && '' !== $options['disable_tour_title'] ) { |
|
121 | - echo esc_attr( 'checked="checked"' ); |
|
120 | + if (isset($options['disable_tour_title']) && '' !== $options['disable_tour_title']) { |
|
121 | + echo esc_attr('checked="checked"'); |
|
122 | 122 | } |
123 | 123 | ?> |
124 | 124 | name="disable_tour_title" /> |
125 | 125 | |
126 | - <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> |
|
126 | + <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> |
|
127 | 127 | </td> |
128 | 128 | </tr> |
129 | 129 | <tr class="form-field -wrap"> |
130 | 130 | <th scope="row"> |
131 | - <label for="disable_tour_descriptions"><?php esc_html_e( 'Disable Descriptions', 'lsx-wetu-importer' ); ?></label> |
|
131 | + <label for="disable_tour_descriptions"><?php esc_html_e('Disable Descriptions', 'lsx-wetu-importer'); ?></label> |
|
132 | 132 | </th> |
133 | 133 | <td> |
134 | 134 | <input type="checkbox" |
135 | 135 | <?php |
136 | - if ( isset( $options['disable_tour_descriptions'] ) && '' !== $options['disable_tour_descriptions'] ) { |
|
137 | - echo esc_attr( 'checked="checked"' ); |
|
136 | + if (isset($options['disable_tour_descriptions']) && '' !== $options['disable_tour_descriptions']) { |
|
137 | + echo esc_attr('checked="checked"'); |
|
138 | 138 | } |
139 | 139 | ?> |
140 | 140 | name="disable_tour_descriptions" /> |
141 | 141 | |
142 | - <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> |
|
142 | + <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> |
|
143 | 143 | </td> |
144 | 144 | </tr> |
145 | 145 | <tr class="form-field -wrap"> |
146 | 146 | <th scope="row"> |
147 | - <label for="disable_tour_tags"><?php esc_html_e( 'Disable Tags / Travel Styles', 'lsx-wetu-importer' ); ?></label> |
|
147 | + <label for="disable_tour_tags"><?php esc_html_e('Disable Tags / Travel Styles', 'lsx-wetu-importer'); ?></label> |
|
148 | 148 | </th> |
149 | 149 | <td> |
150 | 150 | <input type="checkbox" |
151 | 151 | <?php |
152 | - if ( isset( $options['disable_tour_tags'] ) && '' !== $options['disable_tour_tags'] ) { |
|
153 | - echo esc_attr( 'checked="checked"' ); |
|
152 | + if (isset($options['disable_tour_tags']) && '' !== $options['disable_tour_tags']) { |
|
153 | + echo esc_attr('checked="checked"'); |
|
154 | 154 | } |
155 | 155 | ?> |
156 | 156 | name="disable_tour_tags" /> |
157 | 157 | |
158 | - <small><?php esc_html_e( 'Disable this is you dont want the option available on the import screen.', 'lsx-wetu-importer' ); ?></small> |
|
158 | + <small><?php esc_html_e('Disable this is you dont want the option available on the import screen.', 'lsx-wetu-importer'); ?></small> |
|
159 | 159 | </td> |
160 | 160 | </tr> |
161 | 161 | |
162 | 162 | <tr class="form-field -wrap"> |
163 | 163 | <th scope="row"> |
164 | - <label for="enable_tour_ref_column"><?php esc_html_e( 'Enable Reference Column', 'lsx-wetu-importer' ); ?></label> |
|
164 | + <label for="enable_tour_ref_column"><?php esc_html_e('Enable Reference Column', 'lsx-wetu-importer'); ?></label> |
|
165 | 165 | </th> |
166 | 166 | <td> |
167 | 167 | <input type="checkbox" |
168 | 168 | <?php |
169 | - if ( isset( $options['enable_tour_ref_column'] ) && '' !== $options['enable_tour_ref_column'] ) { |
|
170 | - echo esc_attr( 'checked="checked"' ); |
|
169 | + if (isset($options['enable_tour_ref_column']) && '' !== $options['enable_tour_ref_column']) { |
|
170 | + echo esc_attr('checked="checked"'); |
|
171 | 171 | } |
172 | 172 | ?> |
173 | 173 | name="enable_tour_ref_column" /> |
174 | - <small><?php esc_html_e( 'Enables the use of the WETU Reference Column for better tours management.', 'lsx-wetu-importer' ); ?></small> |
|
174 | + <small><?php esc_html_e('Enables the use of the WETU Reference Column for better tours management.', 'lsx-wetu-importer'); ?></small> |
|
175 | 175 | </td> |
176 | 176 | </tr> |
177 | 177 | </tbody> |
178 | 178 | </table> |
179 | 179 | |
180 | - <h1><?php esc_html_e( 'Accommodation', 'lsx-wetu-importer' ); ?></h1> |
|
180 | + <h1><?php esc_html_e('Accommodation', 'lsx-wetu-importer'); ?></h1> |
|
181 | 181 | |
182 | 182 | <table class="form-table"> |
183 | 183 | <tbody> |
184 | 184 | <tr class="form-field -wrap"> |
185 | 185 | <th scope="row"> |
186 | - <label for="disable_accommodation_descriptions"><?php esc_html_e( 'Disable Accommodation Descriptions', 'lsx-wetu-importer' ); ?></label> |
|
186 | + <label for="disable_accommodation_descriptions"><?php esc_html_e('Disable Accommodation Descriptions', 'lsx-wetu-importer'); ?></label> |
|
187 | 187 | </th> |
188 | 188 | <td> |
189 | 189 | <input type="checkbox" |
190 | 190 | <?php |
191 | - if ( isset( $options['disable_accommodation_descriptions'] ) && '' !== $options['disable_accommodation_descriptions'] ) { |
|
192 | - echo esc_attr( 'checked="checked"' ); |
|
191 | + if (isset($options['disable_accommodation_descriptions']) && '' !== $options['disable_accommodation_descriptions']) { |
|
192 | + echo esc_attr('checked="checked"'); |
|
193 | 193 | } |
194 | 194 | ?> |
195 | 195 | name="disable_accommodation_descriptions" /> |
196 | - <small><?php esc_html_e( 'If you are going to edit the accommodation descriptions imported then enable this setting.', 'lsx-wetu-importer' ); ?></small> |
|
196 | + <small><?php esc_html_e('If you are going to edit the accommodation descriptions imported then enable this setting.', 'lsx-wetu-importer'); ?></small> |
|
197 | 197 | </td> |
198 | 198 | </tr> |
199 | 199 | <tr class="form-field -wrap"> |
200 | 200 | <th scope="row"> |
201 | - <label for="disable_accommodation_excerpts"><?php esc_html_e( 'Disable Accommodation Excerpts', 'lsx-wetu-importer' ); ?></label> |
|
201 | + <label for="disable_accommodation_excerpts"><?php esc_html_e('Disable Accommodation Excerpts', 'lsx-wetu-importer'); ?></label> |
|
202 | 202 | </th> |
203 | 203 | <td> |
204 | 204 | <input type="checkbox" |
205 | 205 | <?php |
206 | - if ( isset( $options['disable_accommodation_excerpts'] ) && '' !== $options['disable_accommodation_excerpts'] ) { |
|
207 | - echo esc_attr( 'checked="checked"' ); |
|
206 | + if (isset($options['disable_accommodation_excerpts']) && '' !== $options['disable_accommodation_excerpts']) { |
|
207 | + echo esc_attr('checked="checked"'); |
|
208 | 208 | } |
209 | 209 | ?> |
210 | 210 | name="disable_accommodation_excerpts" /> |
211 | - <small><?php esc_html_e( 'If you are going to edit the accommodation excerpts then enable this setting.', 'lsx-wetu-importer' ); ?></small> |
|
211 | + <small><?php esc_html_e('If you are going to edit the accommodation excerpts then enable this setting.', 'lsx-wetu-importer'); ?></small> |
|
212 | 212 | </td> |
213 | 213 | </tr> |
214 | 214 | </tbody> |
215 | 215 | </table> |
216 | 216 | |
217 | - <h1><?php esc_html_e( 'Destinations', 'lsx-wetu-importer' ); ?></h1> |
|
217 | + <h1><?php esc_html_e('Destinations', 'lsx-wetu-importer'); ?></h1> |
|
218 | 218 | |
219 | 219 | <table class="form-table"> |
220 | 220 | <tbody> |
221 | 221 | <tr class="form-field -wrap"> |
222 | 222 | <th scope="row"> |
223 | - <label for="disable_destination_descriptions"><?php esc_html_e( 'Disable Destinations Descriptions', 'lsx-wetu-importer' ); ?></label> |
|
223 | + <label for="disable_destination_descriptions"><?php esc_html_e('Disable Destinations Descriptions', 'lsx-wetu-importer'); ?></label> |
|
224 | 224 | </th> |
225 | 225 | <td> |
226 | 226 | <input type="checkbox" |
227 | 227 | <?php |
228 | - if ( isset( $options['disable_destination_descriptions'] ) && '' !== $options['disable_destination_descriptions'] ) { |
|
229 | - echo esc_attr( 'checked="checked"' ); |
|
228 | + if (isset($options['disable_destination_descriptions']) && '' !== $options['disable_destination_descriptions']) { |
|
229 | + echo esc_attr('checked="checked"'); |
|
230 | 230 | } |
231 | 231 | ?> |
232 | 232 | name="disable_destination_descriptions" /> |
233 | - <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> |
|
233 | + <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> |
|
234 | 234 | </td> |
235 | 235 | </tr> |
236 | 236 | </tbody> |
237 | 237 | </table> |
238 | 238 | |
239 | - <h1><?php esc_html_e( 'Images', 'lsx-wetu-importer' ); ?></h1> |
|
239 | + <h1><?php esc_html_e('Images', 'lsx-wetu-importer'); ?></h1> |
|
240 | 240 | |
241 | 241 | <table class="form-table"> |
242 | 242 | <tbody> |
243 | 243 | <tr class="form-field -wrap"> |
244 | 244 | <th scope="row"> |
245 | - <label for="image_replacing"><?php esc_html_e( 'Replace Images', 'lsx-wetu-importer' ); ?></label> |
|
245 | + <label for="image_replacing"><?php esc_html_e('Replace Images', 'lsx-wetu-importer'); ?></label> |
|
246 | 246 | </th> |
247 | 247 | <td> |
248 | 248 | <input type="checkbox" |
249 | 249 | <?php |
250 | - if ( isset( $options['image_replacing'] ) && '' !== $options['image_replacing'] ) { |
|
251 | - echo esc_attr( 'checked="checked"' ); |
|
250 | + if (isset($options['image_replacing']) && '' !== $options['image_replacing']) { |
|
251 | + echo esc_attr('checked="checked"'); |
|
252 | 252 | } |
253 | 253 | ?> |
254 | 254 | name="image_replacing" /> |
255 | - <p><?php esc_html_e( 'Do you want your images to be replaced on each import.', 'lsx-wetu-importer' ); ?></p> |
|
255 | + <p><?php esc_html_e('Do you want your images to be replaced on each import.', 'lsx-wetu-importer'); ?></p> |
|
256 | 256 | </td> |
257 | 257 | </tr> |
258 | 258 | <tr class="form-field -wrap"> |
259 | 259 | <th scope="row"> |
260 | - <label for="image_limit"> <?php esc_html_e( 'Limit the amount of images imported to the gallery', 'lsx-wetu-importer' ); ?></label> |
|
260 | + <label for="image_limit"> <?php esc_html_e('Limit the amount of images imported to the gallery', 'lsx-wetu-importer'); ?></label> |
|
261 | 261 | </th> |
262 | 262 | <td> |
263 | 263 | <input placeholder="" type="text" value="<?php |
264 | - if ( isset( $options['image_limit'] ) && '' !== $options['image_limit'] ) { |
|
265 | - echo esc_attr( $options['image_limit'] ); |
|
264 | + if (isset($options['image_limit']) && '' !== $options['image_limit']) { |
|
265 | + echo esc_attr($options['image_limit']); |
|
266 | 266 | } |
267 | 267 | ?>" |
268 | 268 | name="image_limit" /> |
@@ -271,13 +271,13 @@ discard block |
||
271 | 271 | |
272 | 272 | <tr class="form-field -wrap"> |
273 | 273 | <th scope="row"> |
274 | - <label for="image_scaling"><?php esc_html_e( 'Enable Image Scaling', 'lsx-wetu-importer' ); ?></label> |
|
274 | + <label for="image_scaling"><?php esc_html_e('Enable Image Scaling', 'lsx-wetu-importer'); ?></label> |
|
275 | 275 | </th> |
276 | 276 | <td> |
277 | 277 | <input type="checkbox" |
278 | 278 | <?php |
279 | - if ( isset( $options['image_scaling'] ) && '' !== $options['image_scaling'] ) { |
|
280 | - echo esc_attr( 'checked="checked"' ); |
|
279 | + if (isset($options['image_scaling']) && '' !== $options['image_scaling']) { |
|
280 | + echo esc_attr('checked="checked"'); |
|
281 | 281 | } |
282 | 282 | ?> |
283 | 283 | name="image_scaling" /> |
@@ -285,12 +285,12 @@ discard block |
||
285 | 285 | </tr> |
286 | 286 | <tr class="form-field -wrap"> |
287 | 287 | <th scope="row"> |
288 | - <label for="width"> <?php esc_html_e( 'Width (px)', 'lsx-wetu-importer' ); ?></label> |
|
288 | + <label for="width"> <?php esc_html_e('Width (px)', 'lsx-wetu-importer'); ?></label> |
|
289 | 289 | </th> |
290 | 290 | <td> |
291 | 291 | <input placeholder="800" type="text" value="<?php |
292 | - if ( isset( $options['width'] ) && '' !== $options['width'] ) { |
|
293 | - echo esc_attr( $options['width'] ); |
|
292 | + if (isset($options['width']) && '' !== $options['width']) { |
|
293 | + echo esc_attr($options['width']); |
|
294 | 294 | } |
295 | 295 | ?>" |
296 | 296 | name="width" /> |
@@ -298,12 +298,12 @@ discard block |
||
298 | 298 | </tr> |
299 | 299 | <tr class="form-field -wrap"> |
300 | 300 | <th scope="row"> |
301 | - <label for="height"> <?php esc_html_e( 'Height (px)', 'lsx-wetu-importer' ); ?></label> |
|
301 | + <label for="height"> <?php esc_html_e('Height (px)', 'lsx-wetu-importer'); ?></label> |
|
302 | 302 | </th> |
303 | 303 | <td> |
304 | 304 | <input placeholder="600" type="text" value="<?php |
305 | - if ( isset( $options['height'] ) && '' !== $options['height'] ) { |
|
306 | - echo esc_attr( $options['height'] ); |
|
305 | + if (isset($options['height']) && '' !== $options['height']) { |
|
306 | + echo esc_attr($options['height']); |
|
307 | 307 | } |
308 | 308 | ?>" |
309 | 309 | name="height" /> |
@@ -312,63 +312,63 @@ discard block |
||
312 | 312 | |
313 | 313 | <tr class="form-field -wrap"> |
314 | 314 | <th scope="row"> |
315 | - <label for="scaling"> <?php esc_html_e( 'Scaling', 'lsx-wetu-importer' ); ?></label> |
|
315 | + <label for="scaling"> <?php esc_html_e('Scaling', 'lsx-wetu-importer'); ?></label> |
|
316 | 316 | </th> |
317 | 317 | <td> |
318 | 318 | <input type="radio" |
319 | 319 | <?php |
320 | - if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'raw' === $options['scaling'] ) { |
|
321 | - echo esc_attr( 'checked="checked"' ); |
|
320 | + if (isset($options['scaling']) && '' !== $options['scaling'] && 'raw' === $options['scaling']) { |
|
321 | + echo esc_attr('checked="checked"'); |
|
322 | 322 | } |
323 | 323 | ?> |
324 | - name="scaling" value="raw" /> <?php esc_html_e( 'Get the Full size image, no cropping takes place.', 'lsx-wetu-importer' ); ?><br /> |
|
324 | + name="scaling" value="raw" /> <?php esc_html_e('Get the Full size image, no cropping takes place.', 'lsx-wetu-importer'); ?><br /> |
|
325 | 325 | <input type="radio" |
326 | 326 | <?php |
327 | - if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'c' === $options['scaling'] ) { |
|
328 | - echo esc_attr( 'checked="checked"' ); |
|
327 | + if (isset($options['scaling']) && '' !== $options['scaling'] && 'c' === $options['scaling']) { |
|
328 | + echo esc_attr('checked="checked"'); |
|
329 | 329 | } |
330 | 330 | ?> |
331 | - 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 /> |
|
331 | + 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 /> |
|
332 | 332 | <input type="radio" |
333 | 333 | <?php |
334 | - if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'h' === $options['scaling'] ) { |
|
335 | - echo esc_attr( 'checked="checked"' ); |
|
334 | + if (isset($options['scaling']) && '' !== $options['scaling'] && 'h' === $options['scaling']) { |
|
335 | + echo esc_attr('checked="checked"'); |
|
336 | 336 | } |
337 | 337 | ?> |
338 | - 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 /> |
|
338 | + 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 /> |
|
339 | 339 | <input type="radio" |
340 | 340 | <?php |
341 | - if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'w' === $options['scaling'] ) { |
|
342 | - echo esc_attr( 'checked="checked"' ); |
|
341 | + if (isset($options['scaling']) && '' !== $options['scaling'] && 'w' === $options['scaling']) { |
|
342 | + echo esc_attr('checked="checked"'); |
|
343 | 343 | } |
344 | 344 | ?> |
345 | - 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 /> |
|
345 | + 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 /> |
|
346 | 346 | <input type="radio" |
347 | 347 | <?php |
348 | - if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'nf' === $options['scaling'] ) { |
|
349 | - echo esc_attr( 'checked="checked"' ); |
|
348 | + if (isset($options['scaling']) && '' !== $options['scaling'] && 'nf' === $options['scaling']) { |
|
349 | + echo esc_attr('checked="checked"'); |
|
350 | 350 | } |
351 | 351 | ?> |
352 | - 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 /> |
|
352 | + 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 /> |
|
353 | 353 | <input type="radio" |
354 | 354 | <?php |
355 | - if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'n' === $options['scaling'] ) { |
|
356 | - echo esc_attr( 'checked="checked"' ); |
|
355 | + if (isset($options['scaling']) && '' !== $options['scaling'] && 'n' === $options['scaling']) { |
|
356 | + echo esc_attr('checked="checked"'); |
|
357 | 357 | } |
358 | 358 | ?> |
359 | - 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 /> |
|
359 | + 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 /> |
|
360 | 360 | <input type="radio" |
361 | 361 | <?php |
362 | - if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'W' === $options['scaling'] ) { |
|
363 | - echo esc_attr( 'checked="checked"' ); |
|
362 | + if (isset($options['scaling']) && '' !== $options['scaling'] && 'W' === $options['scaling']) { |
|
363 | + echo esc_attr('checked="checked"'); |
|
364 | 364 | } |
365 | 365 | ?> |
366 | - 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' ); ?> |
|
366 | + 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'); ?> |
|
367 | 367 | </td> |
368 | 368 | </tr> |
369 | 369 | </tbody> |
370 | 370 | </table> |
371 | - <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> |
|
371 | + <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> |
|
372 | 372 | </form> |
373 | 373 | </div> |
374 | 374 | <?php |
@@ -380,17 +380,17 @@ discard block |
||
380 | 380 | * @return void |
381 | 381 | */ |
382 | 382 | public function save_options() { |
383 | - if ( ! isset( $_POST['lsx_wetu_importer_save_options'] ) || ! wp_verify_nonce( $_POST['lsx_wetu_importer_save_options'], 'lsx_wetu_importer_save' ) ) { |
|
383 | + if (!isset($_POST['lsx_wetu_importer_save_options']) || !wp_verify_nonce($_POST['lsx_wetu_importer_save_options'], 'lsx_wetu_importer_save')) { |
|
384 | 384 | return; |
385 | 385 | } |
386 | 386 | $data_to_save = array(); |
387 | - foreach ( $this->defaults as $key => $field ) { |
|
388 | - if ( isset( $_POST[ $key ] ) ) { |
|
389 | - $data_to_save[ $key ] = sanitize_text_field( $_POST[ $key ] ); |
|
390 | - } else { |
|
391 | - $data_to_save[ $key ] = ''; |
|
387 | + foreach ($this->defaults as $key => $field) { |
|
388 | + if (isset($_POST[$key])) { |
|
389 | + $data_to_save[$key] = sanitize_text_field($_POST[$key]); |
|
390 | + }else { |
|
391 | + $data_to_save[$key] = ''; |
|
392 | 392 | } |
393 | 393 | } |
394 | - update_option( 'lsx_wetu_importer_settings', $data_to_save ); |
|
394 | + update_option('lsx_wetu_importer_settings', $data_to_save); |
|
395 | 395 | } |
396 | 396 | } |