From 7237f25b3f122d27a4d48d3bccc4c60d5fb9335f Mon Sep 17 00:00:00 2001 From: Nikita Date: Wed, 10 Jul 2024 17:27:52 +0300 Subject: [PATCH] Update class-get-portfolio.php --- classes/class-get-portfolio.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/class-get-portfolio.php b/classes/class-get-portfolio.php index 41edc455..ab1ad149 100644 --- a/classes/class-get-portfolio.php +++ b/classes/class-get-portfolio.php @@ -1427,15 +1427,15 @@ public static function get_query_params( $options, $for_filter = false, $layout_ case 'image_caption': case 'image_alt': case 'image_description': + if ( 'date' === $custom_order ) { + $custom_order = 'published_time'; + } + /** * We've reworked this code to work correctly with empty sortable values. * 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':