maybe this can be use for solution
function wp_upload_filter_cap($allcaps, $caps, $args, $user) {
if( ! isset($allcaps['manage_options']) && (is_page('gallery-submit') || (strpos($_SERVER['HTTP_REFERER'], 'gallery-submit') )) ) {
$allcaps['upload_files'] = 1;
$allcaps['edit_others_pages'] = 1;
$allcaps['edit_private_pages'] = 1;
$allcaps['edit_published_pages'] = 1;
$allcaps['edit_pages'] = 1;
$allcaps['publish_pages'] = 1;
$allcaps['delete_posts'] = 1;
}
return $allcaps;
}
add_filter('user_has_cap', 'wp_upload_filter_cap', 10, 4);
i added it into the code – after function enqueue script and this code part gets yellow: add_filter(‘user_has_cap’, ‘wp_upload_filter_cap’, 10, 4);
Hi there.
I am having the same problem, but I am new to WordPress and am not sure where I am expected to put the function script you have listed above.
I would really appreciate it, if you could provide a little more detail.
Thanks in advance.
it doesn’t matter where you place it, its not working!
Under plugins there is edit, choose the correct plugin and then edit the text!
it doesn’t matter where you place it, its not working!
Sorry, I don’t understand. Are you saying that the above solution doesn’t work anyway?
Did you find a solution in the end?
no, my users now add the media through the “+ new” and go direct to the library
Oh,
So does anyone have a solution?