mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-10 04:25:44 +03:00
Manage Pledge: Enable Manage Form functionality
* Fix issue with fetching data in `get_pledge_meta` when no submission has been POST'd * Rename to `subset`, since `context` is also used elsewhere * Show form content when there are form errors * Fix warnings on new pledge form * Skip wpautop before save, so editors don’t need to edit HTML unless they want to
This commit is contained in:
parent
b898dc23f3
commit
60b5ca5d2a
4 changed files with 165 additions and 72 deletions
|
@ -1,25 +1,38 @@
|
|||
<?php
|
||||
namespace WordPressDotOrg\FiveForTheFuture\View;
|
||||
|
||||
namespace WordPressDotOrg\FiveForTheFuture\View;
|
||||
use function WordPressDotOrg\FiveForTheFuture\get_views_path;
|
||||
|
||||
/** @var array $messages */
|
||||
/** @var bool $updated */
|
||||
/**
|
||||
* @var bool $can_view_form
|
||||
* @var int $pledge_id
|
||||
* @var string $auth_token
|
||||
*/
|
||||
|
||||
require __DIR__ . '/partial-result-messages.php';
|
||||
|
||||
?>
|
||||
|
||||
<form class="pledge-form" id="5ftf-form-pledge-manage" action="" method="post" enctype="multipart/form-data">
|
||||
<?php
|
||||
require get_views_path() . 'inputs-pledge-org-info.php';
|
||||
require get_views_path() . 'manage-contributors.php';
|
||||
require get_views_path() . 'inputs-pledge-org-email.php';
|
||||
?>
|
||||
<?php if ( true === $can_view_form ) : ?>
|
||||
|
||||
<div>
|
||||
<input
|
||||
type="submit"
|
||||
id="5ftf-pledge-submit"
|
||||
name="action"
|
||||
value="<?php esc_attr_e( 'Update Pledge', 'wporg-5ftf' ); ?>"
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
<form class="pledge-form" id="5ftf-form-pledge-manage" action="" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="pledge_id" value="<?php echo absint( $pledge_id ); ?>" />
|
||||
<input type="hidden" name="auth_token" value="<?php echo esc_attr( $auth_token ); ?>" />
|
||||
|
||||
<?php
|
||||
wp_nonce_field( 'manage_pledge_' . $pledge_id );
|
||||
|
||||
require get_views_path() . 'inputs-pledge-org-info.php';
|
||||
?>
|
||||
|
||||
<div>
|
||||
<input
|
||||
type="submit"
|
||||
id="5ftf-pledge-submit"
|
||||
name="action"
|
||||
value="<?php esc_attr_e( 'Update Pledge', 'wporg-5ftf' ); ?>"
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php endif; ?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue