| @@ 336-360 (lines=25) @@ | ||
| 333 | /** |
|
| 334 | * Grab all the current tour posts via the lsx_wetu_id field. |
|
| 335 | */ |
|
| 336 | public function find_current_tours() { |
|
| 337 | global $wpdb; |
|
| 338 | $return = array(); |
|
| 339 | ||
| 340 | $current_tours = $wpdb->get_results(" |
|
| 341 | SELECT key1.post_id,key1.meta_value |
|
| 342 | FROM {$wpdb->postmeta} key1 |
|
| 343 | ||
| 344 | INNER JOIN {$wpdb->posts} key2 |
|
| 345 | ON key1.post_id = key2.ID |
|
| 346 | ||
| 347 | WHERE key1.meta_key = 'lsx_wetu_id' |
|
| 348 | AND key2.post_type = 'tour' |
|
| 349 | ||
| 350 | LIMIT 0,500 |
|
| 351 | "); |
|
| 352 | ||
| 353 | if ( null !== $current_tours && ! empty( $current_tours ) ) { |
|
| 354 | foreach ( $current_tours as $tour ) { |
|
| 355 | $return[ $tour->meta_value ] = $tour; |
|
| 356 | } |
|
| 357 | } |
|
| 358 | ||
| 359 | return $return; |
|
| 360 | } |
|
| 361 | ||
| 362 | /** |
|
| 363 | * Run through the accommodation grabbed from the DB. |
|
| @@ 1208-1234 (lines=27) @@ | ||
| 1205 | /** |
|
| 1206 | * Grab all the current accommodation posts via the lsx_wetu_id field. |
|
| 1207 | */ |
|
| 1208 | public function find_current_accommodation( $post_type = 'accommodation' ) { |
|
| 1209 | global $wpdb; |
|
| 1210 | $return = array(); |
|
| 1211 | ||
| 1212 | // @codingStandardsIgnoreStart |
|
| 1213 | $current_accommodation = $wpdb->get_results(" |
|
| 1214 | SELECT key1.post_id,key1.meta_value |
|
| 1215 | FROM {$wpdb->postmeta} key1 |
|
| 1216 | ||
| 1217 | INNER JOIN {$wpdb->posts} key2 |
|
| 1218 | ON key1.post_id = key2.ID |
|
| 1219 | ||
| 1220 | WHERE key1.meta_key = 'lsx_wetu_id' |
|
| 1221 | AND key2.post_type = '{$post_type}' |
|
| 1222 | ||
| 1223 | LIMIT 0,5000 |
|
| 1224 | "); |
|
| 1225 | // @codingStandardsIgnoreEnd |
|
| 1226 | ||
| 1227 | if ( null !== $current_accommodation && ! empty( $current_accommodation ) ) { |
|
| 1228 | foreach ( $current_accommodation as $accom ) { |
|
| 1229 | $return[ $accom->meta_value ] = $accom; |
|
| 1230 | } |
|
| 1231 | } |
|
| 1232 | ||
| 1233 | return $return; |
|
| 1234 | } |
|
| 1235 | ||
| 1236 | /** |
|
| 1237 | * Set the Video date |
|
| @@ 302-328 (lines=27) @@ | ||
| 299 | /** |
|
| 300 | * Grab all the current destination posts via the lsx_wetu_id field. |
|
| 301 | */ |
|
| 302 | public function find_current_destination( $post_type = 'destination' ) { |
|
| 303 | global $wpdb; |
|
| 304 | $return = array(); |
|
| 305 | ||
| 306 | // @codingStandardsIgnoreStart |
|
| 307 | $current_destination = $wpdb->get_results(" |
|
| 308 | SELECT key1.post_id,key1.meta_value,key2.post_title as name,key2.post_date as last_modified |
|
| 309 | FROM {$wpdb->postmeta} key1 |
|
| 310 | ||
| 311 | INNER JOIN {$wpdb->posts} key2 |
|
| 312 | ON key1.post_id = key2.ID |
|
| 313 | ||
| 314 | WHERE key1.meta_key = 'lsx_wetu_id' |
|
| 315 | AND key2.post_type = '{$post_type}' |
|
| 316 | ||
| 317 | LIMIT 0,1000 |
|
| 318 | "); |
|
| 319 | // @codingStandardsIgnoreEnd |
|
| 320 | ||
| 321 | if ( null !== $current_destination && ! empty( $current_destination ) ) { |
|
| 322 | foreach ( $current_destination as $accom ) { |
|
| 323 | $return[ $accom->meta_value ] = $accom; |
|
| 324 | } |
|
| 325 | } |
|
| 326 | ||
| 327 | return $return; |
|
| 328 | } |
|
| 329 | ||
| 330 | /** |
|
| 331 | * Run through the accommodation grabbed from the DB. |
|