This file contains hidden or 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
function trash_past_events() { | |
$args = array( | |
'post_type' => 'event', | |
'posts_per_page' => -1, | |
'meta_key' => '_date', | |
'meta_value' => time(), | |
'meta_compare' => '<' | |
); | |
$events = new WP_Query($args); | |
if ($events->have_posts()) { |
This file contains hidden or 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 | |
/** | |
* I want to get this query to also desplay events that are on the current day. | |
* Any Ideas on how I can do that? | |
* I added '>=' instead of '>' but it did not do anything. | |
* I assume time() does not work when comparing to date becuase the date starts at 0:00, so anytime on the current day will be past 0:00 | |
*/ | |
$args = array( | |
'post_type' => 'event', |