feat(users): govern profiles and access
Normalize fixed profile fields, profile actions, and the five-column capability matrix for comments, uploads, and downloads.
This commit is contained in:
1 parent
0b06b2c7df
commit
8241570ca2
67 files changed
+780
-1127
No files matched your search
@@ -23,7 +23,7 @@ defined('ABSPATH') || exit;
|
||||
* @type int $comment_count Approved comment count.
|
||||
* @type int $favorite_count Favorited post count.
|
||||
* @type array $favorite_post_ids Array of favorited post IDs.
|
||||
* @type array $user_contacts Social/contact links from user meta.
|
||||
* @type array $profile_details Server-filtered fixed public profile fields.
|
||||
* @type array $profile_signals Identity chips (verified, level, badges).
|
||||
* @type array $profile_notice Ban/restriction notice, if any.
|
||||
* @type string $background_url Cover image URL.
|
||||
@@ -62,14 +62,9 @@ function aksrt_get_user_dashboard_view(int $user_id, array $args = []): array {
|
||||
])
|
||||
: [];
|
||||
|
||||
$user_contacts = get_user_meta($user_id, 'aksrt_user_contacts', true) ?: [];
|
||||
if (!is_array($user_contacts)) {
|
||||
$user_contacts = [];
|
||||
}
|
||||
|
||||
$user_center_settings = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_user_center_settings()
|
||||
: ['social_links' => true];
|
||||
$profile_details = function_exists('aksrt_get_visible_user_profile_details')
|
||||
? aksrt_get_visible_user_profile_details($user_id, $viewer_id)
|
||||
: ['gender' => '', 'website' => '', 'qq' => '', 'wechat' => '', 'github' => ''];
|
||||
|
||||
$background_url = get_user_meta($user_id, 'aksrt_background_image', true) ?: '';
|
||||
|
||||
@@ -98,8 +93,7 @@ function aksrt_get_user_dashboard_view(int $user_id, array $args = []): array {
|
||||
'favorite_count' => $favorite_count,
|
||||
'favorite_post_ids'=> $favorite_post_ids,
|
||||
'recent_posts' => $recent_posts,
|
||||
'user_contacts' => $user_contacts,
|
||||
'social_links_on' => !empty($user_center_settings['social_links']),
|
||||
'profile_details' => $profile_details,
|
||||
'profile_signals' => $profile_signals,
|
||||
'profile_notice' => $profile_notice,
|
||||
'show_report' => $show_report,
|
||||
|
||||
Reference in new issue
Block a user