From 3d4e67330b17990785e04b24eb277ef0e417ad78 Mon Sep 17 00:00:00 2001 From: Mike Auteri Date: Fri, 13 Sep 2024 16:21:50 -0400 Subject: [PATCH] Add comment. --- includes/classes/class-setup.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/classes/class-setup.php b/includes/classes/class-setup.php index 362e80a..4af943d 100644 --- a/includes/classes/class-setup.php +++ b/includes/classes/class-setup.php @@ -429,7 +429,8 @@ private function fix__0_30_0(): void { * @return void */ private function fix__0_31_0(): void { - $batch_size = 100; // Number of posts to process per batch. + // Add datetime meta and resave. + $batch_size = 100; $paged = 1; do { @@ -437,16 +438,14 @@ private function fix__0_31_0(): void { 'post_type' => 'gatherpress_event', 'posts_per_page' => $batch_size, 'paged' => $paged, - 'fields' => 'ids', // Only retrieve post IDs for efficiency. + 'fields' => 'ids', ); $query = new WP_Query( $args ); - // If no posts found, break the loop. if ( ! $query->have_posts() ) { break; } - // Loop through each post and update the meta. foreach ( $query->posts as $post_id ) { if ( get_post_meta( $post_id, 'gatherpress_datetime', true ) ) { continue;