Changeset 1870
- Timestamp:
- 09/14/2009 06:38:21 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-classes.php
r1868 r1870 80 80 function get_fields() { 81 81 global $wpdb, $bp; 82 83 /* Find the max value for field_order, if it is zero, order by field_id instead -- provides backwards compat ordering */ 84 if ( !(int) $wpdb->get_var( $wpdb->prepare( "SELECT MAX(field_order) FROM {$bp->profile->table_name_fields} WHERE group_id = %d", $this->id ) ) ) 85 $order_sql = "ORDER BY id"; 86 else 87 $order_sql = "ORDER BY field_order"; 82 88 83 89 // Get field ids for the current group. 84 if ( !$fields = $wpdb->get_results( $wpdb->prepare("SELECT id, type FROM {$bp->profile->table_name_fields} WHERE group_id = %d AND parent_id = 0 ORDER BY field_order", $this->id ) ) )90 if ( !$fields = $wpdb->get_results( $wpdb->prepare("SELECT id, type FROM {$bp->profile->table_name_fields} WHERE group_id = %d AND parent_id = 0 {$order_sql}", $this->id ) ) ) 85 91 return false; 86 92
Note: See TracChangeset
for help on using the changeset viewer.