Add contributors report, and allow data to be downloaded. (#267)

* Add contributors report, and allow data to be downloaded.
This commit is contained in:
Paul Kevan 2024-07-03 14:03:23 +01:00 committed by GitHub
parent c880f28a63
commit b584bf354e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 141 additions and 0 deletions

View file

@ -69,6 +69,26 @@ function get_all_xprofile_contributor_hours_teams(): array {
return $users;
}
/**
*
* Reconfigures xprofile data to be in indexed array.
*
* @return array
*/
function get_all_xprofile_contributors_indexed(): array {
$all_data = get_all_xprofile_contributor_hours_teams();
$newdata = array();
foreach ( $all_data as $contributor ) {
$newdata[ $contributor->user_id ] = [
'hours_per_week' => $contributor->hours_per_week,
'team_names' => $contributor->team_names,
];
}
return $newdata;
}
/**
* Pull relevant data from profiles.wordpress.org.
*