WordPress.org

Making WordPress.org

Changeset 5495


Ignore:
Timestamp:
05/17/2017 06:21:49 PM (4 years ago)
Author:
iandunn
Message:

Events: Prefer meetups over WordCamps to improve location accuracy

See #2823

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/events/1.0/index.php

    r5493 r5495  
    410410 * See https://meta.trac.wordpress.org/ticket/2823#comment:21
    411411 *
     412 * This isn't ideal, since the location it picks is potentially an hour's driving time from the user. If we get a
     413 * lot of complaints, we could potentially change this to search the `geonames` database for the name of the city
     414 * that was returned by the `ip2location` database. That should be more accurate, but it would require an extra
     415 * database lookup, and could potentially fail to return any results.
     416 *
    412417 * @param array $events
    413418 *
     
    422427            $location['description'] = $location['location'];
    423428            unset( $location['location'] );
    424             break;
     429
     430            /*
     431             * If the event is a WordCamp, continue searching until a meetup is found. Meetups have a much smaller
     432             * search radius in `get_events()`, so they'll be closer to the user's location. Some cities will only
     433             * have WordCamps scheduled at the moment, though, so we can fall back to those.
     434             */
     435            if ( 'meetup' === $event['type'] ) {
     436                break;
     437            }
    425438        }
    426439    }
Note: See TracChangeset for help on using the changeset viewer.