Changeset 25257
- Timestamp:
- 09/05/2013 05:14:54 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r25241 r25257 1311 1311 } 1312 1312 1313 if ( ! empty( $inclusions ) ) 1313 if ( ! empty( $inclusions ) ) { 1314 1314 $inclusions = ' AND t.term_id IN ( ' . $inclusions . ' )'; 1315 $where .= $inclusions; 1315 $where .= $inclusions; 1316 } 1316 1317 1317 1318 $exclusions = ''; … … 1340 1341 1341 1342 $exclusions = apply_filters( 'list_terms_exclusions', $exclusions, $args ); 1342 $where .= $exclusions; 1343 1344 if ( ! empty( $exclusions ) ) 1345 $where .= $exclusions; 1343 1346 1344 1347 if ( !empty($slug) ) { -
trunk/tests/phpunit/tests/term/getTerms.php
r25241 r25257 122 122 123 123 /** 124 * @ti 125 * cket 11823 124 * @ticket 11823 126 125 */ 127 126 function test_get_terms_include_exclude() { 127 global $wpdb; 128 128 129 $term_id1 = $this->factory->tag->create(); 129 130 $term_id2 = $this->factory->tag->create(); … … 139 140 ) ); 140 141 $this->assertEquals( array(), wp_list_pluck( $exc_terms, 'term_id' ) ); 142 143 // These should not generate query errors. 144 get_terms( 'post_tag', array( 'exclude' => array( 0 ), 'hide_empty' => false ) ); 145 $this->assertEmpty( $wpdb->last_error ); 146 147 get_terms( 'post_tag', array( 'exclude' => array( 'unexpected-string' ), 'hide_empty' => false ) ); 148 $this->assertEmpty( $wpdb->last_error ); 149 150 get_terms( 'post_tag', array( 'include' => array( 'unexpected-string' ), 'hide_empty' => false ) ); 151 $this->assertEmpty( $wpdb->last_error ); 141 152 } 142 153
Note: See TracChangeset
for help on using the changeset viewer.