id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses 39223,Add a filter to edit $meta array in wpmu_signup_user,Mista-Flo,,"Hello, Here's the situation. In a multisite context, on a new user form in a site of the network, it creates a new signup entry in the signups database table with user informations, and a meta array containing by default {{{ 'add_to_blog' => $wpdb->blogid, 'new_role' => $_REQUEST['role'] }}}, so when the user is finnaly activated (with email confirmation or not) the {{{wpmu_activate_user}}} function is called and use this $meta array. Imagine you want to extend this behavior and for example, add some user meta in signup to use it for activation. you have the good hook in wpmu_activate_user {{{wpmu_activate_user}}} where you can use the meta array to do what you want, but you can't filter the $meta array in {{{wpmu_signup_user}}} to add some usefull data. For example, for my plugin Multiple Roles : https://wordpress.org/plugins/multiple-roles/ which allow admins to add multiple roles for a given user. In order to handle the multisite behavior, I need to edit this $meta array to pass it my multiple roles array. So according to me, the best approach will be to add a filter for $meta array in {{{wpmu_signup_user}}} function just before the database insert like this : {{{#!php model->update_roles( $user_id, $meta['md_roles'] ); } } }}} By the way, if you're okay with my following patch, I would benefit from this other ticket : https://core.trac.wordpress.org/ticket/38781 which avoid $meta array to be serialized when passed to hooks, in fact, I'm using its patch to make mine.",enhancement,new,normal,Awaiting Review,Users,3.0,normal,,,,multisite