diff --git a/CHANGELOG.MD b/CHANGELOG.MD index f2c277c..197e445 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +- TMS-1075: Fix expirator bug + ## [1.9.0] - 2024-10-24 - TMS-1075: Redipress 2 filters diff --git a/lib/Expirator.php b/lib/Expirator.php index c0ab7f8..cd79232 100644 --- a/lib/Expirator.php +++ b/lib/Expirator.php @@ -21,9 +21,7 @@ class Expirator { * @return void */ public static function expirate() { - $args = [ - 'fields' => 'ids', 'post_type' => TreduEvent::SLUG, 'post_status' => 'publish', 'update_post_term_cache' => false, @@ -31,6 +29,7 @@ public static function expirate() { ]; $query = new \WP_Query( $args ); + $ids = \wp_list_pluck( $query->posts, 'ID' ); // Current time. $now = \current_time( 'mysql' ); @@ -58,7 +57,7 @@ public static function expirate() { \wp_update_post( $post_object ); } } - }, $query->posts ); + }, $ids ); } }