- Timestamp:
- 12/29/2016 02:16:02 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/classes/class-bp-xprofile-field.php
r11316 r11352 918 918 } 919 919 920 $sql = $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s AND parent_id = 0", $field_name ); 921 922 $query = $wpdb->get_var( $sql ); 923 924 return is_numeric( $query ) ? (int) $query : $query; 920 $id = bp_core_get_incremented_cache( $field_name, 'bp_xprofile_fields_by_name' ); 921 if ( false === $id ) { 922 $sql = $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s AND parent_id = 0", $field_name ); 923 $id = $wpdb->get_var( $sql ); 924 bp_core_set_incremented_cache( $field_name, 'bp_xprofile_fields_by_name', $id ); 925 } 926 927 return is_numeric( $id ) ? (int) $id : $id; 925 928 } 926 929
Note: See TracChangeset
for help on using the changeset viewer.