Limit visibility of Media Gallery to ONLY current user's files

Home Forums Legacy Support Support queries Setup issues Limit visibility of Media Gallery to ONLY current user's files

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #12224
    enzofsilva
    Spectator
    What is an approved way or plugin to use with WPLMS that limits visibility of media gallery items to only those items uploaded by the current user? I don't want instructors having full access to the gallery (including my files and files of other instructors).
    #12329
    Anshuman Sahu
    Keymaster
    #12395
    enzofsilva
    Spectator
    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.
    #12531
    Anshuman Sahu
    Keymaster
    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; }  
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Limit visibility of Media Gallery to ONLY current user's files’ is closed to new replies.