admin_init breaks the Rusumes page.
-
I have some code in my functions.php that redirects logged in users based on their role. Here is the code:
function dc_redirect_non_admin_users() { if (current_user_can('editor') || current_user_can('employer')) { wp_redirect(site_url() . '/job-dashboard'); exit; } elseif (current_user_can('administrator')) { wp_redirect(site_url() . '/wp-admin'); } else { wp_redirect(site_url() . '/jobs'); } } add_action('admin_init', 'dc_redirect_non_admin_users');
The code works as expected but breaks the Resumes page. When I try and load that page, all it does is give me the AJAX spinner. If I comment out that section of code, everything works correctly.
Here is where you can check it out:
https://staging.zlausa.com
user: testing
pass: testing
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘admin_init breaks the Rusumes page.’ is closed to new replies.