- Timestamp:
- 04/10/2017 09:28:19 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/events/1.0/index.php
r5278 r5311 356 356 } 357 357 358 /** 359 * Determine a location for the given parameters 360 * 361 * @param array $args 362 * 363 * @return false|array 364 */ 358 365 function get_location( $args = array() ) { 359 366 global $cache_life, $cache_group; … … 378 385 } 379 386 380 // Location was provided by the user: 387 // Coordinates provided 388 if ( 389 ! $location && ( 390 ! empty( $args['latitude'] ) && is_numeric( $args['latitude'] ) && 391 ! empty( $args['longitude'] ) && is_numeric( $args['longitude'] ) 392 ) 393 ) { 394 $city = get_city_from_coordinates( $args['latitude'], $args['longitude'] ); 395 396 $location = array( 397 'description' => $city ? $city : "{$args['latitude']}, {$args['longitude']}", 398 'latitude' => $args['latitude'], 399 'longitude' => $args['longitude'] 400 ); 401 } 402 403 // City was provided by the user: 381 404 if ( ! $location && isset( $args['location_name'] ) ) { 382 405 $guess = guess_location_from_city( $args['location_name'], $args['timezone'] ?? '', $country_code ); … … 412 435 ); 413 436 } 414 }415 416 if (417 ! $location && (418 ! empty( $args['latitude'] ) && is_numeric( $args['latitude'] ) &&419 ! empty( $args['longitude'] ) && is_numeric( $args['longitude'] )420 )421 ) {422 $city = get_city_from_coordinates( $args['latitude'], $args['longitude'] );423 424 $location = array(425 'description' => $city ? $city : "{$args['latitude']}, {$args['longitude']}",426 'latitude' => $args['latitude'],427 'longitude' => $args['longitude']428 );429 437 } 430 438
Note: See TracChangeset
for help on using the changeset viewer.