Last active
August 9, 2017 08:38
-
-
Save bencooling/3990625 to your computer and use it in GitHub Desktop.
Prevent Authors from seeing other authors media files
Thanks for the heads up with ACF. I'll look into that when I get a chance! READ: Not for a while LOL
Hello
I already put this code into function.php
Right, another author only can view their own images.
But , as administrator I can not view all images in media library.
No one or more images display in media library as administrator.
Any idea ?
my site is http://www.propertypilihan.com
I am already upgrade wordpress to latest version , and as administrator I can see all images.
Your code running.
Thanks
As hlotvonen said, this code seems to conflict ACF .
So I recommend you to add .
if($wp_query->query_vars['post_type']!=='attachment'){ return; }
Regards.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is conflicting with Advanced Custom Fields, because ACF uses admin-ajax calls, so while this is the only function that hides other authors media from media upload dialog, it also prevents ACF from working in author profile.