I am using the Formidable Form Pro plugin for a job post form. On the last page of the form, the fields for first name, last name, and email address are required. If a user fills out the form for the first time, they should automatically create a user account using the provided email address, and the job post should be successfully submitted. However, if a user enters an email address that is already registered, they currently receive a validation error stating that the email already exists. I want to modify the plugin code so that if a user enters an existing email address, the user creation is ignored, and they can still post the job, with the job being linked to the entered email address. I am seeking assistance on how to resolve this issue.
First, never modify Formidable's code. Formidable uses the WordPress user data hooks. WordPress is rejecting the email, not Formidable. WordPress only allows a single email address per user. Formidable is loaded with WordPress hooks that you can use to alter Formidable's behavior. I would use frm_before_create_entry and frm_before_update_entry to see if the user exists, if it does, bypass the user creation process and update the user if necessary.
Please login or Register to submit your answer