mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-10 04:25:44 +03:00
My Pledges: Prompt to fill out profile data if haven't already.
This commit is contained in:
parent
0c250daa7d
commit
5c50b1fcc6
2 changed files with 32 additions and 12 deletions
|
@ -101,6 +101,11 @@ function get_contributor_user_data( $user_id ) {
|
|||
$formatted_data = array();
|
||||
$raw_data = get_xprofile_contribution_data( array( $user_id ) );
|
||||
|
||||
$defaults = array(
|
||||
'hours_per_week' => 0,
|
||||
'team_names' => array(),
|
||||
);
|
||||
|
||||
foreach ( $raw_data as $datum ) {
|
||||
$key = array_search( $datum['field_id'], FIELD_IDS );
|
||||
|
||||
|
@ -114,5 +119,7 @@ function get_contributor_user_data( $user_id ) {
|
|||
}
|
||||
}
|
||||
|
||||
$formatted_data = array_merge( $defaults, $formatted_data );
|
||||
|
||||
return $formatted_data;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue