bp_core_get_userlink_by_username( string $username )

Return the user link for the user based on the supplied identifier.

Description

Parameters

$username

(string) (Required) If BP_ENABLE_USERNAME_COMPATIBILITY_MODE is set, this should be user_login, otherwise it should be user_nicename.

Return

(string|bool) The link to the user's domain, false on no match.

Source

File: bp-members/bp-members-functions.php

function bp_core_get_userlink_by_username( $username ) {
	if ( bp_is_username_compatibility_mode() ) {
		$user_id = bp_core_get_userid( $username );
	} else {
		$user_id = bp_core_get_userid_from_nicename( $username );
	}

	/**
	 * Filters the user link for the user based on username.
	 *
	 * @since BuddyPress 1.0.1
	 *
	 * @param string|bool $value URL for the user if found, otherwise false.
	 */
	return apply_filters( 'bp_core_get_userlink_by_username', bp_core_get_userlink( $user_id, false, false, true ) );
}

Changelog

Changelog
Version Description
BuddyPress 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.