mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-07 19:25:44 +03:00
Submit the form through ajax
This commit is contained in:
parent
8d63e8d4e6
commit
cb571a176b
6 changed files with 41 additions and 10 deletions
|
@ -109,7 +109,7 @@ function send_manage_email_handler() {
|
|||
}
|
||||
} else {
|
||||
$error_message = sprintf(
|
||||
__( 'That\'s not the address that we have for this pledge, please try a different one. If none of the addresses you try are working, please <a href="%s">email us</a> for help.', 'wporg-5ftf' ),
|
||||
__( 'That\'s not the address that we have for this pledge. If you don\'t know the email associated with this pledge, <a href="%s">please contact us for help.</a>', 'wporg-5ftf' ),
|
||||
get_permalink( get_page_by_path( 'report' ) )
|
||||
);
|
||||
|
||||
|
|
|
@ -273,7 +273,8 @@ function enqueue_assets() {
|
|||
wp_enqueue_script( '5ftf-frontend', plugins_url( 'assets/js/frontend.js', __DIR__ ), [ 'jquery', 'wp-util', 'wicg-inert' ], $ver, true );
|
||||
|
||||
$script_data = [
|
||||
'pledgeId' => get_the_ID(),
|
||||
'ajaxurl' => admin_url( 'admin-ajax.php', 'relative' ), // The global ajaxurl is not set on the frontend.
|
||||
'pledgeId' => get_the_ID(),
|
||||
'ajaxNonce' => wp_create_nonce( 'send-manage-email' ),
|
||||
];
|
||||
wp_add_inline_script(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue