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:
@@ -775,13 +775,8 @@ if (!function_exists('aksrt_can_download')) {
|
||||
return new WP_Error('aksrt_not_downloadable', __('该内容不是可下载资源。', 'aksrt'));
|
||||
}
|
||||
|
||||
$paid_settings = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_paid_content_settings()
|
||||
: ['download_login' => true];
|
||||
|
||||
$uid = $user_id > 0 ? $user_id : get_current_user_id();
|
||||
|
||||
if (!empty($paid_settings['download_login']) && $uid <= 0) {
|
||||
if (!function_exists('aksrt_user_can') || !aksrt_user_can('resource_download', $uid, (int) $p->ID)) {
|
||||
$login_url = wp_login_url(get_permalink($p));
|
||||
return new WP_Error('aksrt_need_login', __('请先登录。', 'aksrt'), ['login_url' => $login_url]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user