Limited Support
Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed. We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.
Have some issue, all user have role 'Subscriber' and when try subscribe to user have error:
SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at Function.n.parseJSON (jquery.js?ver=1.12.4:4)
at Function.a.parseJSON (jquery-migrate.min.js?ver=1.4.1:2)
at Object.<anonymous> (wpdiscuz.js?ver=5.1.5:1344)
at i (jquery.js?ver=1.12.4:2)
at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
at y (jquery.js?ver=1.12.4:4)
at XMLHttpRequest.c (jquery.js?ver=1.12.4:4)
If user role is Contributor/Author/Editor/Administrator all is ok
Hi kingstakh,
Please check does your current active theme contains wp_redirect function? If so, please comment that part and check again.
I guess this is a similar issue, as described in this post.
https://gvectors.com/forum/how-to-and-troubleshooting/problem-with-user-roles/#post-9302
https://gvectors.com/forum/how-to-and-troubleshooting/problem-with-user-roles/#post-9302 link return 404 error
I'm sorry, the topic is private.
Please confirm whether you have found the wp_redirect function in the current active theme?
In that topic, there is a similar issue. In the current active theme, there was the following function:
add_action('admin_init', 'disable_dashboard');
function disable_dashboard() {
if (current_user_can('subscriber') && is_admin()) {
$current_user = wp_get_current_user();
wp_redirect('/author/'.$current_user->user_login.'');
exit;
}
}
that was changed to the following one and it started to work correctly.
add_action('admin_init', 'disable_dashboard');
function disable_dashboard() {
if (current_user_can('subscriber') && (is_admin() && defined('DOING_AJAX') && !DOING_AJAX)) {
$current_user = wp_get_current_user();
wp_redirect('/author/'.$current_user->user_login.'');
exit;
}
}
Excellent! I have function with disable dashboard to, now is all ok! Thank you!