Cannot select signup_meta upon multisite user activation
-
Hello,
I am having troubles selecting signup meta. It always returns empty array.
my code is:
add_action('wpmu_activate_user', 'promote_to_admin', 99); function promote_to_admin($user_id, $password, $meta) { global $wpdb; $user = get_userdata($user_id); $email = $user->user_email; var_dump($email); $signup_meta = $wpdb->get_results("SELECT meta FROM wp_signups WHERE user_email = $email"); if ($signup_meta['new_role'] == 'administrator') { $user->set_role('administrator'); } }
$signup_meta is returned as an empty array. However, when I check the database, the signup_meta array contains values.
I also tried dumping $user and $email – everything is fine, $user object is populated with data and $email is correct.Anybody know what can be the issue here and how can I retrieve the signup meta? Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Cannot select signup_meta upon multisite user activation’ is closed to new replies.