1. Do I need to define a new URL for handling the $_POST request?
No, you don’t need to define new URL.
2. Which action hook do I need to use for handling such a request?
You can use init
hook.
Sample code
function my_theme_send_email() {
if ( isset( $_POST['email-submission'] ) && '1' == $_POST['email-submission'] ) {
// Send the email...
} // end if
} // end my_theme_send_email
add_action( 'init', 'my_theme_send_email' );
Now you can call your website with POST required POST parameters.
Update:
Executed function on init method
my code
Related Posts:
- Can I programmatically login a user without a password?
- SSO / authentication integration with external ‘directory service’
- What is $interim_login?
- Adding extra authentication field in login page
- What exactly is ReAuth?
- Login members using web services
- Disable WordPress 3.6 idle logout / login modal window / session expiration
- How to pass users back and forth using session data?
- Need to execute a cron job
- How to keep always logged in development environment
- how to update current logged user username
- Validate Custom Login field
- Calling wp_signon doesn’t log the user in
- How to implement Google reCaptcha without installing a plugin?
- Is it possible a one click user registration with Facebook or Twitter (or other Social Networks)?
- Are there ways of logging in that bypass wp-login.php altogether?
- How to display username and password after registration
- Completely replacing the login form
- Two factor authentication
- Single sign on with custom site
- Removing wordpress cookie from non-wordpress site
- How to generate “WP_Error” Object for user login?
- Allow Access to Home Page and Login Screen but Nothing Else (unless logged in)
- Where is the php file, that does the checks for login information?
- I want login using email not username wordpress front end
- Reloading page with a query string upon login for admins
- WordPress authentication using custom php?
- Single sign on for multiple domains
- authenticate user without redirecting
- Multiple issues with Ajax login function due to browsers and cookies
- How to post frontend login form to a different authentication script from wp-login?
- Custom user roles are unable to login
- Using WordPress login for a non word-press website
- Extend Cookie with auth_cookie_expiration not working
- Can we start session from another php site to wordpress blog site?
- Opening protected page with cookie?
- External Authentication
- Login and register by API
- How to login with email only no username?
- Removing username from the ‘wordpress_logged_in’ cookie
- Woocommerce registration page [closed]
- Share login data/cookies between multiple installations
- Is it possible to sign in with user_email in WordPress?
- How to use current_user_can()?
- WordPress registration message
- How can I create a separate blog that is private?
- Email address or username used to login in wordpress
- How to customise wp-login.php only for users who are setting a password for the first time?
- Remove built in wordpress login and use only google auth
- Login redirect_to loop with reauth=1, cookie expiry set to 1 year in past
- User Login Form Outside the Default wp-login Form
- I am not able to login to my wp-admin panel
- Block Logged-Out User Access to Directory Outside of WordPress using .htaccess and PHP file
- how to logout user on browser tab or window closes
- Integrate WordPress Blog with Moodle LMS
- Auto login user with link from Mail
- To be able to login as different user
- How do I Create Forums with bbpress Plugin that can only be Viewed by Logged in Users
- Add class to input form in login form
- Can’t Login to WordPress, No Data Received Error
- Unable to access website admin page – 500 error – how to change landing page
- WordPress/Buddypress login theme function [closed]
- How to redirect to specific BLOG Dashboard (after login to Multi-Site)
- How to use a custom login template and still have it linked to the wp-login.php instead of creating a new page?
- Login again after profile update
- Redirect wp-login
- Auto Login After Registration
- Changed Wordress Address URL Accidently
- How to check if user is logged into wordpress on non-wordpress pages
- How to authenticate a user with an external webservice
- Login failed after cloning live wordpress site to local wampserver
- Remove a message in login page
- Login form not saving values when login incorrect
- Is it possible to integrate a custom login feature with wordpress?
- Moving from one host to another – cannot access the dashboard
- I need to find which is the file that checks the DB for correct login (username, password)
- Abnormal activity at url /my-account/add-payment-method/
- Login Based on ip
- Blacklist and Whitelist on login
- URL Restrictions? Need only people who are logged in AND have a specific role (or roles) to access all pages for a site
- How to add custom authentication to wordpress login and register
- The same session information for peer users on two different WordPress servers
- WordPress new version Version 5.3.2, user login not working after upgrade
- How the wordpress login and signup in react native app
- Link Users to external login db
- WordPress password reset not working
- Change WordPress Login URL to External URL
- New user password confirmation sending wrong URL
- is_logged_in not working after login
- wp_signon() does not authenticate user guidance needed
- How to password protect pages in WordPress
- Creating login for client / customer that will take them to customized part of site
- WP login pages redirect to homepage (cannot login)
- Is there any reason why there’s no “login_header” action at the login page?
- How to get rid of the username of registration form in theme my login wp plugin?
- Register and Connect links: where are they located?
- Give user some feedback when they land on custom login page
- Trouble logging in and/or changing password
- how to add custom word press regisration form in word press 3.5 with out module [closed]
- Warning-session start errors and cannot login to administer