/** * @param bool $keep_original_index */ private function sort_sequence($keep_original_index = true) { if ($this->has_sorted_sequence) { return; } // determine the parent event timezone to use for same day comparison between events $timezone = Tribe__Events__Timezones::get_event_timezone_string($this->parent_event_id); $this->timezone_string = Tribe__Events__Timezones::generate_timezone_string_from_utc_offset($timezone); //add the original key to entry array in the sequence if ($keep_original_index) { array_walk($this->sequence, array($this, 'set_original_index')); } // sort the dates to create by starting time usort($this->sequence, array($this, 'sort_by_start_date')); $this->has_sorted_sequence = true; }