Changeset 7792 for trunk/bp-xprofile/bp-xprofile-classes.php
- Timestamp:
- 02/05/2014 07:17:01 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-classes.php
r7791 r7792 1131 1131 global $wpdb, $bp; 1132 1132 1133 $retval = $wpdb->get_row( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_data} WHERE user_id = %d AND field_id = %d", $this->user_id, $this->field_id ) ); 1133 // Check cache first 1134 $cached = wp_cache_get( $this->field_id, 'bp_xprofile_data_' . $this->user_id ); 1135 1136 if ( $cached ) { 1137 $retval = true; 1138 } else { 1139 $retval = $wpdb->get_row( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_data} WHERE user_id = %d AND field_id = %d", $this->user_id, $this->field_id ) ); 1140 } 1134 1141 1135 1142 return apply_filters_ref_array( 'xprofile_data_exists', array( (bool)$retval, $this ) );
Note: See TracChangeset
for help on using the changeset viewer.