bp_core_get_userlink_by_username( string $username )

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


Parameters Parameters

$username

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


Top ↑

Return Return

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


Source 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 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 ) );
}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.