New Pledge: Validate submitted form values and generate a draft pledge post (#35)

Ensures that a submission to the new pledge form has:

* A unique email address compared to existing pledges
* A unique domain in the URL, compared to existing pledges
* Has at least one valid contributor listed

Error messages when one or more of these conditions isn't met are descriptive so that the submitter can correct the issue.

Fixes #15
This commit is contained in:
Corey McKrill 2019-10-18 16:56:21 -07:00 committed by GitHub
parent 78822c4323
commit 9c08692d5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 202 additions and 55 deletions

View file

@ -16,7 +16,7 @@ namespace WordPressDotOrg\FiveForTheFuture\View;
type="text"
id="5ftf-pledge-contributors"
name="pledge-contributors"
value=""
value="<?php echo esc_attr( $data['pledge-contributors'] ); ?>"
required
aria-describedby="5ftf-pledge-contributors-help"
/>