bp_get_user_meta( int $user_id, string $key, bool $single = false )

Get a piece of usermeta.


Description Description

This is a wrapper for get_user_meta() that allows for easy use of bp_get_user_meta_key(), thereby increasing compatibility with non-standard BP setups.

See also See also

  • get_user_meta(): For complete details about parameters and return values.

Top ↑

Parameters Parameters

$user_id

(Required) The ID of the user whose meta you're fetching.

$key

(Required) The meta key to retrieve.

$single

(Optional) Whether to return a single value.

Default value: false


Top ↑

Return Return

(mixed) Will be an array if $single is false. Will be value of meta data field if $single is true.


Top ↑

Source Source

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

function bp_get_user_meta( $user_id, $key, $single = false ) {
	return get_user_meta( $user_id, bp_get_user_meta_key( $key ), $single );
}

Top ↑

Changelog Changelog

Changelog
Version Description
1.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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