From 44bb61b223e28cba0ae069557f1cd8d7e89f9706 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 9 Aug 2018 06:25:09 -0400 Subject: [PATCH] Update the order of the custom fields order the custom fields by group then by their field order. --- setup/adminHooks.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/setup/adminHooks.php b/setup/adminHooks.php index 4c93ad2..053d3cf 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -278,9 +278,12 @@ add_filter( function( $content, $uid ){ $fields = $this->wpdb->get_results( $this->wpdb->prepare( - "SELECT id,field_name - FROM " . GLM_MEMBERS_FIELDS_PLUGIN_DB_PREFIX . "custom_fields - WHERE uid = %s", + "SELECT CF.id,CF.field_name + FROM " . GLM_MEMBERS_FIELDS_PLUGIN_DB_PREFIX . "custom_fields CF + LEFT OUTER JOIN " . GLM_MEMBERS_FIELDS_PLUGIN_DB_PREFIX . "custom_field_groups FG + ON ( FG.id = CF.gid ) + WHERE CF.uid = %s + ORDER BY FG.group_order,CF.field_order", $uid ), ARRAY_A -- 2.17.1