mycred_is_admin

Codex / mycred/core / Functions / mycred_is_admin

Navigation:

  1. Description
  2. Usage
  3. Parameters
  4. Return

Description

Checks if a given user or the current user can either edit the myCRED plugin or edit users creds.

Note! This function does not check if a user is logged in or not, it assumes you either present a user id or the current user id can be retrieved.

 

Usage

<?php
if ( mycred_is_admin( $user_id ) ) {
	// User is "admin"
}
?>

 

Parameters

  • user_id (int)
    User id to check. If not set, the current user is checked.

 

 

Return

Returns true or false.

Last edited March 5, 2016