From 91a25bf3e0b27daca308810f052e4a5b304c9888 Mon Sep 17 00:00:00 2001 From: Fellan-91 Date: Fri, 5 Jul 2024 16:10:00 +0300 Subject: [PATCH] fixed sorted by date --- classes/class-get-portfolio.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/classes/class-get-portfolio.php b/classes/class-get-portfolio.php index 24eb883c..41edc455 100644 --- a/classes/class-get-portfolio.php +++ b/classes/class-get-portfolio.php @@ -1432,6 +1432,10 @@ public static function get_query_params( $options, $for_filter = false, $layout_ * Now images with filled values ​​will be sorted first. * And empty images will be inserted later at the very end of the array. */ + if ( 'date' === $custom_order ) { + $custom_order = 'published_time'; + } + $images = self::sort_array_by_field( $images, $custom_order, $custom_order_direction ); break; case 'rand':