Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_core_get_userlink()

Description

Returns a HTML formatted link for a user with the user’s full name as the link text.

Top

Usage

<?php echo bp_core_get_userlink( bp_loggedin_user_id(), $no_anchor = false, $just_link = false ); ?>

Top

Parameters

$user_id
(integer) User ID to check.

$no_anchor
(bool) Disable URL and HTML and just return full name. Default false.

$just_link
(bool) Disable full name and HTML and just return the URL text. Default false.

Returns

Returns false when there was no match found, and the link text (string) based on passed parameters.

Top

Example

<div class="author-box">
<?php echo get_avatar( get_the_author_meta( 'user_email' ), '50' ); ?>
<p><?php printf( _x( 'by %s', 'Post written by...', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ); ?></p>
</div>

Top

Source File

bp_core_get_userlink is located in <a href="http://buddypress.trac.wordpress.org/browser/branches/1.7/bp-members/bp-members-functions.php#L380.