Add field to Register page

Hi,

I want to add extra field (site-categories to be precise) to register form and make it mandatory.

I already added the field in the form but not sure how to make it so it gets saved in database (I'm assuming it will be metadata)

Do I need to alter the register function or what would be the best aproach?

Thanks for help.

  • @rjcalifornia I really appreciate your help I just wanted to make sure I don't have to unregister first, before registering new action. I thought I read somewhere that you need to unregister first.

    @Beck24 where can I find examples or reference how to hook into 'create', 'user' event ? Thanks.

    @juho.jaakkola

    I have input/categories in register form. So what you are suggesting is add "elgg_register_plugin_hook_handler" and the "save_user_categories" function in my plugin?

    I'll try that thanks a lot.

     

  • Yes, in the plugin init function call:

    elgg_register_plugin_hook_handler('route', 'action/register', 'save_user_categories');

    And the same for the 'register', 'user' hook.