bp_displayed_user_id()

Get the ID of the currently displayed user.

Description

Return

(int) $id ID of the currently displayed user.

Source

File: bp-core/bp-core-template.php

function bp_displayed_user_id() {
	$bp = buddypress();
	$id = !empty( $bp->displayed_user->id )
		? $bp->displayed_user->id
		: 0;

	/**
	 * Filters the ID of the currently displayed user.
	 *
	 * @since BuddyPress 1.0.0
	 *
	 * @param int $id ID of the currently displayed user.
	 */
	return (int) apply_filters( 'bp_displayed_user_id', $id );
}

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.