This filter allows you to exclude users from using myCRED via script. This filter is part of the exclude_user() method in the myCRED_Settings class and is used extensively in myCRED. Returning true will stop the user in question from gaining points or using myCRED features.


Available since version 1.0


Param Type Required Description
$exclude bool Yes

Should return TRUE if user is to be excluded or FALSE if not.

$user_id int No

The ID of the user in question.

$mycred obj No

The myCRED_Settings class object being used.

Used By

Package Prio. Description
Not used by any built-in package.


Example 1: Exclude users with the subscriber role in WordPress from using myCRED.

Example 2: Example 2: Exclude users with the Paid Membership Pro level of “Gold“ from using myCRED.

Example 3: Exclude subscribers from a custom point type.

Example 4: Exclude users from using points based on their BuddyPress Member Type (2.7+)