diff --git a/src/Optimization/Media.php b/src/Optimization/Media.php index cd93ae6..5184d36 100644 --- a/src/Optimization/Media.php +++ b/src/Optimization/Media.php @@ -182,7 +182,7 @@ public static function mediaLibraryMonthsWithFiles( $months = null ): array { month( post_date ) as month from {$wpdb->posts} where post_type = 'attachment' - order by post_date desc + order by year desc SQL );