Last active
September 12, 2017 11:31
-
-
Save mklasen/a6aa427a0d78254085259258457fcbcb to your computer and use it in GitHub Desktop.
Hide images where user is not an author of in media library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Only show images owned by user | |
add_filter( 'ajax_query_attachments_args', function ( $query ) { | |
$query['author'] = get_current_user_id(); | |
return $query; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment