feat(identity): tip QR upload, metrics engine, comment moderate caps
Close identity 1:1 gaps after p1: user-center weixin/alipay tip QR upload+save, AKSRT_User_Metrics counters for medal get_type and level XP bridges, forum/revenue/signin hooks, comment moderate via user_caps, and clearer free-task deep links/status CTAs.
This commit is contained in:
1 parent
4e3eb0414d
commit
487681a6c4
18 files changed
+854
-36
No files matched your search
@@ -91,6 +91,32 @@ if (!function_exists('aksrt_save_user_center_profile')) {
|
||||
}
|
||||
|
||||
update_user_meta($user_id, 'aksrt_user_contacts', aksrt_normalize_user_contacts($input['contacts'] ?? []));
|
||||
|
||||
// Tip QR images (attachment id or URL). Empty clears.
|
||||
if (array_key_exists('rewards_weixin', $input) || array_key_exists('rewards_alipay', $input)) {
|
||||
foreach (['rewards_weixin' => 'aksrt_rewards_weixin', 'rewards_alipay' => 'aksrt_rewards_alipay'] as $field => $meta) {
|
||||
if (!array_key_exists($field, $input)) {
|
||||
continue;
|
||||
}
|
||||
$raw = is_string($input[$field]) ? trim(wp_unslash($input[$field])) : '';
|
||||
if ($raw === '' || $raw === '0') {
|
||||
delete_user_meta($user_id, $meta);
|
||||
continue;
|
||||
}
|
||||
if (ctype_digit($raw)) {
|
||||
$att = (int) $raw;
|
||||
if ($att > 0 && wp_attachment_is_image($att)) {
|
||||
update_user_meta($user_id, $meta, $att);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$url = esc_url_raw($raw);
|
||||
if ($url !== '') {
|
||||
update_user_meta($user_id, $meta, $url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user