Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function my_files_only( $wp_query ) {
- if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/upload.php' ) !== false ) {
- if ( !current_user_can( 'level_5' ) ) {
- global $current_user;
- $wp_query->set( 'author', $current_user->id );
- }
- }
- }
- add_filter('parse_query', 'my_files_only' );
- //Remove Media Library Tab
- function remove_medialibrary_tab($tabs) {
- if ( !current_user_can( 'administrator' ) ) {
- unset($tabs['library']);
- return $tabs;
- }
- else
- {
- return $tabs;
- }
- }
- add_filter('media_upload_tabs','remove_medialibrary_tab');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement