Filters a request to take a named, expiring claim. A provider answers with true or false; null means no provider answered and the caller falls back to the object cache.
Parameters of davo_claim_once
Parameter
Type
Description
$result
bool|null
Whether the claim was taken. Null when unanswered.
Resolve a comment's author user ID from its comment ID.
Must be implemented by the Comments domain — see this class's top-of-file docblock for the full contract rationale. Comments are NOT native wp_comments rows — they live in the Comments domain's own custom table — so there is no core WordPress function Gamification can call directly the way get_post_field() works for questions/answers above.
Parameters of davo_comment_author_id
Parameter
Type
Description
$author_id
int|null
Default null. The Comments domain should return the resolved user ID, or leave this as null if it cannot be resolved.
$comment_id
int
The comment ID to resolve from.
add_filter
add_filter( 'davo_comment_author_id', 'my_filter_callback', 10, 2 );
/**
* @param int|null $author_id
* @param int $comment_id
*/functionmy_filter_callback( $author_id, $comment_id ) {
// Change $author_id as needed, then return it.return$author_id;
}
This action is documented in Questions_Repository::update_question(). Included for comments too, for the same reason comment votes were added to davo_vote_cast: the 'editor' achievement's edit_count stat is meant to track direct edits generically, not just questions/answers.
Passed to callbacks: $editor_id$comment_id'comment'
Filter the built-in reputation actions reference list before it is returned. Third-party plugins granting their own fixed-amount reputation reasons (via REASON_PLUGIN_REWARD or their own registered reason) can append a row here — {reason, label, points} — so it appears in the same reference table.
Parameters of davo_gamification_reputation_action_reference
The stored level in the database is not modified by this filter. Use this for display-only overrides such as premium level boosts or admin adjustments that should not affect the historical record.
Parameters of davo_level
Parameter
Type
Description
$level
int
Resolved level number.
$user_id
int
WordPress user ID.
add_filter
add_filter( 'davo_level', 'my_filter_callback', 10, 2 );
/**
* @param int $level
* @param int $user_id
*/functionmy_filter_callback( $level, $user_id ) {
// Change $level as needed, then return it.return$level;
}
Filter the full permission map for a user before it is cached and returned.
Plugins may set individual slugs to true or false to grant or revoke specific permissions regardless of reputation threshold. Unknown slugs added here will also appear in the REST permission summary response.
Parameters of davo_permissions
Parameter
Type
Description
$map
array<string, bool>
Slug → bool permission map.
$user_id
int
WordPress user ID.
add_filter
add_filter( 'davo_permissions', 'my_filter_callback', 10, 2 );
/**
* @param array<string, bool> $map
* @param int $user_id
*/functionmy_filter_callback( $map, $user_id ) {
// Change $map as needed, then return it.return$map;
}
Filters a user's profile completion score. Defaults to 0; the Profile domain supplies the real value. Profile milestone achievements unlock as the score passes their thresholds, starting at 50.
Parameters of davo_profile_completion_score
Parameter
Type
Description
$score
int
The profile completion score.
$user_id
int
WordPress user ID.
Returnsint
add_filter
add_filter( 'davo_profile_completion_score', 'my_filter_callback', 10, 2 );
/**
* @param int $score
* @param int $user_id
*/functionmy_filter_callback( $score, $user_id ) {
// Change $score as needed, then return it.return$score;
}
The stored reputation is not modified by this filter. Use this for display-only overrides such as admin-assigned honorary ranks or temporary rank grants that should not affect the historical record. Return a complete rank definition array with at minimum 'slug', 'label', 'color', and 'icon' keys.
Parameters of davo_rank
Parameter
Type
Description
$rank
array<string, mixed>
Resolved rank definition.
$user_id
int
WordPress user ID.
add_filter
add_filter( 'davo_rank', 'my_filter_callback', 10, 2 );
/**
* @param array<string, mixed> $rank
* @param int $user_id
*/functionmy_filter_callback( $rank, $user_id ) {
// Change $rank as needed, then return it.return$rank;
}
Filter the reputation points before the ledger entry is written.
Returning 0 from this filter makes add() a silent no-op that returns true, so plugins can suppress specific events. Returning a different sign (positive ↔ negative) is allowed and will be reflected in the entry.
Parameters of davo_reputation_change
Parameter
Type
Description
$points
int
Points change before filtering.
$user_id
int
User receiving the reputation change.
$reason
string
Reason ID for the change.
add_filter
add_filter( 'davo_reputation_change', 'my_filter_callback', 10, 3 );
/**
* @param int $points
* @param int $user_id
* @param string $reason
*/functionmy_filter_callback( $points, $user_id, $reason ) {
// Change $points as needed, then return it.return$points;
}
Fires after a suggested edit is approved and successfully applied to its target's live content. This is the signal Gamification's Gamification_Initializer::on_edit_accepted() listens for to grant the suggester their edit-accepted reputation bonus — a distinct reward from the general "editor" achievement/edit_count progress the suggester already gets via davo_content_edited (fired unconditionally by Questions_Repository::apply_question_edit()/ apply_answer_edit() for both direct edits and approve
Parameters of davo_suggested_edit_accepted
Parameter
Type
Description
$suggestion_id
int
Suggestion ID.
$editor_id
int
Suggester who authored the accepted edit.
$object_id
int
Question or answer post ID that was edited.
add_action
add_action( 'davo_suggested_edit_accepted', 'my_action_callback', 10, 3 );
/**
* @param int $suggestion_id
* @param int $editor_id
* @param int $object_id
*/functionmy_action_callback( $suggestion_id, $editor_id, $object_id ) {
// Your code here.
}
src/domains/suggested-edits/services/resolver.php:368, and 1 more place
Fires after any review is cast (approve or reject), independent of whether it actually resolves the suggestion. Gamification_Initializer::on_suggested_edit_reviewed() listens for this to track the 'reviews_completed' stat/leaderboard — deliberately skipping the increment when $is_author is true, since the target's own author accepting/declining a suggestion on their own content is not the same kind of independent moderation work the "Top Reviewers" leaderboard is meant to recognize. Realtime_Sug
src/domains/comments/repository.php:979, and 3 more places
Note. Generated from the plugin source. Descriptions and parameters are the ones written in the code. The starter code uses the parameter names from those comments, or generic names where there are none, so check them against your use.