mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-04 10:05:43 +03:00
Add a helper function to fetch pledge data
This commit is contained in:
parent
0111c36db4
commit
61ef972391
2 changed files with 35 additions and 6 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue