mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-02 01:01:18 +03:00
phpcs
This commit is contained in:
parent
a26287cd68
commit
49fe6d8e95
|
@ -220,7 +220,10 @@ function render_contributor_report_page() {
|
||||||
$pledge_company = get_post( $c->post_parent );
|
$pledge_company = get_post( $c->post_parent );
|
||||||
$pledge_company_title = get_the_title( $pledge_company ) ?? 'unattached';
|
$pledge_company_title = get_the_title( $pledge_company ) ?? 'unattached';
|
||||||
$user_id = get_post_meta( $c->ID, 'wporg_user_id', true );
|
$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'] ?? [];
|
$xprofile_teams = $xprofile['team_names'] ?? [];
|
||||||
$user = get_user_by( 'ID', $user_id );
|
$user = get_user_by( 'ID', $user_id );
|
||||||
$last_login = get_user_meta( $user_id, 'last_logged_in', true );
|
$last_login = get_user_meta( $user_id, 'last_logged_in', true );
|
||||||
|
@ -241,7 +244,6 @@ function render_contributor_report_page() {
|
||||||
echo '</table>';
|
echo '</table>';
|
||||||
|
|
||||||
set_transient( 'wporg_5ftf_contributor_report_' . $status, $export_data, 2 * MINUTE_IN_SECONDS );
|
set_transient( 'wporg_5ftf_contributor_report_' . $status, $export_data, 2 * MINUTE_IN_SECONDS );
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* CSV export runner, grabs data lazily from a transient.
|
* CSV export runner, grabs data lazily from a transient.
|
||||||
|
@ -271,7 +273,6 @@ function export_csv() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Export contributors as a CSV, also from transient.
|
* Export contributors as a CSV, also from transient.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
function export_contributors_csv() {
|
function export_contributors_csv() {
|
||||||
|
|
||||||
|
|
|
@ -76,12 +76,14 @@ function get_all_xprofile_contributor_hours_teams(): array {
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function get_all_xprofile_contributors_indexed() : array {
|
function get_all_xprofile_contributors_indexed() : array {
|
||||||
|
|
||||||
$all_data = get_all_xprofile_contributor_hours_teams();
|
$all_data = get_all_xprofile_contributor_hours_teams();
|
||||||
|
|
||||||
$newdata = array();
|
$newdata = array();
|
||||||
foreach ( $all_data as $contributor ) {
|
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;
|
return $newdata;
|
||||||
|
|
Loading…
Reference in a new issue