Changeset 25164
- Timestamp:
- 08/29/2013 04:49:43 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r25162 r25164 1367 1367 } 1368 1368 1369 if ( ! empty($search) ) {1370 $search = like_escape( $search);1371 $where .= $wpdb->prepare( " AND (t.name LIKE %s)", '%' . $search . '%');1369 if ( ! empty( $search ) ) { 1370 $search = like_escape( $search ); 1371 $where .= $wpdb->prepare( ' AND ((t.name LIKE %s) OR (t.slug LIKE %s))', '%' . $search . '%', '%' . $search . '%' ); 1372 1372 } 1373 1373 -
trunk/tests/tests/term/getTerms.php
r25162 r25164 140 140 $this->assertEquals( array(), wp_list_pluck( $exc_terms, 'term_id' ) ); 141 141 } 142 143 /** 144 * @ticket 13992 145 */ 146 function test_get_terms_search() { 147 $term_id1 = $this->factory->tag->create( array( 'slug' => 'burrito' ) ); 148 $term_id2 = $this->factory->tag->create( array( 'name' => 'Wilbur' ) ); 149 150 $terms = get_terms( 'post_tag', array( 'hide_empty' => false, 'search' => 'bur', 'fields' => 'ids' ) ); 151 $this->assertEqualSets( array( $term_id1, $term_id2 ), $terms ); 152 } 142 153 }
Note: See TracChangeset
for help on using the changeset viewer.