| @@ 252-263 (lines=12) @@ | ||
| 249 | /** |
|
| 250 | * Save the list of Accommodation into an option |
|
| 251 | */ |
|
| 252 | public function update_options() { |
|
| 253 | $data = file_get_contents( $this->url . '/List?' . $this->url_qs ); |
|
| 254 | ||
| 255 | $accommodation = json_decode( $data, true ); |
|
| 256 | ||
| 257 | if ( isset( $accommodation['error'] ) ) { |
|
| 258 | return $accommodation['error']; |
|
| 259 | } elseif ( isset( $accommodation ) && ! empty( $accommodation ) ) { |
|
| 260 | set_transient( 'lsx_ti_accommodation',$accommodation,60 * 60 * 2 ); |
|
| 261 | return true; |
|
| 262 | } |
|
| 263 | } |
|
| 264 | ||
| 265 | /** |
|
| 266 | * Run through the accommodation grabbed from the DB. |
|
| @@ 760-771 (lines=12) @@ | ||
| 757 | /** |
|
| 758 | * Save the list of Accommodation into an option |
|
| 759 | */ |
|
| 760 | public function update_options() { |
|
| 761 | $data = file_get_contents( $this->url . '/List?' . $this->url_qs ); |
|
| 762 | ||
| 763 | $accommodation = json_decode( $data, true ); |
|
| 764 | ||
| 765 | if ( isset( $accommodation['error'] ) ) { |
|
| 766 | return $accommodation['error']; |
|
| 767 | } elseif ( isset( $accommodation ) && ! empty( $accommodation ) ) { |
|
| 768 | set_transient( 'lsx_ti_accommodation',$accommodation,60 * 60 * 2 ); |
|
| 769 | return true; |
|
| 770 | } |
|
| 771 | } |
|
| 772 | ||
| 773 | /** |
|
| 774 | * search_form |
|