Skip to content

Commit

Permalink
feat: remove filters controlling admin system access
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquimds committed Dec 15, 2023
1 parent 1410caf commit 8a2239a
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions web/app/themes/awasqa/src/authors.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,29 +262,6 @@ function handle_update_profile_pic($user_id)
return get_permalink($register);
});

// Prevent subscribers from accessing the WP backend
add_action('admin_init', function () {
if (!is_user_logged_in()) {
return;
}

$roles = (array) wp_get_current_user()->roles;
$allowed_roles = ['administrator', 'editor', 'author', 'contributor'];

if (!array_intersect($allowed_roles, $roles)) {
wp_die('Sorry, you are not allowed to access this page.');
}
});

add_action('after_setup_theme', function () {
$roles = (array) wp_get_current_user()->roles;
$allowed_roles = ['administrator', 'editor', 'author', 'contributor'];

if (!array_intersect($allowed_roles, $roles) && !is_admin()) {
show_admin_bar(false);
}
});

// Improve title on Author archives page
add_filter('wpseo_title', function ($title) {
if (is_author()) {
Expand Down

0 comments on commit 8a2239a

Please sign in to comment.