Changeset 7903
- Timestamp:
- 02/17/2014 12:35:26 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-classes.php
r7898 r7903 176 176 177 177 if ( $group = $wpdb->get_row( $wpdb->prepare( "SELECT g.* FROM {$bp->groups->table_name} g WHERE g.id = %d", $this->id ) ) ) { 178 if ( ! empty( $this->args['update_meta_cache'] ) ) {179 bp_groups_update_meta_cache( $this->id );180 }181 182 178 $this->id = $group->id; 183 179 $this->creator_id = $group->creator_id; -
trunk/bp-groups/bp-groups-functions.php
r7898 r7903 45 45 'load_users' => false, 46 46 'populate_extras' => true, 47 'update_meta_cache' => true,48 47 ); 49 48 … … 56 55 $group_args = array( 57 56 'populate_extras' => $populate_extras, 58 'update_meta_cache' => $update_meta_cache,59 57 ); 60 58 -
trunk/tests/testcases/groups/functions.php
r7887 r7903 438 438 /** 439 439 * @group groupmeta 440 * @group groups_get_groupmeta 441 * @group cache 442 */ 443 public function test_groups_get_groupmeta_cache_all_on_get() { 444 $g = $this->factory->group->create(); 445 groups_add_groupmeta( $g, 'foo', 'bar' ); 446 groups_add_groupmeta( $g, 'foo1', 'baz' ); 447 $this->assertFalse( wp_cache_get( $g, 'group_meta' ) ); 448 449 // A single query should prime the whole meta cache 450 groups_get_groupmeta( $g, 'foo' ); 451 452 $c = wp_cache_get( $g, 'group_meta' ); 453 $this->assertNotEmpty( $c['foo1'] ); 454 } 455 456 /** 457 * @group groupmeta 440 458 */ 441 459 public function test_groups_delete_groupmeta_non_numeric_id() {
Note: See TracChangeset
for help on using the changeset viewer.