With content AND title:
function glsr_has_content_and_title($and, $handle) {
if ('query-review-ids' === $handle) {
$and['content_title'] = "AND (p.post_content <> '' AND p.post_title <> '')";
}
return $and;
}
// 1. Filter the SQL query
add_filter('site-reviews/query/sql/and', 'glsr_has_content_and_title', 10, 2);
// 2. Get your reviews
$reviews = apply_filters('glsr_get_reviews', []);
// 3. Remove the SQL query filter
remove_filter('site-reviews/query/sql/and', 'glsr_has_content_and_title');
With content OR title:
function glsr_has_content_or_title($and, $handle) {
if ('query-review-ids' === $handle) {
$and['content_title'] = "AND (p.post_content <> '' OR p.post_title <> '')";
}
return $and;
}
// 1. Filter the SQL query
add_filter('site-reviews/query/sql/and', 'glsr_has_content_or_title', 10, 2);
// 2. Get your reviews
$reviews = apply_filters('glsr_get_reviews', []);
// 3. Remove the SQL query filter
remove_filter('site-reviews/query/sql/and', 'glsr_has_content_or_title');