feat(assets): forum free-task depth, withdraw notices, share poster

Route forum essence/adopt/hot/score rewards through free-points day cap,
notify users on withdraw complete/reject, surface 海报分享 on single
share grid, and extend admin free-task keys for the remaining matrix.
This commit is contained in:
kate522 committed 2026-07-16 17:46:51 +08:00
1 parent c3eee3fa7e
commit b1731f7a8d
11 files changed
+165 -55

No files matched your search

+9 -17
View File
@@ -234,22 +234,14 @@ class AKSRT_Credits_Earn {
}
}
public function on_forum_topic_featured(int $topic_id, int $operator_id): void {
unset($operator_id);
$post = get_post($topic_id);
if (!$post || $post->post_type !== 'aksrt_forum_topic') {
return;
}
$user_id = (int) $post->post_author;
if ($user_id <= 0 || !class_exists('AKSRT_Points_Free')) {
return;
}
if (get_post_meta($topic_id, 'aksrt_credit_essence_rewarded', true)) {
return;
}
$granted = AKSRT_Points_Free::grant($user_id, 'bbs_essence', 0, ['type' => 'post', 'id' => $topic_id]);
if (!is_wp_error($granted) && $granted > 0) {
update_post_meta($topic_id, 'aksrt_credit_essence_rewarded', 1);
}
/**
* Essence reward is owned by AKSRT_Forum::reward_essence() (free-day-cap).
* Keep hook for external integrations only — do not double-grant.
*
* @param int $topic_id
* @param int $author_or_operator Author id from forum (2nd arg) or operator.
*/
public function on_forum_topic_featured(int $topic_id, int $author_or_operator = 0): void {
unset($topic_id, $author_or_operator);
}
}