Making WordPress.org


Ignore:
Timestamp:
04/17/2020 02:36:59 PM (6 years ago)
Author:
iandunn
Message:

Events: Pin WordCamp Santa Clarity.

This is the first of several changes to add online WordCamps to Core's Events Widget. It's only the bare essentials, since the event is tomorrow. After this is deployed, more events and conditions will be added.

See https://make.wordpress.org/community/2020/04/03/showing-online-workshops-in-the-events-widget/

File:
1 edited

Legend:

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

    r9642 r9742  
    172172
    173173                //$events = maybe_add_wp15_promo( $events, $_SERVER['HTTP_USER_AGENT'], time() );
     174
     175                $events = maybe_add_online_wordcamps( $events, $_SERVER['HTTP_USER_AGENT'], time() );
    174176
    175177                $events = maybe_add_regional_wordcamps(
     
    11751177}
    11761178
     1179function maybe_add_online_wordcamps( $events, $user_agent, $current_time ) {
     1180        if ( ! is_client_core( $user_agent ) ) {
     1181                return $events;
     1182        }
     1183
     1184        if ( $current_time < strtotime( 'April 19, 2020' ) ) {
     1185                $santa_clarita = array(
     1186                        'type'       => 'wordcamp',
     1187                        'title'      => 'WordCamp Santa Clarita Online',
     1188                        'url'        => 'https://2020.santaclarita.wordcamp.org/',
     1189                        'meetup'     => null,
     1190                        'meetup_url' => null,
     1191                        'date'       => '2020-04-18 12:00:00',
     1192                        'location'   => array(
     1193                                'location' => 'Everywhere',
     1194                        ),
     1195                );
     1196
     1197                array_unshift( $events, $santa_clarita );
     1198        }
     1199
     1200        return $events;
     1201}
     1202
    11771203/**
    11781204 * Create a bounded latitude/longitude box of x KM around specific coordinates.
Note: See TracChangeset for help on using the changeset viewer.