Changeset 9705 for sites/trunk/wordpress.org/public_html/wp-content/plugins/official-wordpress-events/official-wordpress-events.php
- Timestamp:
- 04/06/2020 10:23:19 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/official-wordpress-events/official-wordpress-events.php
r9704 r9705 164 164 } 165 165 166 $this->log( 'finished job');166 $this->log( "finished job\n\n" ); 167 167 } 168 168 … … 335 335 continue 3; 336 336 } 337 if ( ! $wordcamp->session_start_time ) { 338 $event['start_timestamp'] = $value; 339 } else { 340 $event['start_timestamp'] = absint( $wordcamp->session_start_time ); 341 } 337 338 $event['start_timestamp'] = $this->get_wordcamp_start_time( $value, absint( $wordcamp->session_start_time ) ); 342 339 break; 343 340 … … 394 391 395 392 return $events; 393 } 394 395 /** 396 * Determine the best start time for a WordCamp. 397 * 398 * The timestamp from the WordCamp post type only tell us the date that the camp is on, not when it starts. 399 * The earliest session can be used to get the time that the camp starts, but it's likely to be inaccurate 400 * if it doesn't match the date from the WordCamp post. One common cause of that is when an event is 401 * postponed, but the organizers haven't gone through and updated all of the sessions yet. 402 * 403 * @param string $start_date 404 * @param string $first_session_start_time 405 * 406 * @return string 407 */ 408 protected function get_wordcamp_start_time( $start_date, $first_session_start_time ) { 409 $session_time_is_same_day = date( 'Ymd', $start_date ) === date( 'Ymd', $first_session_start_time ); 410 411 return $session_time_is_same_day ? $first_session_start_time : $start_date; 396 412 } 397 413
Note: See TracChangeset
for help on using the changeset viewer.