Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to redirect away from bbpress profile

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

  • Robin W
    Moderator

    @robin-w

    so where do you want them to go if they are either not logged in, or are looking at someone else’s profile page? (as that’ll determine where you might start!)


    laternastudio
    Participant

    @piperpam27

    Sorry, that wasn’t clear in my first post. They’ll regardless of which user is logged in, they’ll need to go here:

    http://www.example.com/profile

    The session data will determine which information to display.


    Robin W
    Moderator

    @robin-w

    suggest you start with looking at

    bbpress/includes/extend/buddypress/members.php

    This changes bbpress to go to buddypress profile, and should give you all the code you need.


    laternastudio
    Participant

    @piperpam27

    Great, thanks!


    laternastudio
    Participant

    @piperpam27

    For future readers, I was able to accomplish the redirect with this simple line of code:

    add_filter( 'bbp_pre_get_user_profile_url', function() {
    	return get_bloginfo('url').'/profile';
    });

    Very simple, really!

    You can also change the default url for favorites and subscriptions by doing this:

    
    // Replace the default link for the favorites
    add_filter( 'bbp_get_favorites_permalink', function() {
    	return get_bloginfo('url').'/profile/forum-favorites';
    });
    
    // Replace the default link for subscriptions
    add_filter( 'bbp_get_subscriptions_permalink', function() {
    	return get_bloginfo('url').'/profile/forum-subscriptions';
    });
    

    Of course, if you’re using pre PHP 5.3.1 (or are developing a plugin) you’ll need to create actual functions rather than using anonymous functions.

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