Skip to:
Content
Pages
Categories
Search
Top
Bottom

link to user's profile (non-template)


  • andrew55
    Participant

    @andrew55

    I have seen several places where it’s somewhat easy to create a dynamic link to the current logged in user’s profile page using php (using php in a template file).

    But what about a link that can be used in a WordPress page or better yet, inside a bbpress topic within the site? I dug up this…

    <a href="http://yoursite.com/members/%USERNAME%/">Your Profile</a>

    ..but from what I’ve seen, and testing it, it doesn’t seem to work anymore. Is there a new, updated method of accomplishing this?

    Thanks for any suggestions.

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

  • danbp
    Participant

    @danbp

    Hi @andrew55,
    add this snippet to bp-custom.php. Now you can use shortcode [profilo] in any blog post, blog comment, page and BP notice. Note that activity walls are stripped, the shortcode will not work/appear there.

    For bbPress topics and replies, use this plugin. Read the doc, as you’ll have to check user capacity to get it to work for participant.

    function bpfr_link_to_profile() {	
    
    	return ' <a href="'. bp_get_loggedin_user_link() .'">View my profile</a>';			
    }
    add_shortcode( 'profilo', 'bpfr_link_to_profile' );
    add_filter( 'comment_text', 'do_shortcode' );

    andrew55
    Participant

    @andrew55

    This is great – works perfectly – thank you.

    Are there calls, such as bp_get_loggedin_user_link, but for a link to logged in user’s friends, messages, email preferences, notifications, etc? Is there maybe a list of these calls somewhere?

    Thanks for any clarification.


    danbp
    Participant

    @danbp

    You can directly search in BuddyPress with notepad++ or a similar tool.
    Or online, here:
    http://phpxref.ftwr.co.uk/buddypress/nav.html?_functions/index.html

    Also by in-depth reading the codex.


    andrew55
    Participant

    @andrew55

    Thank you very much – this should keep my busy.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘link to user's profile (non-template)’ is closed to new replies.
Skip to toolbar