Skip to:
Content
Pages
Categories
Search
Top
Bottom

using action bp_core_signup_after_activate

  • I’ve been trying to hook into this action, but I can’t seem to. I’ve been digging into the bp code using phpxref to try and follow any possible paths, but I think I’m missing something obvious.

    My assumption is that this action should file when a new user clicks the activation link from the activation email.

    I tired the following get a simple print_r.

    
    add_action( 'bp_core_signup_after_activate', 'bp_autologin_on_activation', 1 );
    function bp_autologin_on_activation( $signup_ids ) {
    	print_r($signup_ids); die('bp_autologin_on_activation');
    }
    

    class-bp-signup.php line 696
    do_action( ‘bp_core_signup_after_activate’, $signup_ids, $result );

Viewing 6 replies - 1 through 6 (of 6 total)

  • shanebp
    Moderator

    @shanebp

    Is it throwing a error?
    Or you just can’t see the print_r result ?

    If the latter, it may be there is no screen to print to at that momement.
    Right below that is a filter hook – follow it – does it redirect?

    Try writing to a file instead of print_r.
    And / Or get rid of the die call.

    Maybe it doesn’t matter, but the action hook has 2 params – I’d use both just to be technically safe.

    No errors, no print_r. The user is activated and sent to the sites home_url().

    It’s as if my function is being over looked. I thought maybe it needed to be called at a specific point in time so I dropped it in the functions.php to try and circumvent any timing issues.


    shanebp
    Moderator

    @shanebp

    Then it’s probably fine – the print_r doesn’t appear because it redirects right after it.

    Delete the die call and write the ids to file.
    Or maybe explain what you really want to do at that hook.

    I’ll do some more testing.

    I was mainly trying to find out if this action was one that needed to be called in a special way.

    Some actions need to be called from within a function that is hooked to another action.

    Further investigation shows that the following added to functions.php will run if the “activate” button is clicked from the wp-admin by an existing admin. It will not run from the activate link in the user activation-email.

    I must be looking for a different action.

    The goal is to login the user and redirect them after they have clicked the activate link from the activation-email.

    
    add_action( 'bp_core_signup_after_activate', 'bp_autologin_on_activation', 1 );
    function bp_autologin_on_activation( $signup_ids ) {
    	print_r($signup_ids); die('bp_autologin_on_activation');
    }
    

    Found it. This action fires when the user clicks the activate link from the activation-email.

    
    do_action( 'bp_core_activated_user', $user_id, $key, $user );
    
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘using action bp_core_signup_after_activate’ is closed to new replies.
Skip to toolbar