feat(user-center): redesign sidebar and wallet tips
This commit is contained in:
1 parent
82e71d1bf9
commit
a7f3caec59
24 files changed
+895
-528
No files matched your search
@@ -92,30 +92,6 @@ 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;
|
||||
}
|
||||
@@ -479,6 +455,9 @@ if (!function_exists('aksrt_get_user_center_render_context')) {
|
||||
$allow_avatar_upload = !empty($user_center_settings['avatar_upload']);
|
||||
$allow_bg_upload = !empty($user_center_settings['cover_upload']) && class_exists('\AKSRT\Settings\Settings') && aksrt_get_setting('allow_background_upload', false);
|
||||
$messages_enabled = !class_exists('\AKSRT\Settings\Settings') || \AKSRT\Settings\Settings::message_enabled();
|
||||
$follower_count = class_exists('\AKSRT\User\Follow')
|
||||
? \AKSRT\User\Follow::get_instance()->get_follower_count($user_id)
|
||||
: 0;
|
||||
|
||||
$post_status_filter = isset($_GET['post_status']) ? sanitize_key(wp_unslash($_GET['post_status'])) : 'publish';
|
||||
if (!in_array($post_status_filter, ['all', 'publish', 'draft', 'pending', 'private'], true)) {
|
||||
@@ -531,6 +510,7 @@ if (!function_exists('aksrt_get_user_center_render_context')) {
|
||||
'comment_count' => $comment_count,
|
||||
'favorite_post_ids' => $favorite_post_ids,
|
||||
'favorite_count' => $favorite_count,
|
||||
'follower_count' => $follower_count,
|
||||
'user_contacts' => $user_contacts,
|
||||
'profile_signals' => $dashboard['profile_signals'] ?? [],
|
||||
'user_background_url' => $user_background_url,
|
||||
|
||||
Reference in new issue
Block a user