Closed MaraScott closed 3 years ago
Hi @davask,
Well, if you take a closer look at the Query.php file you'll notice that it includes some undocumented filter hooks that you can use to alter the query without having to edit the code :P Please check lines 460 to 466 for more details.
Hi @cabrerahector,
I was such in hurry to find a quick fix I missed that point. Thanks for the heads up. The filter is now in place.
Best regards,
david
Is your feature request related to a problem? Please describe. On our website we have post which have a publication status as published or private with a visibility status as public or private. We can t filter out content that have a visibility status as private.
Describe the solution you'd like We like an extra parameter that would allow us to add extra where clause like
AND (SELECT pm.meta_value FROM wp_postmeta as pm WHERE pm.post_id = p.ID AND pm.meta_key = 'visibility') <> 'private'
or extra parameter that specificaly target wp_postmeta key/value pairDescribe alternatives you've considered so far we put in file wp-content/plugins/wordpress-popular-posts/src/Query.php l.455 the following
$where .= " AND (SELECT pm.meta_value FROM wp_postmeta as pm WHERE pm.post_id = p.ID AND pm.meta_key = 'visibility') <> 'private'";