1

I am trying to customize a signup process for our MultiSite Network I need to be able to assign levels based on a choice at signup.

My thought is to add a field (hidden or otherwise) that holds the chosen level during signup, and assign that to the registering user somehow, (via meta?) and have that passed along when creating site. I assume there should be a way as their username and email is passed to the database right?

Then when they activate their new site via activation link email, I could run a custom function, (there must be a hook for after site creation) that would grab that meta value I passed along use it in a custom function post activation.

Does this make sense? Thank you for any input!

  • Code behind the paywall is considered not in scope here. Please try to make your question more generic - what is happening (in WordPress core terms) and how you are trying to modify it. – Rarst Jan 3 '14 at 18:58
  • I apologize for that, I edited the question to remove those parts. I am trying to add custom meta on the signup page that can be passed along after activation, and then used in a function after site activation. – thatryan Jan 3 '14 at 20:38
  • what are you using for your sign up form? custom or default? – user44672 Jan 3 '14 at 21:56
  • Just the default form – thatryan Jan 3 '14 at 23:30
0

I know it's a very old question, but I had the same issue and this was never resolved so I thought I'd post a solution. I found the answer in a different topic here on WPSE.

You only have to use the filter add_signup_meta.

function sb_add_signup_meta($meta) {
    // hardcoded value
    $meta['mykey'] = 'My Value';

    // $_POST value from register form
    if ( isset( $_POST[ 'value' ] ) && ! empty( $_POST[ 'value' ] ) ) {
        $meta[ 'meta_key' ] = $_POST[ 'value' ];
    }

    return $meta;
}
add_filter('add_signup_meta', 'sb_add_signup_meta');

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.