mirror of
https://github.com/yunluo/gdk.git
synced 2024-06-27 09:40:09 +02:00
15 lines
398 B
PHP
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('无权访问');
|
|
}
|
|
|
|
}
|