From a04a8b93d96443f509863a6442196c72f0c0f14f Mon Sep 17 00:00:00 2001 From: weryques Date: Tue, 31 Jul 2018 10:06:54 -0300 Subject: [PATCH] Order by metadatum value the results of fetch all metadatum values --- src/admin/scss/_modals.scss | 4 ++++ src/classes/repositories/class-tainacan-metadata.php | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/admin/scss/_modals.scss b/src/admin/scss/_modals.scss index ab9f9630d..6242c382c 100644 --- a/src/admin/scss/_modals.scss +++ b/src/admin/scss/_modals.scss @@ -3,6 +3,10 @@ width: 100%; } +.modal { + display: inline-block; +} + .tainacan-modal-title { h1, h2 { font-size: 20px; diff --git a/src/classes/repositories/class-tainacan-metadata.php b/src/classes/repositories/class-tainacan-metadata.php index bdeb61da0..c1476896c 100644 --- a/src/classes/repositories/class-tainacan-metadata.php +++ b/src/classes/repositories/class-tainacan-metadata.php @@ -860,7 +860,7 @@ class Metadata extends Repository { SELECT meta_key as metadatum_id, meta_value as mvalue, post_id FROM $wpdb->postmeta $search_query ) metas - ON items.item_id = metas.post_id AND metas.metadatum_id = %d", + ON items.item_id = metas.post_id AND metas.metadatum_id = %d ORDER BY mvalue", $item_post_type, $post_status, $metadatum_id ); } else { @@ -875,7 +875,7 @@ class Metadata extends Repository { SELECT meta_key as metadatum_id, meta_value as mvalue, post_id FROM $wpdb->postmeta $search_query ) metas - ON items.item_id = metas.post_id AND metas.metadatum_id = %d", + ON items.item_id = metas.post_id AND metas.metadatum_id = %d ORDER BY mvalue", $post_status, $metadatum_id ); } @@ -906,7 +906,7 @@ class Metadata extends Repository { SELECT meta_key as metadatum_id, meta_value as mvalue, post_id FROM $wpdb->postmeta $search_query ) metas - ON items.item_id = metas.post_id AND metas.metadatum_id = %d", + ON items.item_id = metas.post_id AND metas.metadatum_id = %d ORDER BY mvalue", $item_post_type, $post_status, $metadatum_id ); } else { @@ -921,7 +921,7 @@ class Metadata extends Repository { SELECT meta_key as metadatum_id, meta_value as mvalue, post_id FROM $wpdb->postmeta $search_query ) metas - ON items.item_id = metas.post_id AND metas.metadatum_id = %d", + ON items.item_id = metas.post_id AND metas.metadatum_id = %d ORDER BY mvalue", $post_status, $metadatum_id ); }