bp_loggedin_user_id()
Get the ID of the currently logged-in user.
Description Description
Return Return
(int) ID of the logged-in user.
Source Source
File: bp-core/bp-core-template.php
function bp_loggedin_user_id() {
$bp = buddypress();
$id = !empty( $bp->loggedin_user->id )
? $bp->loggedin_user->id
: 0;
/**
* Filters the ID of the currently logged-in user.
*
* @since 1.0.0
*
* @param int $id ID of the currently logged-in user.
*/
return (int) apply_filters( 'bp_loggedin_user_id', $id );
}
Changelog Changelog
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |