Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer
    
Thanks. That should hopefully point me in the right direction. –  Joseph Sep 11 '11 at 20:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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