Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yellowberri-snippets/6442806 to your computer and use it in GitHub Desktop.
Save yellowberri-snippets/6442806 to your computer and use it in GitHub Desktop.
PHP: WP: Post Expiration Query Args
// Include the ACF field "post_expiration",
// Field type = Date & Time Picker
// "Get field as timestamp" should set to "Yes".
$today = current_time('timestamp');
$args = array (
'meta_key' => 'post_expiration',
'meta_value' => $today,
'meta_compare' => '>='
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment