mycred_bp_leaderboard_get

Description

This filter allows you to adjust or run your own custom query for BuddyPress leaderboards. This filter used by the myCRED BP Group Leaderboards plugin. The filter is used each time a leaderboard is rendered so it is important that you cache your results to prevent having to run potentially expensive queries on every page load.

Available since version 1.1

Parameters

Param Type Required Description
$leaderboard array Yes

The leaderboard array.

$group_id int No

The BuddyPress Group id.

$point_type string No

The myCRED point type the leaderboard is based on.

$append_user int or bool No

The WordPress user ID of a user to append to the end of the leaderboard. FALSE if no appending should occur. Note that users that are excluded from the point type will never be appended to  leaderboard so there is no need in your script to check if the user ID is excluded or not.

$fresh bool No

TRUE if a new fresh query should be made (ignoring cached results) or FALSE if cached results should be used (if one exists).

Used By

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

Examples

Example 1: Example of how to run a custom leaderboard query based on annual point gains.