I'm trying to show in media modal box, attachments from a specific folder in my website and, correct me if I'm wrong, the best way to proceed is a like filter on wp_posts field GUID. Something like and ({$wpdb->posts}.guid LIKE '%/uploads_media_news/%')).


Problem is I don't really know where to apply this filter: is it better to act on backbone.js? On a .php file, perhaps ajax-actions.php?

I don't really know what to do anymore, I've been working on this change for 3 days with no result.

  • I think I'm moving closer to a solution: thanks to this solution, I modified the function to check if(isset($meta['file']) && strpos($meta['file'], 'media_news') !== FALSE). The problem now is .png images wont show. – MikeIsBurningInHell Feb 24 '17 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.