Skip to content

Commit 70d7dc2

Browse files
authored
Merge pull request #185 from devgeniem/TMS-1075-expirator
TMS-1075-expirator: Fix expirator bug
2 parents 94b7fb1 + 984a543 commit 70d7dc2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.MD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
- TMS-1075: Fix expirator bug
11+
1012
## [1.9.0] - 2024-10-24
1113

1214
- TMS-1075: Redipress 2 filters

lib/Expirator.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,15 @@ class Expirator {
2121
* @return void
2222
*/
2323
public static function expirate() {
24-
2524
$args = [
26-
'fields' => 'ids',
2725
'post_type' => TreduEvent::SLUG,
2826
'post_status' => 'publish',
2927
'update_post_term_cache' => false,
3028
'posts_per_page' => -1,
3129
];
3230

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

3534
// Current time.
3635
$now = \current_time( 'mysql' );
@@ -58,7 +57,7 @@ public static function expirate() {
5857
\wp_update_post( $post_object );
5958
}
6059
}
61-
}, $query->posts );
60+
}, $ids );
6261
}
6362
}
6463

0 commit comments

Comments
 (0)