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

@ -12,11 +12,12 @@ namespace WordPressDotOrg\FiveForTheFuture\View;
<input
type="checkbox"
id="5ftf-pledge-agree"
name="pledge-agree"
id="5ftf-pledge-agreement"
name="pledge-agreement"
required
<?php checked( $data['pledge-agreement'] ); ?>
/>
<label for="5ftf-pledge-agree">
<label for="5ftf-pledge-agreement">
<?php esc_html_e( 'I agree', 'wordpressorg' ); ?>
</label>
</div>