Changeset 30031
- Timestamp:
- 10/26/2014 10:56:36 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r29945 r30031 833 833 */ 834 834 protected static function is_first_order_clause( $query ) { 835 return empty( $query ) || array_key_exists( 'terms', $query ) || array_key_exists( 'taxonomy', $query ) || array_key_exists( 'include_children', $query ) || array_key_exists( 'field', $query ) || array_key_exists( 'operator', $query);835 return is_array( $query ) && ( empty( $query ) || array_key_exists( 'terms', $query ) || array_key_exists( 'taxonomy', $query ) || array_key_exists( 'include_children', $query ) || array_key_exists( 'field', $query ) || array_key_exists( 'operator', $query ) ); 836 836 } 837 837 -
trunk/tests/phpunit/tests/term/query.php
r29931 r30031 84 84 85 85 $this->assertEquals( array( 'foo', ), $tq->queries[0]['terms'] ); 86 } 87 88 /** 89 * @ticket 30117 90 */ 91 public function test_construct_empty_strings_array_members_should_be_discarded() { 92 $q = new WP_Tax_Query( array( 93 '', 94 array( 95 'taxonomy' => 'post_tag', 96 'terms' => 'foo', 97 ), 98 ) ); 99 100 $this->assertSame( 1, count( $q->queries ) ); 86 101 } 87 102
Note: See TracChangeset
for help on using the changeset viewer.