mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-04-22 11:03:43 +03:00
parent
62f5335b51
commit
c10699f97c
|
@ -158,12 +158,14 @@ function remove_contributor( $contributor_post_id ) {
|
|||
*
|
||||
* @param int $pledge_id The post ID of the pledge.
|
||||
* @param string $status Optional. 'all', 'pending', or 'publish'.
|
||||
* @param int $contributor_id Optional. Retrieve a specific contributor instead of all.
|
||||
*
|
||||
* @return array An array of contributor posts. If $status is set to 'all', will be
|
||||
* a multidimensional array with keys for each status.
|
||||
*/
|
||||
function get_pledge_contributors( $pledge_id, $status = 'publish' ) {
|
||||
function get_pledge_contributors( $pledge_id, $status = 'publish', $contributor_id = null ) {
|
||||
$args = array(
|
||||
'page_id' => $contributor_id,
|
||||
'post_type' => CPT_ID,
|
||||
'post_parent' => $pledge_id,
|
||||
'numberposts' => -1,
|
||||
|
|
|
@ -220,6 +220,13 @@ function save_pledge( $pledge_id, $pledge ) {
|
|||
}
|
||||
|
||||
save_pledge_meta( $pledge_id, $submitted_meta );
|
||||
|
||||
if ( filter_input( INPUT_POST, 'resend-contributor-confirmation' ) ) {
|
||||
PledgeForm\send_contributor_confirmation_emails(
|
||||
$pledge_id,
|
||||
filter_input( INPUT_GET, 'resend-contributor-id', FILTER_VALIDATE_INT )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,15 +31,19 @@ namespace WordPressDotOrg\FiveForTheFuture\View;
|
|||
<?php echo get_avatar( $contributor->user_email, 32 ); ?>
|
||||
<?php echo esc_html( $contributor_post->post_title ); ?>
|
||||
<!-- TODO These buttons don't do anything yet.
|
||||
<button class="button-primary" data-action="remove" data-contributor-post="<?php echo esc_attr( $contributor_post->ID ); ?>">
|
||||
<button class="button-primary" data-action="remove-contributor" data-contributor-post="<?php echo esc_attr( $contributor_post->ID ); ?>">
|
||||
<?php esc_html_e( 'Remove', 'wporg' ); ?>
|
||||
</button>
|
||||
<?php if ( 'pending' === $contributor_post->post_status ) : ?>
|
||||
<button class="button-secondary" data-action="resend-confirmation" data-contributor-post="<?php echo esc_attr( $contributor_post->ID ); ?>">
|
||||
<?php esc_html_e( 'Resend confirmation', 'wporg' ); ?>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
-->
|
||||
<?php if ( 'pending' === $contributor_post->post_status ) : ?>
|
||||
<?php submit_button(
|
||||
'Resend Confirmation',
|
||||
'secondary',
|
||||
'resend-contributor-confirmation',
|
||||
false,
|
||||
array( 'formaction' => add_query_arg( 'resend-contributor-id', $contributor_post->ID ) )
|
||||
); ?>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
|
Loading…
Reference in a new issue