Blocks file upload by users
-
The plugin successfully allows you to change avatars. But it blocks users from downloading files to articles.
I have created a form for adding posts (to the front end) using the “Advanced Custom Fields”. After activating the “WP User Avatar” plugin, the file upload function stopped working, writes: “Unfortunately, you are not allowed to attach files to this record.”
I tried to add the code in function.php:
add_action('admin_init', 'setup_author_role'); function setup_author_role() { $role = get_role( 'author' ); $role->add_cap('upload_files'); $role->add_cap('edit_published_posts'); $role->add_cap('edit_others_posts'); $role->add_cap('publish_posts'); } add_action('admin_init', 'setup_contributor_role'); function setup_contributor_role() { $role = get_role( 'contributor' ); $role->add_cap('upload_files'); $role->add_cap('edit_published_posts'); $role->add_cap('edit_others_posts'); $role->add_cap('publish_posts'); } ?>
did not help ??
- The topic ‘Blocks file upload by users’ is closed to new replies.