mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-07 03:05:44 +03:00
Add the "Request Manage Link" form to the manage pledge page
When a pledge is selected but the auth token is missing/incorrect, this will give a clear path for re-requesting a new valid manage link
This commit is contained in:
parent
d737f70a7e
commit
746de99787
7 changed files with 111 additions and 66 deletions
34
plugins/wporg-5ftf/views/form-request-manage-link.php
Normal file
34
plugins/wporg-5ftf/views/form-request-manage-link.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace WordPressDotOrg\FiveForTheFuture\View;
|
||||
use WordPressDotOrg\FiveForTheFuture\Pledge;
|
||||
|
||||
defined( 'WPINC' ) || die();
|
||||
|
||||
$pledge_id = ( Pledge\CPT_ID === get_post_type() ) ? get_post()->ID : absint( $_REQUEST['pledge_id'] ?? 0 );
|
||||
?>
|
||||
|
||||
<form method="post" class="pledge-email-form">
|
||||
<input type="hidden" name="pledge_id" value="<?php echo esc_attr( $pledge_id ); ?>" />
|
||||
|
||||
<label for="pledge_admin_address">
|
||||
<?php esc_html_e( 'Email Address', 'wporg-5ftf' ); ?>
|
||||
</label>
|
||||
|
||||
<input
|
||||
id="pledge_admin_address"
|
||||
name="pledge_admin_address"
|
||||
type="email"
|
||||
required
|
||||
value=""
|
||||
/>
|
||||
|
||||
<div class="message"></div>
|
||||
|
||||
<input
|
||||
type="submit"
|
||||
class="button"
|
||||
name="get_manage_pledge_link"
|
||||
value="<?php esc_attr_e( 'Submit', 'wporg-5ftf' ); ?>"
|
||||
/>
|
||||
</form>
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace WordPressDotOrg\FiveForTheFuture\View;
|
||||
use function WordPressDotOrg\FiveForTheFuture\get_views_path;
|
||||
|
||||
defined( 'WPINC' ) || die();
|
||||
|
||||
|
@ -16,30 +17,7 @@ defined( 'WPINC' ) || die();
|
|||
<?php esc_html_e( "If you're the admin, enter your email address and a confirmation link will be sent to you.", 'wporg-5ftf' ); ?>
|
||||
</p>
|
||||
|
||||
<form method="post">
|
||||
<input type="hidden" name="pledge_id" value="<?php echo esc_attr( get_post()->ID ); ?>" />
|
||||
|
||||
<label for="pledge_admin_address">
|
||||
<?php esc_html_e( 'Email Address', 'wporg-5ftf' ); ?>
|
||||
</label>
|
||||
|
||||
<input
|
||||
id="pledge_admin_address"
|
||||
name="pledge_admin_address"
|
||||
type="email"
|
||||
required
|
||||
value=""
|
||||
/>
|
||||
|
||||
<div class="message"></div>
|
||||
|
||||
<input
|
||||
type="submit"
|
||||
class="button"
|
||||
name="get_manage_pledge_link"
|
||||
value="<?php esc_attr_e( 'Submit', 'wporg-5ftf' ); ?>"
|
||||
/>
|
||||
</form>
|
||||
<?php require get_views_path() . 'form-request-manage-link.php'; ?>
|
||||
<button type="button" class="button button-link pledge-dialog__close" aria-label="Close"><span class="dashicons dashicons-no-alt" aria-hidden="true"></span></button></div>
|
||||
</div>
|
||||
</script>
|
||||
|
|
24
plugins/wporg-5ftf/views/partial-request-manage-link.php
Normal file
24
plugins/wporg-5ftf/views/partial-request-manage-link.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace WordPressDotOrg\FiveForTheFuture\View;
|
||||
use const WordPressDotOrg\FiveForTheFuture\Pledge\CPT_ID;
|
||||
use function WordPressDotOrg\FiveForTheFuture\get_views_path;
|
||||
|
||||
defined( 'WPINC' ) || die();
|
||||
|
||||
$pledge_id = ( CPT_ID === get_post_type() ) ? get_post()->ID : absint( $_REQUEST['pledge_id'] ?? 0 );
|
||||
$pledge_name = get_the_title( $pledge_id );
|
||||
?>
|
||||
|
||||
<div id="send-link-dialog">
|
||||
<?php require get_views_path() . 'partial-result-messages.php'; ?>
|
||||
|
||||
<p>
|
||||
<?php echo esc_html( sprintf(
|
||||
__( "If you're the admin for %s, enter your email address and a confirmation link will be sent to you.", 'wporg-5ftf' ),
|
||||
$pledge_name
|
||||
) ); ?>
|
||||
</p>
|
||||
|
||||
<?php require get_views_path() . 'form-request-manage-link.php'; ?>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue