Re: bbpress + wpmu user registration default role
Sorry for the duplicate post, I think I was tired when I posted the other one and I’d sort of forgot about it.
Anyways, I’ve been playing with the two bits of code and I think I’ve ‘almost’ got it working. If I execute Detectives query manually from the terminal it works, but for some reason when I put it all in a little plugin nothing happens. Is there a type-o or a noob error somewhere?
`<?php
/*
Plugin Name: bbpress wpmu default role
*/
function trk_addDefaultRole($user_id) {
global $bbdb;
$bbdb->query(“INSERT INTO wp_usermeta ( user_id, meta_key, meta_value ) VALUES ( ‘$user_id’, ‘wp_1_capabilities’, ‘a:1:{s:10:”subscriber”;b:1;}’ )”);
}
add_action(‘bb_new_user’, ‘trk_addDefaultRole’);
?>