Already registered user issue

By: Talha Ijaz | Asked: 06/07/2023
ForumsCategory: Code HelpAlready registered user issue
Talha Ijaz asked 11 months ago
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.
1 Answers
Victor Font answered 11 months ago
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.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community