Skip to content

Commit

Permalink
Merge pull request #185 from devgeniem/TMS-1075-expirator
Browse files Browse the repository at this point in the history
TMS-1075-expirator: Fix expirator bug
  • Loading branch information
eebbi authored Nov 6, 2024
2 parents 94b7fb1 + 984a543 commit 70d7dc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions lib/Expirator.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ class Expirator {
* @return void
*/
public static function expirate() {

$args = [
'fields' => 'ids',
'post_type' => TreduEvent::SLUG,
'post_status' => 'publish',
'update_post_term_cache' => false,
'posts_per_page' => -1,
];

$query = new \WP_Query( $args );
$ids = \wp_list_pluck( $query->posts, 'ID' );

// Current time.
$now = \current_time( 'mysql' );
Expand Down Expand Up @@ -58,7 +57,7 @@ public static function expirate() {
\wp_update_post( $post_object );
}
}
}, $query->posts );
}, $ids );
}
}

0 comments on commit 70d7dc2

Please sign in to comment.