1
0
Fork 0
mirror of https://github.com/yunluo/gdk.git synced 2024-06-27 09:40:09 +02:00
gdk/modules/base/functions/wp-admin-access-control.php
2020-01-25 14:52:35 +08:00

15 lines
398 B
PHP

<?php
if( is_admin() && is_user_logged_in() && !empty( $GLOBALS['wp-admin-access-group'] ) && !(defined('DOING_AJAX') && DOING_AJAX) ){
$user = wp_get_current_user();
$user_roles = $user->roles;
$GLOBALS['wp-admin-access-group'][] = 'administrator';
if( empty( array_intersect( $GLOBALS['wp-admin-access-group'], $user_roles ) ) ){
wp_die('无权访问');
}
}