mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-07 19:25:44 +03:00
Email: Send pledge confirmation with authentication token. (#46)
Email: Send pledge confirmation with authentication token. Fixes #34. Fixes #10.
This commit is contained in:
parent
284e616c84
commit
5ffca9420f
8 changed files with 496 additions and 7 deletions
|
@ -184,10 +184,19 @@ function render_meta_boxes( $pledge, $box ) {
|
|||
* @param WP_Post $pledge
|
||||
*/
|
||||
function save_pledge( $pledge_id, $pledge ) {
|
||||
$action = filter_input( INPUT_GET, 'action' );
|
||||
$get_action = filter_input( INPUT_GET, 'action' );
|
||||
$post_action = filter_input( INPUT_POST, 'action' );
|
||||
$ignored_actions = array( 'trash', 'untrash', 'restore' );
|
||||
|
||||
if ( $action && in_array( $action, $ignored_actions, true ) ) {
|
||||
/*
|
||||
* This is only intended to run when the front end form and wp-admin forms are submitted, not when posts are
|
||||
* programmatically updated.
|
||||
*/
|
||||
if ( 'Submit Pledge' !== $post_action && 'editpost' !== $get_action ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $get_action && in_array( $get_action, $ignored_actions, true ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue