Skip to:
Content
Pages
Categories
Search
Top
Bottom

How Do I link to Profile Page


  • Steve
    Participant

    @aksteve

    OK. I keep asking this question, but get no answer or people try to sell me plugins.

    How can I create a link so my members can update their profile?

    I see posts on this forum about the profile page but no explanation on how to link to it.

    There is a way to do right? Even on this very forum I see a login link at top right. I can then edit my profile, see posts I wrote, etc. So this exist.

    How can I create these links? Is it not part of the core? I hope someone can help. Thanks.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Hi Steve,

    As Robin answered, you could look into his coding for the bbP Style Pack to see how it works.

    There is also https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#8-add-edit-profile-to-a-wordpress-menu that might give you a hint.

    Pascal.


    Steve
    Participant

    @aksteve

    Ok. Thank you.

    I guess that answers my questions.

    The question being, is there a way to add a “my profile” link to a menu.

    The answer is, if I am hearing correctly. Yes, sorta, if you edit some function files.

    And the answer is also, No – there is no way to do this with bbPress. bbPress does not offer a way for people to edit their profiles unless the user is savy enough to know they should click their profile name in a forum post to see/edit their profile.

    I just assumed there would be an easy way to do this. It seems a core function. But I guess I am wrong.

    Makes me wonder how others make “profile” pages for their users?

    Thanks for the answer.


    tylertervooren
    Participant

    @tylertervooren

    @aksteve – I had the same frustration. Try this simple plugin I just created. It’ll print the profile url via a shortcode so you can insert it anywhere you like.


    boborg
    Participant

    @boborg

    @tylertervooren where can I get the simple plugin you created?


    tylertervooren
    Participant

    @tylertervooren

    Huh… looks like my link got stripped. Here it is: https://wordpress.org/plugins/bbp-profile-link-shortcode/


    jomo
    Participant

    @jonathanmoorebcsorg

    after some difficulty I came up with a solution, which allows a standard menu item linking to eg:
    forums/users/current

    If a request is made to http://mysite/forums/users/current, the user name “current” is detected and replaced with the current user id, or, if the user is not logged in, redirect to login screen:

    
    /*
     * attempt to handle generic request for current user
     *
     * if the url is passed as forums/users/current/
     * this function detects that the permalink has been set to bbp_user=current
     * and
     *  - if the user is logged on, the query is changed to the current user
     *  - if the user is not logged on, the user is redirected to login screen
     *
     */
    function ink_bbp_request_current_user( $query_vars ) {
    	if ( isset( $query_vars[ 'bbp_user' ] ) ) {
    		switch ( $query_vars[ 'bbp_user' ] ) {
    			case 'current':
    				if ( get_current_user_id() ) {
    					$query_vars[ 'bbp_user' ] = bbp_get_current_user_name();
    				} else {
    					auth_redirect();
    				}
    		}
    	}
    	return $query_vars;
    }
    
    add_filter( 'bbp_request', 'ink_bbp_request_current_user', 10, 1 );
    

    ryanrain
    Participant

    @ryanrain

    @jonathanmoorebcs for me, your code works great for admin users, but fails for contributor role users


    ryanrain
    Participant

    @ryanrain

    small tweak to not break for users with names that include spaces. the issue was not a permissions one as i posted above.

    
    /*
     * attempt to handle generic request for current user
     * https://bbpress.org/forums/topic/how-do-i-link-to-profile-page/
     *
     * if the url is passed as forums/users/current/
     * this function detects that the permalink has been set to bbp_user=current
     * and
     *  - if the user is logged on, the query is changed to the current user
     *  - if the user is not logged on, the user is redirected to login screen
     *
     */
    function ink_bbp_request_current_user( $query_vars ) {
    	if ( isset( $query_vars[ 'bbp_user' ] ) ) {
    		switch ( $query_vars[ 'bbp_user' ] ) {
    			case 'current':
    				if ( get_current_user_id() ) {
    					$query_vars[ 'bbp_user' ] = bbp_get_user_nicename(get_current_user_id());
    				} else {
    					auth_redirect();
    				}
    		}
    	}
    	return $query_vars;
    }
    
    add_filter( 'bbp_request', 'ink_bbp_request_current_user', 10, 1 );
    

    muradenyo
    Participant

    @muradenyo

    Thanks you


    Tina
    Participant

    @sunflowermom

    @tylertervooren

    Would you be able to update your plugin? I just went to get it and it says it hasn’t been updated for the 3 past WP updates. It has a big warning across it and says it’s been 3 years since updated. I really would love to try this! It might be just what I need!


    tylertervooren
    Participant

    @tylertervooren

    @sunflowermom: Is there something about it that isn’t working?


    Tina
    Participant

    @sunflowermom

    I don’t know, I haven’t tried it…it just concerns me when I see that warning…so I don’t download plugins that haven’t been worked on for that long.


    andalusian
    Participant

    @andalusian

    Hi,

    I installed the plugin, but it doesn’t really show the account page, it only shows the link and it is not clickable? Am I correct? Is there not something like with WooCommerce where subs can click the link and it redirects them to their profile page? The short code for woo is [woocommerce_my_account].


    sharkster4000
    Participant

    @sharkster4000

    This really should be added to bbpress. In the meantime, you can use

    https://YourDomain.com/wp-admin/profile.php

    as a permanent link to a user’s profile. HOWEVER: This sends people to their WordPress profile page, not to the more friendly looking bbpress profile. It does still allow them to do all the changes to their settings though.


    Robin W
    Moderator

    @robin-w

    you can change the WordPress profile to bbpress using the

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>login>option 6

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