WordPress niega al usuario que acceda a WP-Admin mediante programación programada
function restrict_access_admin_panel(){
global $current_user;
if ($current_user->user_level < 4) {
wp_redirect( home_url() );
exit;
}
}
add_action('admin_init', 'restrict_access_admin_panel', 1);
Ivan Cuaco