Changeset 7237
- Timestamp:
- 06/24/2013 06:59:22 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-classes.php
r7228 r7237 988 988 // these defaults). 989 989 $this->query_vars = wp_parse_args( $this->query_vars, array( 990 'group_id' => 0, 991 'group_role' => array( 'member' ), 990 'group_id' => 0, 991 'group_role' => array( 'member' ), 992 'is_confirmed' => true, 992 993 ) ); 993 994 … … 1027 1028 /** WHERE clauses *****************************************************/ 1028 1029 1030 // Group id 1029 1031 $sql['where'][] = $wpdb->prepare( "group_id = %d", $this->query_vars['group_id'] ); 1032 1033 // is_confirmed 1034 $is_confirmed = ! empty( $this->query_vars['is_confirmed'] ) ? 1 : 0; 1035 $sql['where'][] = $wpdb->prepare( "is_confirmed = %d", $is_confirmed ); 1030 1036 1031 1037 // Role information is stored as follows: admins have -
trunk/tests/includes/testcase.php
r7188 r7237 227 227 $r = wp_parse_args( $args, array( 228 228 'date_modified' => bp_core_current_time(), 229 'is_confirmed' => 1, 229 230 ) ); 230 231 … … 236 237 $new_member->user_title = ''; 237 238 $new_member->date_modified = $r['date_modified']; 238 $new_member->is_confirmed = 1;239 $new_member->is_confirmed = $r['is_confirmed']; 239 240 240 241 $new_member->save(); -
trunk/tests/testcases/groups/class-bp-group-member-query.php
r7145 r7237 299 299 } 300 300 301 public function test_confirmed_members() { 302 $g = $this->factory->group->create(); 303 $u1 = $this->create_user(); 304 $u2 = $this->create_user(); 305 306 $this->add_user_to_group( $u1, $g, array( 307 'date_modified' => gmdate( 'Y-m-d H:i:s', $time - 100 ), 308 'is_confirmed' => 0, 309 ) ); 310 311 $this->add_user_to_group( $u2, $g, array( 312 'date_modified' => gmdate( 'Y-m-d H:i:s', $time - 100 ), 313 'is_confirmed' => 1, 314 ) ); 315 316 $query_members = new BP_Group_Member_Query( array( 317 'group_id' => $g, 318 ) ); 319 320 $ids = wp_parse_id_list( array_keys( $query_members->results ) ); 321 $this->assertEquals( array( $u2 ), $ids ); 322 } 323 301 324 }
Note: See TracChangeset
for help on using the changeset viewer.