Skip to content

Commit

Permalink
Fix pledge activation URL
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pkevan authored Feb 5, 2024
1 parent d96a9ff commit 932e503
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/wporg-5ftf/includes/pledge.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ function is_active_pledge( $post_id ) {
* @return int|WP_Error Post ID on success. Otherwise WP_Error.
*/
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(
'post_type' => CPT_ID,
'post_title' => $name,
Expand All @@ -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.

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;
Expand Down

0 comments on commit 932e503

Please sign in to comment.