Making WordPress.org

Changeset 9799


Ignore:
Timestamp:
04/30/2020 08:17:19 PM (5 years ago)
Author:
iandunn
Message:

Events: Determine promo_start automatically for consistency.

File:
1 edited

Legend:

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

    r9798 r9799  
    957957 */
    958958function get_regional_wordcamp_data() {
    959     // `promo_start` should be 2 months before the Event's start date. See `maybe_add_regional_wordcamps()`.
    960 
    961     return array(
     959    $events = array(
    962960        // WordCamp Asia.
    963961        'asia' => array(
    964             'promo_start' => strtotime( '2019-12-20 00:00:00' ),
    965 
    966962            'regional_countries' => array_merge(
    967963                get_iso_3166_2_country_codes( 'asia' ),
     
    992988        // WordCamp Europe.
    993989        'europe' => array(
    994             'promo_start' => strtotime( '2020-04-04 00:00:00' ),
    995 
    996990            'regional_countries' => array_merge(
    997991                get_iso_3166_2_country_codes( 'africa' ),
     
    10191013        // WordCamp US.
    10201014        'us' => array(
    1021             'promo_start' => strtotime( '2020-08-27 00:00:00' ),
    1022 
    10231015            'regional_countries' => array_merge(
    10241016                get_iso_3166_2_country_codes( 'south america' ),
     
    10441036        ),
    10451037    );
     1038
     1039    // `promo_start` should be 2 months before the Event's start date. See `maybe_add_regional_wordcamps()`.
     1040    foreach ( $events as & $event ) {
     1041        $event['promo_start'] = strtotime( $event['event']['date'] . ' - 2 months' );
     1042    }
     1043
     1044    return $events;
    10461045}
    10471046
Note: See TracChangeset for help on using the changeset viewer.