Redirect after form submission using admin_post hook
-
Hi,
I’ve created a custom form that sends an email when a users fills-in some data and clicks send. This form points to admin-post.php:
<form action="<?php echo esc_url( admin_url('admin-post.php') ); ?>" method="post"> // My code </form>
I use a function hooked to:
add_action( 'admin_post_nopriv_send_my_email', 'send_my_email' ); add_action( 'admin_post_send_my_email', 'send_my_email' );
When after processing the data I use wp_redirect to come back to the same page or other pages it just doesn’t work. Headers have been sent. How to overcome this?
The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Redirect after form submission using admin_post hook’ is closed to new replies.