Skip to content

Instantly share code, notes, and snippets.

@prionkor
Last active December 26, 2015 19:19
Show Gist options
  • Save prionkor/7200935 to your computer and use it in GitHub Desktop.
Save prionkor/7200935 to your computer and use it in GitHub Desktop.
Meta Query Wordpress
// Get stat data that is older then 30 days
$args = array(
'post_type' => 'site',
'post_per_page' => 1,
'meta_key' => 'stat_updated',
'meta_value_num' => time() - 60*60*24*30, // one month before
'meta_compare' => '<'
);
$query = new WP_Query( $args );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment