Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Last active December 26, 2015 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shelob9/7177426 to your computer and use it in GitHub Desktop.
Save Shelob9/7177426 to your computer and use it in GitHub Desktop.
WordPress posts to be published tomorrow. See: http://JoshPress.net/blog/using-new-date-queries-wordpress-3-7
<?php
//get an array of the date 2 days from now
$twodayslater = getdate( current_time(‘timestamp’) + 2*DAY_IN_SECONDS );
$args = array(
'date_query' => array(
'before' => array(
'year' => $twodayslater['year'],
'month' => $twodayslater['mon'],
'day' => $twodayslater['mday'],
),
'inclusive' => false,
),
'post_status' => 'future'
);
$query = new WP_Query( $args );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment