My Pledges: Require profile to be filled out before confirming a pledge (#127)

This will disable the "join organization" button until the profile is complete, and add a second warning message to explicitly tell the user why the button is disabled.
This commit is contained in:
Kelly Dwan 2019-12-11 16:11:13 -05:00 committed by GitHub
parent bdbf6d573e
commit 636753bb00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View file

@ -4,6 +4,7 @@ namespace WordPressDotOrg\FiveForTheFuture\View;
/**
* @var WP_Post $contributor_post
* @var bool $has_profile_data
* @var WP_Post $pledge
*/
@ -51,6 +52,9 @@ namespace WordPressDotOrg\FiveForTheFuture\View;
class="button button-default"
name="join_organization"
value="Join Organization"
<?php if ( ! $has_profile_data ) : ?>
disabled="disabled"
<?php endif; ?>
/>
<input