We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 012df1e commit 11c051aCopy full SHA for 11c051a
Users/disable-dashboard-access.php
@@ -0,0 +1,9 @@
1
+<?php
2
+
3
+add_action('admin_init', 'my_disable_dashboard_access');
4
+function my_disable_dashboard_access() {
5
+ if(!current_user_can('manage_options') && $_SERVER['DOING_AJAX'] != '/wp-admin/admin-ajax.php') {
6
+ wp_redirect(esc_url(home_url('/')));
7
+ exit;
8
+ }
9
+}
0 commit comments