Add a helper function to fetch pledge data

This commit is contained in:
Kelly Dwan 2019-10-08 12:54:00 -04:00
parent 0111c36db4
commit 61ef972391
No known key found for this signature in database
GPG key ID: 8BA5575F3D11575D
2 changed files with 35 additions and 6 deletions

View file

@ -1,6 +1,6 @@
<?php
/**
*
* Render and process the pledge forms.
*/
namespace WordPressDotOrg\FiveForTheFuture\PledgeForm;
@ -25,6 +25,7 @@ function render_form_new() {
$action = filter_input( INPUT_POST, 'action' );
$messages = [];
$complete = false;
$data = PledgeMeta\get_pledge_meta();
if ( 'Submit Pledge' === $action ) {
$processed = process_form_new();
@ -93,6 +94,9 @@ function render_form_manage() {
$messages = [];
$updated = false;
// @todo Get pledge ID from somewhere.
$data = PledgeMeta\get_pledge_meta();
if ( 'Update Pledge' === $action ) {
$processed = process_form_manage();