0

I am writing a custom app for a client that is based on BuddyPress and WordPress. One of the requirements is a custom registration form. To accomplish this, I have managed to hack a custom register.php together inside of a child theme which does the trick. The part where I am stuck, however, is getting BP to save my custom fields without hacking the core. I understand that I might be able to use the "user_register" hook to save the fields but I am not sure if that is the best way and if it is where in the database to store the custom fields. Can anyone point me in the right direction? Thanks!

P.S. I also need a second submit button that redirects to a different page than the normal one for further processing but I may be able to figure this out myself.

0

Without hacking core files your only option is to use user_register hook to save the custom fields and usually custom fields should be stored in the corresponding object meta table, meaning that if its user meta then store it in the usermeta table and if its post meta then store it in the postmeta table.

As for redirecting after the submit, that really depends on how your form works, if its the regular form then you can simply add an hidden field with the redirect value, something like:

<input type="hidden" name="redirect_to" value="http://www.domain.com/redirect_to_here"/>

but if the form is custom and not really using the built in registration form then take a look at wp_redirect() function.

  • Thanks. That should hopefully point me in the right direction. – Joseph Leedy Sep 11 '11 at 20:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.