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:
@@ -403,11 +403,7 @@ if (!function_exists('aksrt_can_download')) {
|
||||
}
|
||||
|
||||
$uid = $user_id > 0 ? $user_id : get_current_user_id();
|
||||
$paid_settings = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_paid_content_settings()
|
||||
: ['download_login' => true];
|
||||
|
||||
if (!empty($paid_settings['download_login']) && $uid <= 0) {
|
||||
if (!function_exists('aksrt_user_can') || !aksrt_user_can('resource_download', $uid, (int) $p->ID)) {
|
||||
return new WP_Error('aksrt_need_login', __('请先登录后再下载。', 'aksrt'), [
|
||||
'status' => 401,
|
||||
'login_url' => wp_login_url(get_permalink($p)),
|
||||
|
||||
Reference in New Issue
Block a user