Thread Starter
Sharon
(@shpemu)
Hey all. Found my answer. I had a security plugin that was keeping anyone who wasn’t an admin out of the admin dashboard area.
My original code for this looked like this:
function restrict_admin_access() {
if(!current_user_can('administrator')) {
wp_redirect( get_bloginfo('url') );
exit;
}
}
add_action( 'admin_init', 'restrict_admin_access', 1 );
My new code looks like this:
function restrict_admin_access() {
if(!current_user_can('administrator') && !wp_doing_ajax()) {
wp_redirect( get_bloginfo('url') );
exit;
}
}
add_action( 'admin_init', 'restrict_admin_access', 1 );
The “like” plugin works wonderfully now.