mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-01 16:51:18 +03:00
Fix pledge activation URL
The post id being sent by email contained the pledge ID instead of the ID for form page, this fixes that are restores the ability to confirm email address.
This commit is contained in:
parent
d96a9ff931
commit
932e503a06
|
@ -350,6 +350,8 @@ function is_active_pledge( $post_id ) {
|
||||||
* @return int|WP_Error Post ID on success. Otherwise WP_Error.
|
* @return int|WP_Error Post ID on success. Otherwise WP_Error.
|
||||||
*/
|
*/
|
||||||
function create_new_pledge( $name ) {
|
function create_new_pledge( $name ) {
|
||||||
|
// Grab the ID of the post we are on before inserting a pledge.
|
||||||
|
$pledge_form_post_id = get_post()->ID;
|
||||||
$args = array(
|
$args = array(
|
||||||
'post_type' => CPT_ID,
|
'post_type' => CPT_ID,
|
||||||
'post_title' => $name,
|
'post_title' => $name,
|
||||||
|
@ -360,7 +362,7 @@ function create_new_pledge( $name ) {
|
||||||
// The pledge's meta data is saved at this point via `save_pledge_meta()`, which is a `save_post` callback.
|
// The pledge's meta data is saved at this point via `save_pledge_meta()`, which is a `save_post` callback.
|
||||||
|
|
||||||
if ( ! is_wp_error( $pledge_id ) ) {
|
if ( ! is_wp_error( $pledge_id ) ) {
|
||||||
Email\send_pledge_confirmation_email( $pledge_id, get_post()->ID );
|
Email\send_pledge_confirmation_email( $pledge_id, $pledge_form_post_id );
|
||||||
}
|
}
|
||||||
|
|
||||||
return $pledge_id;
|
return $pledge_id;
|
||||||
|
|
Loading…
Reference in a new issue