Hi,
I am using frontend submission for custom post type submit from frontend. I am using meta box with image_advanced and file_input fields types as custom meta. At time of uploading an images or files from frontend as subscriber , they can currently see the whole media library that's mean other users uploaded data they can see or select from media library.
After upload it's showing media library with other users uploaded data that's wrong they can see only mine data. There is any solution for that please reply me as soon as possible. I have added below code for allow subscriber to upload file or image from frontend
function mb_allow_subscriber_uploads() {
if ( is_admin() ) {
return;
}
// Replace 'subscriber' with the required role to update, can also be contributor.
$subscriber = get_role( 'subscriber' );
$subscriber->add_cap( 'upload_files' );
}
add_action( 'init', 'mb_allow_subscriber_uploads' );
Thanks
Ahmed