Changeset 14068 for trunk/src/bp-xprofile/bp-xprofile-functions.php
- Timestamp:
- 11/01/2024 06:07:04 AM (13 months ago)
- File:
-
- 1 edited
-
trunk/src/bp-xprofile/bp-xprofile-functions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-functions.php
r13890 r14068 1478 1478 * 1479 1479 * @since 8.0.0 1480 * @since 15.0.0 The SQL request was adapted to support WP Playground's SQLite DB. 1480 1481 * 1481 1482 * @global wpdb $wpdb WordPress database object. … … 1490 1491 $bp = buddypress(); 1491 1492 1492 $signup_field_ids = $wpdb->get_col( "SELECT object_id FROM {$bp->profile->table_name_meta} WHERE object_type = 'field' AND meta_key = 'signup_position' ORDER BY CONVERT(meta_value, SIGNED) ASC" ); 1493 // WP Playground's SQLite DB does not support CONVERT AS SIGNED. 1494 $results = $wpdb->get_results( "SELECT object_id, meta_value FROM {$bp->profile->table_name_meta} WHERE object_type = 'field' AND meta_key = 'signup_position'" ); 1495 $signup_field_ids = array(); 1496 1497 foreach ( $results as $result ) { 1498 $index = (int) $result->meta_value; 1499 $signup_field_ids[ $index ] = (int) $result->object_id; 1500 } 1501 1502 // Sort. 1503 ksort( $signup_field_ids ); 1493 1504 1494 1505 wp_cache_set( 'signup_fields', $signup_field_ids, 'bp_xprofile' ); 1495 1506 } 1496 1507 1497 return array_ map( 'intval',$signup_field_ids );1508 return array_values( $signup_field_ids ); 1498 1509 } 1499 1510
Note: See TracChangeset
for help on using the changeset viewer.