Tagged: FEF alter submitted values?
May 7, 2019 at 6:37 pm #9383devr52Participant
I am attempting to create a custom user registration front end form.
I would like to validate some fields and change some fields upon submission /before/ they are saved to the db.
Attempting to use the
piklist_save_fieldsaction gets a nasty data structure internal to piklist that has all of the submitted field contents.
I don’t want my code to have to depend on understanding that structure.
Is there a straight-forward way to subscribe to a specific form submission, and get access to modify the $_REQUEST before piklist does its thing?
E.g., I want to set username = md5(email) or maybe just esc_text(email).
I also want to force the role to ” (empty), so I have it as a hidden piklist, but obviously don’t want to allow someone to elevate their role.
The documentation has a list of filters, but not of the actions inside piklist. I found it by grepping.
April 19, 2020 at 3:44 pm #10631courtensParticipant
I am trying to do something similar. And I am not sure if it is a good idea to misuse the “Demo User Types” example for that.
Did you get it to work? And what did you end up doing?
April 19, 2020 at 11:06 pm #10633devr52Participant
It wasn’t simple, and it took a fairly large amount of time to make work, including modifying piklist itself, new custom js, and figuring out all the right wp hooks to use (and the docs on the register/login flow hooks are terrible since the entire thing changed at some point).
- You must be logged in to reply to this topic.