Custom meta not imported into Multisite registration
-
I’ve created a custom plugin for my network, and part of its functionality is to customize the registration. I’ve chosen this route because many of the plugins that I have seen for multisite registration customization don’t quite fit my needs.
The problem that I’m having seems to be due to the two-step registration process. While I’m able to add extra fields to the registration form, and capture the data into the meta column of the wp_signups table, I’m finding that the meta data is not being processed when the new user actually goes on and uses the link in the email they’re sent to activate. Here’s the bit of code I currently have that is supposed to process the meta data I capture earlier:
add_action( 'wpmu_activate_user', 'jp_add_user_meta', 10, 3 ); function jp_add_user_meta( $user_id, $password, $meta ) { foreach ( $meta as $key => $value ) { if ( $key == 'first_name' || $key == 'last_name' ) { update_user_meta( $user_id, $key, $value ); } else { add_user_meta( $user_id, $key, $value ); } } // Make sure all users are added to the main site add_user_to_blog( '1', $user_id, 'subscriber' ); return $user_id; }
I feel that I’m missing something obvious somewhere, but I haven’t been able to figure out exactly what yet, and so I would appreciate any guidance that anyone has.
- The topic ‘Custom meta not imported into Multisite registration’ is closed to new replies.