Tribe__Events__Event_Cleaner_Scheduler::move_old_events_to_trash()
Moves to trash events that ended before a date specified by user
Return
(array<string,WP_Post|false|null>) An associative array of ID to the result of wp_trash_post().
Source
File: src/Tribe/Event_Cleaner_Scheduler.php
public function move_old_events_to_trash() {
$month = $this->trash_new_date;
$post_ids = $this->select_events_to_purge( $month );
if ( empty( $post_ids ) ) {
return;
}
foreach ( $post_ids as $post_id ) {
wp_trash_post( $post_id );
}
}
Changelog
| Version | Description |
|---|---|
| 6.0.13 | Added a return value, and suspends Tribe<strong>Events</strong>Dates__Known_Range::rebuild_known_range() until batch is complete. |
| 4.6.13 | Introduced. |