I wish to permit contributors to add a file. So I exploit this beneficial plugin WP Function Editor
After activated, I am going to the plugin from Person > Person Function Editor
after which choose contributor within the choice dropdown. After that I put a examine on upload_files
and hit replace. Then, I login with contributor account to check importing a file. Nice, I see the media add button however once I click on to add a file, I get this error:
Sorry, you aren’t allowed to connect recordsdata to this submit
I posted a query about this of their help boards however the plugin creator hasn’t given an answer.
Now, I attempted the code beneath that I’ve present in Google. Nonetheless, it does not present the add media button in any respect.
// Let Contributor Function to Add Media
if( current_user_can( 'contributor' ) && ! current_user_can( 'upload_files' ) )
add_action( 'admin_init', 'allow_contributor_uploads' );
operate allow_contributor_uploads() {
$contributor = get_role( 'contributor' );
$contributor->add_cap( 'upload_files' );
}
So, what else can I do to get this finished? Why does not WordPress permit Contributor function to add a recordsdata? In accordance with the theme I exploit, I’ve to set this function by default for register customers if I would like customers to submit a submit with approval.