Skip to content

Instantly share code, notes, and snippets.

@tonydjukic
Last active February 4, 2018 22:25
Show Gist options
  • Save tonydjukic/cdf8e1d47a4a3fe3a440bffe5227a89d to your computer and use it in GitHub Desktop.
Save tonydjukic/cdf8e1d47a4a3fe3a440bffe5227a89d to your computer and use it in GitHub Desktop.
Nested WP Query Arguments
<?php
$sitesuper_notification_args = array(
'post_type' => 'cs_submissions',
'post_status' => 'publish',
'posts_per_page' => -1,
'orderby' => 'date',
'order' => 'DESC',
//The meta_query will list any customer satisfaction survey responses that answered a question negatively or below an accepted threshold.
//It also only lists those items that have NOT yet been flagged as 'resolved'.
'meta_query' => array(
'relation' => 'OR',
array(
'relation' => 'AND',
array(
'key' => 'overall_rating',
'value' => 8,
'type' => 'numeric',
'compare' => '<='
),
array(
'key' => 'overall_rating_resolved',
'value' => 'false',
'compare' => '='
),
),
array(
'relation' => 'AND',
array(
'key' => 'frontdesk_staff',
'value' => 'false',
'compare' => '='
),
array(
'key' => 'frontdesk_staff_resolved',
'value' => 'false',
'compare' => '='
),
),
array(
'relation' => 'AND',
array(
'key' => 'recommend_us',
'value' => 'false',
'compare' => '='
),
array(
'key' => 'recommend_us_resolved',
'value' => 'false',
'compare' => '='
),
),
),
);
?>
@tonydjukic
Copy link
Author

Note: This has repeatedly caused a gateway timeouts on some low resource servers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment