Last active
December 26, 2015 16:09
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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