diff --git a/plugins/wporg-5ftf/includes/reports.php b/plugins/wporg-5ftf/includes/reports.php index 43451cc..465d6a4 100644 --- a/plugins/wporg-5ftf/includes/reports.php +++ b/plugins/wporg-5ftf/includes/reports.php @@ -186,7 +186,7 @@ function render_contributor_report_page() { } $all_contributor_data = XProfile\get_all_xprofile_contributors_indexed(); -?> + ?>

Total: Status: @@ -214,13 +214,16 @@ function render_contributor_report_page() { Last login Status -post_parent ); $pledge_company_title = get_the_title( $pledge_company ) ?? 'unattached'; $user_id = get_post_meta( $c->ID, 'wporg_user_id', true ); - $xprofile = $all_contributor_data[ $user_id ] ?? [ 'team_names' => [], 'hours_per_week' => 0 ]; + $xprofile = $all_contributor_data[ $user_id ] ?? [ + 'team_names' => [], + 'hours_per_week' => 0 + ]; $xprofile_teams = $xprofile['team_names'] ?? []; $user = get_user_by( 'ID', $user_id ); $last_login = get_user_meta( $user_id, 'last_logged_in', true ); @@ -241,7 +244,6 @@ function render_contributor_report_page() { echo ''; set_transient( 'wporg_5ftf_contributor_report_' . $status, $export_data, 2 * MINUTE_IN_SECONDS ); - } /** * CSV export runner, grabs data lazily from a transient. @@ -271,7 +273,6 @@ function export_csv() { /** * Export contributors as a CSV, also from transient. - * */ function export_contributors_csv() { diff --git a/plugins/wporg-5ftf/includes/xprofile.php b/plugins/wporg-5ftf/includes/xprofile.php index 298eef8..fa7b25a 100644 --- a/plugins/wporg-5ftf/includes/xprofile.php +++ b/plugins/wporg-5ftf/includes/xprofile.php @@ -76,12 +76,14 @@ function get_all_xprofile_contributor_hours_teams(): 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 ]; + $newdata[ $contributor->user_id ] = [ + 'hours_per_week' => $contributor->hours_per_week, + 'team_names' => $contributor->team_names, + ]; } return $newdata;