Skip to content

Commit

Permalink
fix: Allow AJAX requests for non-admin users in admin access restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Koech authored and Kevin Koech committed Dec 10, 2024
1 parent 0b8bbeb commit c09e8b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wp-content/themes/academyAfrica/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ function admin_notice_minimum_plugin_version($plugin_name, $min_version)

function restrict_admin_access()
{
if (!current_user_can('administrator') && !current_user_can('editor') && !current_user_can('author')) {
if (!current_user_can('administrator') && !current_user_can('editor') && !current_user_can('author') && !(defined('DOING_AJAX') && DOING_AJAX)) {
wp_redirect(home_url());
exit;
}
Expand Down

0 comments on commit c09e8b1

Please sign in to comment.