File Attachment Err...
 
Notifications
Clear all

Limited Support

Our support team is currently on holiday from December 25, 2025 to January 7, 2026, and replies may be delayed during this period.

We appreciate your patience and understanding while our team is away. Thank you for being part of the wpForo community!

Merry Christmas and Happy Holidays! 🎄

[Solved] File Attachment Error for non admin Members

2 Posts
1 Users
1 Reactions
1,121 Views
Posts: 2
Topic starter
(@dcclow)
New Member
Joined: 2 years ago
Error SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
 
Non admin members are unable to upload attachments using the paid addon. This error shows when trying to add files But works fine for admin.

1 Reply
Posts: 2
Topic starter
(@dcclow)
New Member
Joined: 2 years ago

Found the issue, this code was running in snippits:

function restrict_dashboard_access() {
if (is_user_logged_in()) {
$current_user = wp_get_current_user();
$user_roles = $current_user->roles;
if (!in_array('administrator', $user_roles)) {
wp_redirect(home_url());
exit;
}
}
}
add_action('admin_init', 'restrict_dashboard_access');

 

This was stopping the upload feature.