mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-04-22 11:03:43 +03:00
Pledge Form: Make email naming consistent.
This helps distinguish between _pledge_ and _contributor_ emails, and _verifying_ auth tokens and _confirming_ pledges.
This commit is contained in:
parent
35fa99324e
commit
c4f2fe58ab
|
@ -61,7 +61,7 @@ function send_email( $to, $subject, $message ) {
|
|||
* @param int $pledge_id
|
||||
* @param string $action
|
||||
* @param int $action_page_id The ID of the page that the user will be taken back to, in order to process their
|
||||
* verification request.
|
||||
* confirmation request.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
|
|
@ -40,7 +40,7 @@ function render_form_new() {
|
|||
$view = 'form-pledge-confirm-email.php';
|
||||
$pledge_id = filter_input( INPUT_GET, 'pledge_id', FILTER_VALIDATE_INT );
|
||||
$unverified_token = filter_input( INPUT_GET, 'auth_token', FILTER_SANITIZE_STRING );
|
||||
$email_confirmed = process_email_confirmation( $pledge_id, $action, $unverified_token );
|
||||
$email_confirmed = process_pledge_confirmation_email( $pledge_id, $action, $unverified_token );
|
||||
}
|
||||
|
||||
ob_start();
|
||||
|
@ -126,7 +126,7 @@ function process_form_new() {
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
function process_email_confirmation( $pledge_id, $action, $unverified_token ) {
|
||||
function process_pledge_confirmation_email( $pledge_id, $action, $unverified_token ) {
|
||||
$meta_key = PledgeMeta\META_PREFIX . 'pledge-email-confirmed';
|
||||
$already_confirmed = get_post( $pledge_id )->$meta_key;
|
||||
|
||||
|
|
|
@ -135,7 +135,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 ) ) {
|
||||
send_pledge_verification_email( $pledge_id, get_post()->ID );
|
||||
send_pledge_confirmation_email( $pledge_id, get_post()->ID );
|
||||
}
|
||||
|
||||
return $pledge_id;
|
||||
|
@ -146,11 +146,11 @@ function create_new_pledge( $name ) {
|
|||
*
|
||||
* @param int $pledge_id The ID of the pledge.
|
||||
* @param int $action_page_id The ID of the page that the user will be taken back to, in order to process their
|
||||
* verification request.
|
||||
* confirmation request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function send_pledge_verification_email( $pledge_id, $action_page_id ) {
|
||||
function send_pledge_confirmation_email( $pledge_id, $action_page_id ) {
|
||||
$pledge = get_post( $pledge_id );
|
||||
|
||||
$message =
|
||||
|
|
Loading…
Reference in a new issue