From: Steve Sutton Date: Thu, 9 Aug 2018 10:25:09 +0000 (-0400) Subject: Update the order of the custom fields X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=44bb61b223e28cba0ae069557f1cd8d7e89f9706;p=WP-Plugins%2Fglm-member-db-fields.git Update the order of the custom fields order the custom fields by group then by their field order. --- 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