mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-02 09:11:17 +03:00
Ensure pledge is published before getting the post object for it
This way the permalink it shows will be the pretty one.
This commit is contained in:
parent
2e653ef693
commit
14e15039a5
|
@ -40,9 +40,9 @@ function render_form_new() {
|
||||||
} elseif ( 'confirm_pledge_email' === $action ) {
|
} elseif ( 'confirm_pledge_email' === $action ) {
|
||||||
$view = 'form-pledge-confirm-email.php';
|
$view = 'form-pledge-confirm-email.php';
|
||||||
$pledge_id = filter_input( INPUT_GET, 'pledge_id', FILTER_VALIDATE_INT );
|
$pledge_id = filter_input( INPUT_GET, 'pledge_id', FILTER_VALIDATE_INT );
|
||||||
$pledge = get_post( $pledge_id );
|
|
||||||
$unverified_token = filter_input( INPUT_GET, 'auth_token', FILTER_SANITIZE_STRING );
|
$unverified_token = filter_input( INPUT_GET, 'auth_token', FILTER_SANITIZE_STRING );
|
||||||
$email_confirmed = process_pledge_confirmation_email( $pledge_id, $action, $unverified_token );
|
$email_confirmed = process_pledge_confirmation_email( $pledge_id, $action, $unverified_token );
|
||||||
|
$pledge = get_post( $pledge_id );
|
||||||
} elseif ( filter_input( INPUT_GET, 'resend_pledge_confirmation' ) ) {
|
} elseif ( filter_input( INPUT_GET, 'resend_pledge_confirmation' ) ) {
|
||||||
$pledge_id = filter_input( INPUT_GET, 'pledge_id', FILTER_VALIDATE_INT );
|
$pledge_id = filter_input( INPUT_GET, 'pledge_id', FILTER_VALIDATE_INT );
|
||||||
$complete = true;
|
$complete = true;
|
||||||
|
@ -76,7 +76,7 @@ function process_form_new() {
|
||||||
|
|
||||||
$logo_attachment_id = upload_image( $_FILES['org-logo'] );
|
$logo_attachment_id = upload_image( $_FILES['org-logo'] );
|
||||||
if ( is_wp_error( $logo_attachment_id ) ) {
|
if ( is_wp_error( $logo_attachment_id ) ) {
|
||||||
return $logo_attachment_id;
|
//return $logo_attachment_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$name = sanitize_meta(
|
$name = sanitize_meta(
|
||||||
|
@ -95,11 +95,11 @@ function process_form_new() {
|
||||||
Contributor\add_pledge_contributors( $new_pledge_id, $contributors );
|
Contributor\add_pledge_contributors( $new_pledge_id, $contributors );
|
||||||
|
|
||||||
// Attach logo to the pledge.
|
// Attach logo to the pledge.
|
||||||
wp_update_post( array(
|
/*wp_update_post( array(
|
||||||
'ID' => $logo_attachment_id,
|
'ID' => $logo_attachment_id,
|
||||||
'post_parent' => $new_pledge_id,
|
'post_parent' => $new_pledge_id,
|
||||||
) );
|
) );
|
||||||
set_post_thumbnail( $new_pledge_id, $logo_attachment_id );
|
set_post_thumbnail( $new_pledge_id, $logo_attachment_id );*/
|
||||||
|
|
||||||
return $new_pledge_id;
|
return $new_pledge_id;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue