Making WordPress.org


Ignore:
Timestamp:
03/20/2020 09:46:16 PM (5 years ago)
Author:
ryelle
Message:

Official WordPress Events: Sync WordCamps in "pre-planning"

This is a workaround for the Events Widget. WordCamps that have been moved from scheduled back to pre-planning (due to COVID-19) need to be marked as un-scheduled in the wporg_events table, so that the API doesn't return them as still running. This change syncs "In Pre-Planning" events as a new status, pre-planning.

File:
1 edited

Legend:

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

    r9171 r9614  
    281281        // Note: With the number of WordCamps per year growing fast, we may need to batch requests in the near future, like we do for meetups.
    282282        $request_url = add_query_arg( array(
    283             'status'   => array( 'wcpt-scheduled', 'wcpt-cancelled' ),
     283            'status'   => array( 'wcpt-scheduled', 'wcpt-pre-planning', 'wcpt-cancelled' ),
    284284            'per_page' => 100,
    285285        ), self::WORDCAMP_API_BASE_URL . 'wp/v2/wordcamps' );
     
    311311                $event = array(
    312312                    'source_id'   => $wordcamp->id,
    313                     'status'      => 'wcpt-scheduled' === $wordcamp->status ? 'scheduled' : 'cancelled',
     313                    'status'      => str_replace( 'wcpt-', '', $wordcamp->status ),
    314314                    'type'        => 'wordcamp',
    315315                    'title'       => $wordcamp->title->rendered,
Note: See TracChangeset for help on using the changeset viewer.