avoid user validation on buddypress

In buddypress, by default user becomes non active during registration. We can avoid the validation using hook as below in functions.php inside theme file:

<?php
add_action('bp_core_signup_user','change_bp_user_status');

function change_bp_user_status ( $user_id ) {
global $bp, $wpdb;
/* Update the user status to '2' which we will use as 'not activated' (0 = active, 1 = spam, 2 = not active) */
$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->users SET user_status = 2 WHERE ID = %d", $user_id ) );

}	
?>

Comments

comments

Leave a Reply