Changeset 45886
- Timestamp:
- 08/23/2019 02:14:07 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-community-events.php
r43356 r45886 403 403 protected function trim_events( $response_body ) { 404 404 if ( isset( $response_body['events'] ) ) { 405 $wordcamps 406 $ current_timestamp = current_time( 'timestamp' );405 $wordcamps = array(); 406 $today = current_time( 'Y-m-d' ); 407 407 408 408 foreach ( $response_body['events'] as $key => $event ) { … … 416 416 } 417 417 418 $event_timestamp = strtotime( $event['date'] ); 419 420 if ( $current_timestamp > $event_timestamp && ( $current_timestamp - $event_timestamp ) > DAY_IN_SECONDS ) { 418 // We don't get accurate time with timezone from API, so we only take the date part (Y-m-d). 419 $event_date = substr( $event['date'], 0, 10 ); 420 421 if ( $today > $event_date ) { 421 422 unset( $response_body['events'][ $key ] ); 422 423 }
Note: See TracChangeset
for help on using the changeset viewer.