Making WordPress.org

Changeset 9675


Ignore:
Timestamp:
04/01/2020 03:32:01 PM (5 years ago)
Author:
ryelle
Message:

Official WordPress Events: Sync a temporary location value for online events

Online events don't have coordinates, but coordinates are required for syncing. This injects fake coordinates of 1,1 to ensure the WordCamp still syncs into the events table.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/official-wordpress-events/official-wordpress-events.php

    r9662 r9675  
    367367
    368368                        case '_venue_coordinates':
    369                             if ( isset( $value->latitude, $value->longitude ) ) {
     369                            if ( rest_sanitize_boolean( $wordcamp->{'Virtual event only'} ) ) {
     370                                // Online events don't have coordinates, so we fake them for now. The fake value
     371                                // needs to pass an `empty` check, so we use 1 instead of 0.
     372                                // @todo This should be replaced with however we locate online events.
     373                                $event['latitude']  = 1;
     374                                $event['longitude'] = 1;
     375                            } elseif ( isset( $value->latitude, $value->longitude ) ) {
    370376                                $event['latitude']  = $value->latitude;
    371377                                $event['longitude'] = $value->longitude;
Note: See TracChangeset for help on using the changeset viewer.