Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change redirect URL after changing user avatar


  • ch1n3s3b0y
    Participant

    @ch1n3s3b0y

    Hi everyone

    Currently, when a user finishes changing their user avatar, they get redirected to their profile. I want them to be redirected to their edit profile screen.

    The code is in here \wp-content\plugins\buddypress\bp-xprofile\bp-xprofile-screens.php and the code is in the function xprofile_screen_change_avatar().

    The actual bit of code I need to change is:

    do_action( 'xprofile_avatar_uploaded' );
    bp_core_add_message( __( 'Your new profile photo was uploaded successfully.', 'buddypress' ) );
    bp_core_redirect( bp_displayed_user_domain() );

    What I need to do is edit that bp_core_redirect() without editing BuddyPress’ core files. Any one have any idea how I can do this?

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

  • ch1n3s3b0y
    Participant

    @ch1n3s3b0y

    Ok, I figured it. For anyone that has the same issue, I put the following code in my functions.php, though I think it would work fine in a plugin too.

    add_action('xprofile_avatar_uploaded','redirectAfterAvatarUpload' );
    function redirectAfterAvatarUpload() {
        $location = '/members/'.bp_core_get_username(bp_loggedin_user_id()).'/profile/edit/group/1/';
        bp_core_redirect($location);
        return;
    }

    HDcms
    Participant

    @hdcms

    HI,
    It does not work!
    WP 4.2.4 and BP 2.3.3
    I put this code in functions Or bp-custom
    This works well?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change redirect URL after changing user avatar’ is closed to new replies.
Skip to toolbar