Does what it says…but has a flaw that took me hours to fix
-
I was writing my own plugin and couldn’t figure out why admin-ajax kept redirecting me to my home page, then realized it was this plugin that was the culprit. To the author: PLEASE update your code so it doesn’t interfere with ajax calls. I fixed the issue by adjusting the following code thusly
function mm_block_dashboard_access() { if (!defined( 'DOING_AJAX') && is_admin() && ! current_user_can( 'edit_posts' ) ) { wp_redirect( home_url() ); exit; } }
- The topic ‘Does what it says…but has a flaw that took me hours to fix’ is closed to new replies.