WordPress.org

Forums

Store custom signup fields (4 posts)

  1. mm_anders
    Member
    Posted 4 years ago #

    I've been researching this for two days and now I give up, please tell me how to achieve the following:

    I have custom user fields added to wp-signup.php through signup_extra_fields. Among those is a file field for user photo upload but I've fixed the multipart/data problem via JS.

    The user fills out all the fields and hits "Register!", after this I want to do the following:

    1) Extract my custom fields data from the $_POST and store in database
    2) Link the new user's id to the new post in my database table

    I know how to write the code to do 1) and 2) but I don't know what WP action to use to be able to access the custom data before that stuff magically disappears from the $_POST (by the time I reach signup stage 2 it has disappeared).
    Which add_action('hook_name','my_intercepting_function') should I use?
    Or do I need to use a filter and if so, does that need to be installed with the plugin or can I add it in the plugin PHP-file later?

  2. Tim Moore
    Moderator
    Posted 4 years ago #

  3. mm_anders
    Member
    Posted 4 years ago #

    I've tried that one but it won't trigger, I've put this in my main plugin PHP file:

    add_action('register_post','mm_handle_registration',10,3);
    function mm_handle_registration($login,$email,$errors)
    {
    	print_r($_POST);
    	echo "Test:<br>$login,$email,$errors<br>";
    	die;
    }

    But I never see that code...

  4. mm_anders
    Member
    Posted 4 years ago #

    Furthermore, by looking at this link it seems that register_post is only called in wp-login.php

Topic Closed

This topic has been closed to new replies.

About this Topic