Skip to:
Content
Pages
Categories
Search
Top
Bottom

redirect user edit profile to custom page

  • @oanhtran1804

    Participant

    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

    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

    @oanhtran1804

    Participant

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

    @robin-w

    Moderator

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

    @oanhtran1804

    Participant

    Can you please try on with
    example.com
    Thanks

    @robin-w

    Moderator

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

    should do it

    @oanhtran1804

    Participant

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

    @oanhtran1804

    Participant

    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

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

    @oanhtran1804

    Participant

    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

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

    suggest you post on their support forum

    @oanhtran1804

    Participant

    Thank you so much.

    @david13_13

    Participant

    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

    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

    It worked like a charm, thanks a lot!!

    @robin-w

    Moderator

    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