What does it his achieve?
I need every instructor to be able to upload any files to support their courses, but not see files uploaded by admin or by other instructors.
Sorry i referred you the wrong tip .If you want to hide all of the content alongwith the posts and categories please enable the Force instructor content privacy from wplms course manager .
If you just want to hide the media then please add this code in your wplms-customizer.php file in wplms customizer plugin .
add_action('init','add_custom_filters');
function add_custom_filters(){
remove_filter( 'posts_where', 'wplms_attachments_wpquery_where',10 );
add_filter( 'posts_where', 'custom_wplms_attachments_wpquery_where',30);
}
function custom_wplms_attachments_wpquery_where( $where ){
if( is_user_logged_in() && current_user_can('edit_posts')){
global $current_user;
if( isset( $_POST['action'] ) ){
if( $_POST['action'] == 'query-attachments' ){
$where .= ' AND post_author='.$current_user->data->ID;
}
}
}
return $where;
}