Changeset 8781 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wp-i18n-teams/wp-i18n-teams.php
- Timestamp:
- 05/13/2019 05:49:46 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wp-i18n-teams/wp-i18n-teams.php
r7829 r8781 282 282 $locale_data['project_validators'] = $contributors['project_validators']; 283 283 $locale_data['translators'] = $contributors['translators']; 284 $locale_data['translators_past'] = $contributors['translators_past']; 284 285 285 286 return $locale_data; … … 302 303 $contributors['validators'] = $this->get_general_translation_editors( $locale ); 303 304 $contributors['project_validators'] = $this->get_project_translation_editors( $locale ); 304 $contributors['translators'] = $this->get_translation_contributors( $locale ); 305 $contributors['translators'] = $this->get_translation_contributors( $locale, 365 ); // Contributors from the past year 306 $contributors['translators_past'] = array_diff_key( $this->get_translation_contributors( $locale ), $contributors['translators'] ); 305 307 306 308 wp_cache_set( 'contributors-data:' . $locale->wp_locale, $contributors, 'wp-i18n-teams', 2 * HOUR_IN_SECONDS ); … … 478 480 * @return array 479 481 */ 480 private function get_translation_contributors( $locale ) {482 private function get_translation_contributors( $locale, $max_age_days = null ) { 481 483 global $wpdb; 482 484 483 485 $contributors = array(); 486 487 $date_constraint = ''; 488 if ( !is_null( $max_age_days ) ) 489 $date_constraint = $wpdb->prepare( " AND date_modified >= CURRENT_DATE - INTERVAL %d DAY", $max_age_days ); 484 490 485 491 $users = $wpdb->get_col( $wpdb->prepare( 486 492 "SELECT DISTINCT user_id FROM translate_user_translations_count WHERE accepted > 0 AND locale = %s", 487 493 $locale->slug 488 ) );494 ) . $date_constraint ); 489 495 490 496 if ( ! $users ) {
Note: See TracChangeset
for help on using the changeset viewer.