- Timestamp:
- 04/01/2015 11:14:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/classes/class-bp-xprofile-group.php
r9671 r9676 82 82 global $wpdb; 83 83 84 $group = wp_cache_get( 'xprofile_group_' . $this->id, 'bp' );84 $group = wp_cache_get( $id, 'bp_xprofile_groups' ); 85 85 86 86 if ( false === $group ) { 87 $bp = buddypress();87 $bp = buddypress(); 88 88 $group = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_groups} WHERE id = %d", $id ) ); 89 wp_cache_set( $id, $group, 'bp_xprofile_groups' ); 89 90 } 90 91 … … 94 95 95 96 $this->id = $group->id; 96 $this->name = stripslashes( $group->name );97 $this->description = stripslashes( $group->description );97 $this->name = $group->name; 98 $this->description = $group->description; 98 99 $this->can_delete = $group->can_delete; 99 100 $this->group_order = $group->group_order; … … 456 457 457 458 // If cached data is found, use it 458 $cache_key = 'xprofile_group_' . $group_id; 459 $group_data = wp_cache_get( $cache_key, 'bp' ); 459 $group_data = wp_cache_get( $group_id, 'bp_xprofile_groups' ); 460 460 if ( false !== $group_data ) { 461 461 $groups[ $group_id ] = $group_data; … … 493 493 494 494 // Cache previously uncached group data 495 $cache_key = 'xprofile_group_' . $gdata->id; 496 wp_cache_set( $cache_key, $gdata, 'bp' ); 495 wp_cache_set( $gdata->id, $gdata, 'bp_xprofile_groups' ); 497 496 } 498 497 } … … 543 542 544 543 // Purge profile field group cache 545 wp_cache_delete( ' xprofile_groups_inc_empty', 'bp' );544 wp_cache_delete( 'all', 'bp_xprofile_groups' ); 546 545 547 546 $bp = buddypress(); … … 608 607 global $wpdb; 609 608 610 $default_visibility_levels = wp_cache_get( ' xprofile_default_visibility_levels', 'bp' );609 $default_visibility_levels = wp_cache_get( 'default_visibility_levels', 'bp_xprofile' ); 611 610 612 611 if ( false === $default_visibility_levels ) { … … 628 627 } 629 628 630 wp_cache_set( ' xprofile_default_visibility_levels', $default_visibility_levels, 'bp' );629 wp_cache_set( 'default_visibility_levels', $default_visibility_levels, 'bp_xprofile' ); 631 630 } 632 631
Note: See TracChangeset
for help on using the changeset viewer.