The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Is there a way to f...
 
Share:
Notifications
Clear all

Is there a way to filter or seperate images uploaded by users within the WP media browser interface?

6 Posts
2 Users
1 Reactions
1,784 Views
AdamTheForumUser
Posts: 84
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
(@adamtheforumuser)
Estimable Member
Joined: 5 years ago
[#2072]

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 ?


5 Replies
Asti
Posts: 8208
 Asti
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
(@asti)
Illustrious Member
Joined: 8 years ago

Hi AdamTheForumUser,

I'm really sorry, but there isn't an easy solution for this. 


Reply
2 Replies
AdamTheForumUser
(@adamtheforumuser)
Joined: 5 years ago

Estimable Member
Posts: 84
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

@asti there's no plugin for example that you are aware of?


Reply
Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8208
Asti
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

I'm really sorry, but I'm not familiar with that kind of plugins.


Reply
AdamTheForumUser
Posts: 84
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
(@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 ?


Reply
1 Reply
Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8208
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

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. 


Reply
Share: