@@ -210,15 +210,15 @@ discard block |
||
210 | 210 | $this->api_username = false; |
211 | 211 | $this->api_password = false; |
212 | 212 | |
213 | - if (isset($temp_options['api']['wetu_api_key']) && '' !== $temp_options['api']['wetu_api_key']) { |
|
214 | - $this->api_key = $temp_options['api']['wetu_api_key']; |
|
215 | - } |
|
216 | - if (isset($temp_options['api']['wetu_api_username']) && '' !== $temp_options['api']['wetu_api_username']) { |
|
217 | - $this->api_username = $temp_options['api']['wetu_api_username']; |
|
218 | - } |
|
219 | - if (isset($temp_options['api']['wetu_api_password']) && '' !== $temp_options['api']['wetu_api_password']) { |
|
220 | - $this->api_password = $temp_options['api']['wetu_api_password']; |
|
221 | - } |
|
213 | + if (isset($temp_options['api']['wetu_api_key']) && '' !== $temp_options['api']['wetu_api_key']) { |
|
214 | + $this->api_key = $temp_options['api']['wetu_api_key']; |
|
215 | + } |
|
216 | + if (isset($temp_options['api']['wetu_api_username']) && '' !== $temp_options['api']['wetu_api_username']) { |
|
217 | + $this->api_username = $temp_options['api']['wetu_api_username']; |
|
218 | + } |
|
219 | + if (isset($temp_options['api']['wetu_api_password']) && '' !== $temp_options['api']['wetu_api_password']) { |
|
220 | + $this->api_password = $temp_options['api']['wetu_api_password']; |
|
221 | + } |
|
222 | 222 | |
223 | 223 | //Set the tab slug |
224 | 224 | if(isset($_GET['tab']) || isset($_POST['type'])) { |
@@ -234,22 +234,22 @@ discard block |
||
234 | 234 | } |
235 | 235 | |
236 | 236 | //Set the scaling options |
237 | - if (isset($temp_options[$this->plugin_slug]) && !empty($temp_options[$this->plugin_slug]) && isset($this->options['image_scaling'])) { |
|
238 | - $this->scale_images = true; |
|
239 | - $width = '800'; |
|
240 | - if (isset($this->options['width']) && '' !== $this->options['width']) { |
|
241 | - $width = $this->options['width']; |
|
242 | - } |
|
243 | - $height = '600'; |
|
244 | - if (isset($this->options['height']) && '' !== $this->options['height']) { |
|
245 | - $height = $this->options['height']; |
|
246 | - } |
|
247 | - $cropping = 'raw'; |
|
248 | - if (isset($this->options['cropping']) && '' !== $this->options['cropping']) { |
|
249 | - $cropping = $this->options['cropping']; |
|
250 | - } |
|
251 | - $this->image_scaling_url = 'https://wetu.com/ImageHandler/' . $cropping . $width . 'x' . $height . '/'; |
|
252 | - } |
|
237 | + if (isset($temp_options[$this->plugin_slug]) && !empty($temp_options[$this->plugin_slug]) && isset($this->options['image_scaling'])) { |
|
238 | + $this->scale_images = true; |
|
239 | + $width = '800'; |
|
240 | + if (isset($this->options['width']) && '' !== $this->options['width']) { |
|
241 | + $width = $this->options['width']; |
|
242 | + } |
|
243 | + $height = '600'; |
|
244 | + if (isset($this->options['height']) && '' !== $this->options['height']) { |
|
245 | + $height = $this->options['height']; |
|
246 | + } |
|
247 | + $cropping = 'raw'; |
|
248 | + if (isset($this->options['cropping']) && '' !== $this->options['cropping']) { |
|
249 | + $cropping = $this->options['cropping']; |
|
250 | + } |
|
251 | + $this->image_scaling_url = 'https://wetu.com/ImageHandler/' . $cropping . $width . 'x' . $height . '/'; |
|
252 | + } |
|
253 | 253 | |
254 | 254 | } |
255 | 255 | } |
@@ -323,10 +323,10 @@ discard block |
||
323 | 323 | |
324 | 324 | // DISPLAY FUNCTIONS |
325 | 325 | |
326 | - /* |
|
326 | + /* |
|
327 | 327 | * Load the importer class you want to use |
328 | 328 | */ |
329 | - public function load_class(){ |
|
329 | + public function load_class(){ |
|
330 | 330 | |
331 | 331 | switch($this->tab_slug){ |
332 | 332 | case 'accommodation': |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | break; |
347 | 347 | } |
348 | 348 | |
349 | - } |
|
349 | + } |
|
350 | 350 | |
351 | 351 | /** |
352 | 352 | * Registers the admin page which will house the importer form. |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | <?php*/ |
403 | 403 | }else{ |
404 | 404 | $this->current_importer->display_page(); |
405 | - }; ?> |
|
405 | + }; ?> |
|
406 | 406 | </div> |
407 | 407 | <?php |
408 | 408 | } |
@@ -802,12 +802,12 @@ discard block |
||
802 | 802 | */ |
803 | 803 | public function set_featured_image($data,$id) { |
804 | 804 | if(is_array($data[0]['content']['images']) && !empty($data[0]['content']['images'])){ |
805 | - if('tour' === $this->tab_slug){ |
|
806 | - $key = array_rand($data[0]['content']['images']); |
|
807 | - $this->featured_image = $this->attach_image($data[0]['content']['images'][$key],$id); |
|
808 | - }else{ |
|
805 | + if('tour' === $this->tab_slug){ |
|
806 | + $key = array_rand($data[0]['content']['images']); |
|
807 | + $this->featured_image = $this->attach_image($data[0]['content']['images'][$key],$id); |
|
808 | + }else{ |
|
809 | 809 | $this->featured_image = $this->attach_image($data[0]['content']['images'][0],$id); |
810 | - } |
|
810 | + } |
|
811 | 811 | |
812 | 812 | |
813 | 813 | if(false !== $this->featured_image){ |
@@ -1040,7 +1040,7 @@ discard block |
||
1040 | 1040 | * Run through the accommodation grabbed from the DB. |
1041 | 1041 | */ |
1042 | 1042 | public function process_ajax_search() { |
1043 | - $this->current_importer->process_ajax_search(); |
|
1043 | + $this->current_importer->process_ajax_search(); |
|
1044 | 1044 | die(); |
1045 | 1045 | } |
1046 | 1046 |