mycred_is_admin

Description

This function checks if a specific user is to be considered an “administrator”. Administrators are users that have one of the capabilities you have set for “Point Editors” or “Point Administrators”.

Available since version 1.0

Returns

(bool) TRUE if the user is an administrator else FALSE.

Parameters

Param Type Required Description
function mycred_is_admin(
$user_id int No

The users numeric ID. If no ID is provided, the current user will be checked.

$point_type string No

The point type key. Should only be used if you are checking for a custom point type.

) { ... }

Examples

Example 1: Check if the current user is an administrator.

if ( mycred_is_admin() ) {

	// User is an admin

}