Error with citations
-
Using this piece of code:
function wpse66093_no_admin_access() { $redirect = home_url( '/' ); if ( ! ( current_user_can( 'manage_options' ) || current_user_can( 'edit_posts' ) ) ) exit( wp_redirect( $redirect ) ); } add_action( 'admin_init', 'wpse66093_no_admin_access', 100 );
I picked from here:
https://wordpress.stackexchange.com/questions/66093/how-to-prevent-access-to-wp-admin-for-certain-user-roles(To restrict Admin area accesses)
Citations break for guests (it works though for logged in users)
Logged in:
Not logged in:
The error:
VM3892:1 Uncaught SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>) at Function.n.parseJSON (VM3835 jquery.js:4) at Function.a.parseJSON (VM3836 jquery-migrate.min.js:2) at Object.success (VM3867 zotpress.shortcode.intext.min.js:9) at i (VM3835 jquery.js:2) at Object.fireWith [as resolveWith] (VM3835 jquery.js:2) at x (VM3835 jquery.js:4) at XMLHttpRequest.c (VM3835 jquery.js:4)
For more information, the JSON that makes the error and it’s trying to parse, is the whole HTML output of the site.
The main difference, is that in this particular scenario, citations are shown with logged in users, while they are not shown for guests (similar case)
I’ve set up this example:
https://mcamargo.es/test-zotero-elementor-template/
- The topic ‘Error with citations’ is closed to new replies.