mycred_get_user_id

Description

This function will attempt to return a user ID based on either an identifying piece of information (email, login or slug) or based on keywords.

Available since version 1.7

Returns

(int | string) Returns either the users ID or the parameter passed to this function if nothing was found.

Parameters

Param Type Required Description
function mycred_get_user_id(
$identifier int or string Yes

Either a keyword or a piece of information that can be used to get a user from the database.

) { ... }

Keywords

An empty $identifier parameter will return the current users ID.

Keyword
Description
current

Retrieves the current users ID. This will be zero if the user is not logged in.

author

Returns the current posts author ID. Can only be used inside the loop.

replyauthor

Returns the bbPress topic reply authors ID. Can only be used inside a bbPress loop.

bbprofile

Returns the displayed profiles ID. Can only be used in BuddyPress profile pages.

Examples

No example found.