Skip to:
Content
Pages
Categories
Search
Top
Bottom

redirect user edit profile to custom page


  • TheDream18
    Participant

    @oanhtran1804

    Can anyone help with correct code? I want complete user click edit profile will direct 100% go to custom page like normal without any issue

    Issue 1:
    First load edit page complete, after that 2 second, reload custom page

    add_action( ‘bbp_user_edit_before’, ‘pb_custom_bbpress_edit_profile’ );
    function pb_custom_bbpress_edit_profile(){
    echo ‘<meta http-equiv=”Refresh” content=”0;url=http://example.com” />’;
    }

    Issue 2:
    No work

    add_filter( ‘bbp_pre_get_user_profile_url’, function() {
    return get_bloginfo(‘example.com’).’/profile’;
    });

    Issue 3:
    Still load edit profile link without load custom like. But given blank page, no error no warning, just empty link page

    add_action( ‘bbp_user_edit_before’, ‘pb_custom_bbpress_edit_profile’ );
    function pb_custom_bbpress_edit_profile(){
    echo ‘‘;
    }

    ==============
    Also change the default url for favorites and subscriptions by doing this:
    How can i correct it?

    // Replace the default link for the favorites
    add_filter( ‘bbp_get_favorites_permalink’, function() {
    return get_bloginfo(‘example.com’).’/profile/forum-favorites’;
    });

    // Replace the default link for subscriptions
    add_filter( ‘bbp_get_subscriptions_permalink’, function() {
    return get_bloginfo(‘example.com’).’/profile/forum-subscriptions’;
    });

    =============
    Thanks

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

  • Robin W
    Moderator

    @robin-w

    probably the easiest is to filter the edit profile call

    bbp_get_user_edit_profile_url

    held in

    includes/users/template.php

    it has

    return apply_filters( 'bbp_get_user_edit_profile_url', $url, $user_id, $user_nicename );

    so an ‘add_filter’ on that should work nicely


    TheDream18
    Participant

    @oanhtran1804

    Can you give me complete code please? I’m not developer, i just collect code somewhere and posted and try on. ^^


    Robin W
    Moderator

    @robin-w

    I can, but you’ll need to give me the url you want the user to go to


    TheDream18
    Participant

    @oanhtran1804

    Can you please try on with
    example.com
    Thanks


    Robin W
    Moderator

    @robin-w

    add_filter( 'bbp_get_user_edit_profile_url', 'http://example.com');

    should do it


    TheDream18
    Participant

    @oanhtran1804

    I added code to function.php child-theme. But no work. When click on edit profile still linked correct edit page


    TheDream18
    Participant

    @oanhtran1804

    I added to child-theme function.php. But no work

    add_filter( ‘bbp_get_user_edit_profile_url’, ‘http://example.com&#8217;);


    Robin W
    Moderator

    @robin-w

    ok, are you running just bbpress or bbpress with buddypress?


    TheDream18
    Participant

    @oanhtran1804

    I used both of theme.
    I used this code work. I think you help correct this code will be perfect.

    Issue 1:
    First load edit page complete, after that 2 second, reload direct to example.com

    add_action( ‘bbp_user_edit_before’, ‘pb_custom_bbpress_edit_profile’ );
    function pb_custom_bbpress_edit_profile(){
    echo ‘<meta http-equiv=”Refresh” content=”0;url=http://example.com” />’;
    }


    Robin W
    Moderator

    @robin-w

    ok, you will need help from a buddypress expert, as buddypress takes over the profile.

    suggest you post on their support forum


    TheDream18
    Participant

    @oanhtran1804

    Thank you so much.


    David13_13
    Participant

    @david13_13

    Hey!

    I’ve used this code in my child theme functions.php:

    add_filter( 'bbp_get_user_edit_profile_url', 'http://example.com');
    

    But it doesnt work, if I now click “Edit” it does nothing instead of go to example.com

    Thanks


    Robin W
    Moderator

    @robin-w

    newer versions of php no longer like that code – use this

    add_filter( 'bbp_get_user_edit_profile_url', 'rew_redirect');
    
    function rew_redirect () {
    $url = 'https://www.facebook.com/' ;
    return $url ;
    }

    David13_13
    Participant

    @david13_13

    It worked like a charm, thanks a lot!!


    Robin W
    Moderator

    @robin-w

    great – glad you are fixed

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