The effects of alcohol on
sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Is there a way to filter or seperate images uploaded by users within the WP media browser interface?
✦ Summarize Topic
✦
✦
✦
AI is analyzing the discussion...
How-to and Troubleshooting
Topic starter
Translate
▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Show original
Translating...
May 22, 2021 3:02 am
(@adamtheforumuser)
Estimable Member
Joined: 5 years ago
I've just realised on a site that is about to go live that the standard WP media browser for the site now also contains images uploaded by other users via the comments front-end.
I really need a way to filter the images from there. It would be useful to have access in this interface (although not vital). But it's really important that the users images can be hidden if desired so that I only see images uploaded by the content editors of this site that are connected to the posts/pages they author.
Is there an easy way to do this ?
Support
Translate
▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Show original
Translating...
May 22, 2021 12:45 pm
(@asti)
Illustrious Member
Joined: 8 years ago
Hi AdamTheForumUser,
I'm really sorry, but there isn't an easy solution for this.
(@adamtheforumuser)
Joined: 5 years ago
Estimable Member
Posts: 84
May 22, 2021 3:04 pm
Translate
▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Show original
Translating...
@asti there's no plugin for example that you are aware of?
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8208
May 23, 2021 3:07 pm
Translate
▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Show original
Translating...
I'm really sorry, but I'm not familiar with that kind of plugins.
Topic starter
Translate
▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Show original
Translating...
May 23, 2021 10:19 pm
(@adamtheforumuser)
Estimable Member
Joined: 5 years ago
I've come up with a solution that for our particular scenario is good enough, which I will share below in case useful for others.
Basically it alters the WP admin to only list images belonging to that particular author when using interfaces like the media library page. As this is pretty much a one person admin site it works although clearly it wouldn't be flexible enough for some others.
// hide users media upload (via wpdiscuz in the media library interface)
add_filter( 'ajax_query_attachments_args', 'wpb_show_current_user_attachments' );
function wpb_show_current_user_attachments( $query ) {
$user_id = get_current_user_id();
if( $user_id ) {
$query['author'] = $user_id;
}
return $query;
}
I'm surprised there isn't some way to handle this at all in the plugin. You must have had others asking about this I assume ? Can I make it a wishlist request if you are keeping wishes from customers ?
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8208
May 24, 2021 12:12 pm
Translate
▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Show original
Translating...
Thank you for sharing the code.
I'll ask the developers to take this into consideration. They'll add the code if it's possible.