I’m bit amazed by this
enabled direct registration of new members and disabled email confirmation
As far as I know, a user registering from the front-end (managed by BuddyPress) is first receiving an email containing a secret key he needs to paste into the BuddyPress activate page to validate their account. But maybe you are using a plugin or some custom code to disable this..
Otherwise, you can achieve what you describe adding the following code snippets to a bp-custom.php file.
/**
* Adds activities generated when a user activates their account when a user
* is created using the wp-admin/user-new screen Add new action.
*/
function automatically_generate_an_activation_activity( $user_id = 0 ) {
// Adds a "became a registered user" activity.
bp_core_new_user_activity( $user_id );
// Fake a user log in.
bp_update_user_last_activity( $user_id );
}
add_action( 'edit_user_created_user', 'automatically_generate_an_activation_activity' );
Yes, I used some more custom codes and a BP plugin, Disable Activation Reloaded . Your condition worked perfectly
Thank you very much.
But unfortunately it didn’t solve my problem.
Use boddypress to feed an app with the json api wordpress plugin. I thought he would use the same controller panel to make the user record in the api.
Even so registered the user in the app by the api he does not appear in activities. Do you know how I can handle this?
I see, you can try the following code:
/**
* Adds activities generated when a user activates their account when a user
* is created using the WP REST API.
*/
function rest_automatically_generate_an_activation_activity( $user ) {
// Adds a "became a registered user" activity.
bp_core_new_user_activity( $user->ID );
// Fake a user log in.
bp_update_user_last_activity( $user->ID );
}
add_action( 'rest_insert_user', 'rest_automatically_generate_an_activation_activity' );
Did not work 🙁
Still registered by the app do not appear in activities. It seems that something is missing with being changed in the DB
I put it in the theme’s function.php and it worked 😀
Thank you very much