Changeset 9662
- Timestamp:
- 03/30/2015 06:41:44 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-user-query.php
r9661 r9662 461 461 if ( preg_match( '/' . $wpdb->term_relationships . '\.term_taxonomy_id IN \([0-9, ]+\)/', $member_type_sql_clauses['where'], $matches ) ) { 462 462 $sql['where']['member_type'] = "u.{$this->uid_name} IN ( SELECT object_id FROM $wpdb->term_relationships WHERE {$matches[0]} )"; 463 } elseif ( false !== strpos( $member_type_sql_clauses['where'], '0 = 1' ) ) { 464 $sql['where']['member_type'] = $this->no_results['where']; 463 465 } 464 466 } -
trunk/tests/phpunit/testcases/core/class-bp-user-query.php
r9577 r9662 484 484 } 485 485 486 /** 487 * @group member_types 488 * @ticket BP6334 489 */ 490 public function test_should_return_no_results_when_no_users_match_the_specified_member_type() { 491 bp_register_member_type( 'foo' ); 492 $users = $this->factory->user->create_many( 3 ); 493 494 $q = new BP_User_Query( array( 495 'member_type' => 'foo, baz', 496 ) ); 497 498 $this->assertEmpty( $q->results ); 499 } 486 500 487 501 /**
Note: See TracChangeset
for help on using the changeset viewer.