Making WordPress.org

Changeset 6815


Ignore:
Timestamp:
03/01/2018 06:59:58 PM (6 years ago)
Author:
coreymckrill
Message:

Events API: Add where clause for status when selecting events

This helps to address the issue in #2720 by ensuring that cancelled events do
not appear in results.

File:
1 edited

Legend:

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

    r6291 r6815  
    716716    }
    717717
     718    // Just show events that are currently scheduled (as opposed to cancelled).
     719    $wheres[]     = '`status` = %s';
     720    $sql_values[] = 'scheduled';
     721
    718722    // Just show upcoming events
    719     $wheres[] = '`date_utc` >= %s';
     723    $wheres[] = '`date_utc` >= %s'; // Not actually UTC. WordCamp posts don't store a timezone value.
    720724
    721725    // Dates are in local-time not UTC, so the API output will contain events that have already happened in some parts of the world.
Note: See TracChangeset for help on using the changeset viewer.