With a multi-user WordPress site all users can see all images in the media library – whether uploaded by them or not. This is in no way ideal.
However, you can easily address the issue with a snip in your theme’s functions.php file:
add_filter( 'posts_where', 'devplus_wpquery_where' );
function devplus_wpquery_where( $where ){
global $current_user;
if( is_user_logged_in() ){
// logged in user, but are we viewing the library?
if( isset( $_POST['action'] ) && ( $_POST['action'] == 'query-attachments' ) ){
// here you can add some extra logic if you'd want to.
$where .= ' AND post_author='.$current_user->data->ID;
}
}
return $where;
}
This adds another layer of privacy for your site’s users.




