I previously asked and accepted a similar question here: wp_query and comment_parent - select only posts with top level comments
So I'm trying to use wp_query to select only posts that have comments. The problem I'm facing now is I have numerous filters as part of an advanced search e.g. name, location (country, area), tags etc etc and it is becoming to difficult to select post ids in the method shown in the accepted answer. There are just to many possible combinations of searches and options.
Ideally I need a way to exclude posts without a comment globally, in one hit.
I was hoping for something nice and easy like:
$args = array( 'post_type' => 'films', 'have_comments' => true );
But I cant seem to find anything like that.
I thought maybe a filter in functions.php or with the use of have_comments() somehow? I dont really want to select all posts and hide in the have posts loop if I can help it as there could potentially be hundreds of rows returned in wp_query that are not needed.
Sorry, I'm a beginner at this so I'm not really sure of a way forward.