mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-04-22 02:53:43 +03:00
My Pledges: Prompt to fill out profile data if haven't already.
This commit is contained in:
parent
0c250daa7d
commit
5c50b1fcc6
|
@ -101,6 +101,11 @@ function get_contributor_user_data( $user_id ) {
|
||||||
$formatted_data = array();
|
$formatted_data = array();
|
||||||
$raw_data = get_xprofile_contribution_data( array( $user_id ) );
|
$raw_data = get_xprofile_contribution_data( array( $user_id ) );
|
||||||
|
|
||||||
|
$defaults = array(
|
||||||
|
'hours_per_week' => 0,
|
||||||
|
'team_names' => array(),
|
||||||
|
);
|
||||||
|
|
||||||
foreach ( $raw_data as $datum ) {
|
foreach ( $raw_data as $datum ) {
|
||||||
$key = array_search( $datum['field_id'], FIELD_IDS );
|
$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;
|
return $formatted_data;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ $has_contributions = $contributor_pending_posts || $contributor_publish_posts;
|
||||||
<?php esc_html_e( 'My Pledges', 'wporg-5ftf' ); ?>
|
<?php esc_html_e( 'My Pledges', 'wporg-5ftf' ); ?>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
|
<?php if ( $profile_data['hours_per_week'] && $profile_data['team_names'] ) : ?>
|
||||||
<p class="my-pledges__dedication">
|
<p class="my-pledges__dedication">
|
||||||
<?php echo esc_html( sprintf(
|
<?php echo esc_html( sprintf(
|
||||||
_n(
|
_n(
|
||||||
|
@ -42,6 +43,18 @@ $has_contributions = $contributor_pending_posts || $contributor_publish_posts;
|
||||||
count( $confirmed_pledge_ids )
|
count( $confirmed_pledge_ids )
|
||||||
) ); ?>
|
) ); ?>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<?php else : ?>
|
||||||
|
<div class="notice notice-warning notice-alt">
|
||||||
|
<p>
|
||||||
|
<?php echo wp_kses_data( sprintf(
|
||||||
|
__( 'Please <a href="%s">update your profile</a> with the <strong>number of hours per week</strong> that you contribute, and the <strong>teams</strong> that you contribute to.', 'wporg-5ftf' ),
|
||||||
|
'https://profiles.wordpress.org/me/profile/edit/group/5/'
|
||||||
|
) ); ?>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<?php if ( $success_message ) : ?>
|
<?php if ( $success_message ) : ?>
|
||||||
|
|
Loading…
Reference in a new issue