Skip to:
Content
Pages
Categories
Search
Top
Bottom

Automatically activate new registered users in the panel


  • caioscarvalho
    Participant

    @caioscarvalho

    Hi!

    I enabled direct registration of new members and disabled email confirmation.

    Everything works fine on the buddypress registration page

    But when I register a new user through the worpress panel >> Users >> new user, it activates as a member but not in activities

    Does anyone know a way to definitely activate these users registered on the panel without sending an email and having to do the first login?

    Use WP 5.7 and BP 8.0

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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' );
    

    caioscarvalho
    Participant

    @caioscarvalho

    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' );
    

    caioscarvalho
    Participant

    @caioscarvalho

    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


    caioscarvalho
    Participant

    @caioscarvalho

    I put it in the theme’s function.php and it worked 😀

    Thank you very much

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar