Hi there, when users are uploading images to their galleries, these are also appearing in the WP Media library.
I don’t think it is very convenient that user submitted images are mixed with the rest of the image content of the site, like frontpage images, logos and backgrounds.
Would it be possible to hide all user submitted images from MediaPress in the Media Library or to redirect them to a folder of its own in the library?
Regards
CarstenHello Carsten,
Thank You for posting. You can use the following code to filter out MediaPress media from the Media library. Please give it a try.
add_filter( 'ajax_query_attachments_args', function ( $query ) { if ( is_admin() && is_user_logged_in() ) { $query['meta_key'] = '_mpp_is_mpp_media'; $query['meta_compare'] = 'NOT EXISTS'; } return $query; } );
Regards
RaviHello Ravi, I moved the code snippet from bp-custom.php to functions.php, don’t know if that makes any difference.
If your code works in your tests, I must have to debug on my site. It would be very helpfull to know if others have installed the code snippet on their site, to confirm that it is working on other sites.
Regards
Carsten
You must be logged in to reply to this topic.