Add custom registration meta
-
I’m basically trying to add several checkboxs to the registration page so the user can choose what blogs to join however I am unsure of where I can find the code to submit this.
First function adds code to meta in wp-signups works fine.
Second function should get this meta which is does however i cant access anything inside it using the likes of $signup[‘meta’] or $signup[‘$user_id’]
Currently using buddypress hooks should be a similar process.
add_filter( 'bp_signup_usermeta', 'custom_add_signup_meta' ); function custom_add_signup_meta ($meta) { // create an array of custom meta fields $meta['user_blogs'] = $_POST['blogs']; if($meta != null) { return $meta; } } add_filter( 'bp_core_activate_account', 'add_user_to_blogs'); function add_user_to_blogs($signup) { global $bp, $wpdb; $role = 'bbp_participant'; //test output is 1 :S //echo 'ALL = '.print_r($signup).''; foreach ($signup['meta']['user_blogs'] as $key => $value ) { //Stuff } }
Any ideas?
- The topic ‘Add custom registration meta’ is closed to new replies.